* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

.font-mono-custom {
    font-family: 'JetBrains Mono', monospace;
}

.gradient-bg {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #c2410c 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

.dark .gradient-bg {
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 50%, #7c2d12 100%);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-card {
    background: rgba(31, 41, 55, 0.7);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.macro-bar {
    transition: width 0.5s ease-in-out;
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.dark .noise-overlay {
    opacity: 0.05;
}

.shimmer-btn {
    position: relative;
    overflow: hidden;
}

.shimmer-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.shimmer-btn:hover::after {
    left: 100%;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #f97316, #06b6d4);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

input:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.dark input:focus, .dark select:focus {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.3);
}

.markdown-content {
    color: #374151;
}

.dark .markdown-content {
    color: #e5e7eb;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    font-weight: 700;
    color: #111827;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.dark .markdown-content h1,
.dark .markdown-content h2,
.dark .markdown-content h3,
.dark .markdown-content h4 {
    color: #f9fafb;
}

.markdown-content h1 {
    font-size: 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.dark .markdown-content h1 {
    border-bottom-color: #374151;
}

.markdown-content h2 {
    font-size: 1.25rem;
    font-family: 'Space Grotesk', sans-serif;
}

.markdown-content h3 {
    font-size: 1.125rem;
    font-family: 'Space Grotesk', sans-serif;
}

.markdown-content h4 {
    font-size: 1rem;
    font-family: 'Space Grotesk', sans-serif;
}

.markdown-content p {
    margin-bottom: 0.75rem;
    line-height: 1.75;
}

.markdown-content strong {
    font-weight: 700;
    color: #ea580c;
}

.dark .markdown-content strong {
    color: #fb923c;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content ul,
.markdown-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin-bottom: 0.25rem;
}

.markdown-content li::marker {
    color: #9ca3af;
}

.dark .markdown-content li::marker {
    color: #6b7280;
}

.markdown-content code {
    background-color: #fff7ed;
    color: #c2410c;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    border: 1px solid #fed7aa;
}

.dark .markdown-content code {
    background-color: #431407;
    color: #fdba74;
    border-color: #7c2d12;
}

.markdown-content pre {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.dark .markdown-content pre {
    background-color: #111827;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 4px solid #f97316;
    padding-left: 1rem;
    margin-bottom: 0.75rem;
    font-style: italic;
    color: #6b7280;
    background: linear-gradient(to right, rgba(249, 115, 22, 0.05), transparent);
    padding: 0.75rem 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.dark .markdown-content blockquote {
    color: #9ca3af;
    background: linear-gradient(to right, rgba(249, 115, 22, 0.1), transparent);
}

.markdown-content a {
    color: #ea580c;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.dark .markdown-content a {
    color: #fb923c;
}

.markdown-content a:hover {
    color: #f97316;
    border-bottom-color: #f97316;
}

.dark .markdown-content a:hover {
    color: #fdba74;
    border-bottom-color: #fdba74;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

.dark .markdown-content hr {
    border-top-color: #374151;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    text-align: left;
}

.dark .markdown-content th,
.dark .markdown-content td {
    border-color: #374151;
}

.markdown-content th {
    background-color: #f9fafb;
    font-weight: 700;
}

.dark .markdown-content th {
    background-color: #1f2937;
}

.markdown-content tr:nth-child(even) {
    background-color: #f9fafb;
}

.dark .markdown-content tr:nth-child(even) {
    background-color: #1f2937;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.dark ::-webkit-scrollbar-corner {
    background: transparent;
}

.chat-input::-webkit-scrollbar {
    width: 6px;
}

.chat-input::-webkit-scrollbar-button {
    display: none;
}

.chat-input::-webkit-scrollbar-track {
    background: transparent;
    border: none;
}

.chat-input::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    border: none;
}

.chat-input::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark .chat-input::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark .chat-input::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.chat-input {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.dark .chat-input {
    scrollbar-color: #4b5563 transparent;
}

.unit-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    color: #6b7280;
}

.dark .unit-btn {
    color: #9ca3af;
}

.unit-btn:hover {
    color: #374151;
}

.dark .unit-btn:hover {
    color: #e5e7eb;
}

.unit-btn.active {
    background: white;
    color: #ea580c;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dark .unit-btn.active {
    background: #374151;
    color: #fb923c;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

.chart-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pie-chart {
    animation: pieRotate 1s ease-out;
}

@keyframes pieRotate {
    from {
        transform: rotate(-90deg);
    }
    to {
        transform: rotate(0deg);
    }
}

.radar-chart {
    animation: radarPulse 1.5s ease-out;
}

@keyframes radarPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.legend-color {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.share-modal-enter {
    animation: shareModalEnter 0.3s ease-out;
}

@keyframes shareModalEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.share-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    color: white;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn-twitter {
    background-color: #1DA1F2;
}

.share-btn-twitter:hover {
    background-color: #1a8cd8;
}

.share-btn-facebook {
    background-color: #1877F2;
}

.share-btn-facebook:hover {
    background-color: #166fe5;
}

.share-btn-whatsapp {
    background-color: #25D366;
}

.share-btn-whatsapp:hover {
    background-color: #20bd5a;
}

.share-btn-email {
    background-color: #4b5563;
}

.share-btn-email:hover {
    background-color: #374151;
}

.share-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.share-action-btn:hover {
    transform: translateY(-1px);
}

.share-action-btn:active {
    transform: translateY(0);
}

.share-preview-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0.75rem;
    padding: 1rem;
}

.dark .share-preview-container {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.share-preview-img {
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#shareModal {
    opacity: 0;
    transition: opacity 0.2s ease;
}

#shareModal:not(.hidden) {
    opacity: 1;
    display: flex;
}

#shareModal > div {
    animation: shareModalEnter 0.3s ease-out;
}

.share-results-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}

.share-results-btn:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(249, 115, 22, 0.4);
}

.share-results-btn:active {
    transform: translateY(0);
}
