@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #FAFAF9;
    color: #44403C;
    overflow-x: hidden;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    max-height: 500px;
}

.nav-item.active {
    background-color: #E7E5E4;
    color: #1C1917;
    font-weight: 700;
    border-right: 4px solid #D97706;
}

.card {
    background-color: white;
    border-radius: 1.25rem;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05);
    border: 1px solid #E7E5E4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tab-content {
    display: none;
    animation: slideUp 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

.btn-pro {
    background-color: #1C1917;
    color: white;
    transition: all 0.2s;
}

.btn-pro:hover {
    background-color: #44403C;
    transform: scale(1.01);
}

.custom-scroll::-webkit-scrollbar {
    width: 5px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: #F5F5F4;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #D6D3D1;
    border-radius: 10px;
}

.anomaly-pulse {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Loader for Image Gen */
.loader {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #D97706;
    width: 24px;
    height: 24px;
    -webkit-animation: spin 1s linear infinite;
    /* Safari */
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Chat Widget Animations */
#chat-widget {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    transform-origin: bottom right;
}

#chat-widget.closed {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
}

#chat-messages::-webkit-scrollbar {
    width: 4px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #E7E5E4;
    border-radius: 4px;
}

/* Utility for AI Content Formatting */
.ai-content blockquote {
    border-left: 4px solid #D97706;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    background: #fffbeb;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.ai-content b {
    color: #1c1917;
    font-weight: 800;
}

/* Source Bubbles for Search Grounding */
.source-chip {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 2px 8px;
    margin-right: 4px;
    margin-top: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.source-chip:hover {
    background: #dbeafe;
}

tbody tr:focus,
tbody tr:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Phase 5: UI/UX Polish */
.glass-card-light {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-radius: 1.25rem;
    transition: all 0.3s ease;
}

.glass-card-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.85);
}

.glass-card-dark {
    background: rgba(15, 15, 17, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    color: white;
    transition: all 0.3s ease;
}

.glass-card-dark:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    background: rgba(15, 15, 17, 0.8);
    border-color: rgba(168, 85, 247, 0.3);
    /* Purple hint on hover */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    /* Star hidden */
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}