/* --- Base & Global Styles --- */
/* Tailwind handles most layout, but specific overrides and custom effects here */

body {
    background-color: #0B0F19; /* brand-dark */
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #F3F4F6;
    overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

/* --- Animated Grid Background --- */
.bg-grid {
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, transparent, 10%, black, 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, 5%, black, 90%, transparent);
}

/* --- Glassmorphism Utilities --- */
.glass-card {
    background: rgba(21, 27, 43, 0.7); /* brand-panel with opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-btn {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}
.glass-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Text Effects --- */
.text-glow {
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

/* --- Navigation & Tabs --- */
.nav-link {
    color: #9CA3AF; /* gray-400 */
    transition: all 0.2s;
    font-weight: 500;
}
.nav-link:hover {
    color: #F3F4F6;
}
.nav-link.active {
    background-color: rgba(56, 189, 248, 0.1); /* brand-accent low opacity */
    color: #38BDF8; /* brand-accent */
    font-weight: 600;
}

/* Filter Tabs */
.filter-tab {
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9CA3AF;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}
.filter-tab:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}
.filter-tab.active {
    background-color: #38BDF8; /* brand-accent */
    color: #0B0F19; /* brand-dark */
    border-color: #38BDF8;
}

/* --- Topic Pills (Dark Mode Adaptive) --- */
.topic-pill { display: inline-block; padding: 2px 10px; border-radius: 9999px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.topic-tourism { background-color: rgba(249, 115, 22, 0.2); color: #FB923C; border: 1px solid rgba(249, 115, 22, 0.3); }
.topic-education { background-color: rgba(16, 185, 129, 0.2); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.3); }
.topic-mining { background-color: rgba(107, 114, 128, 0.2); color: #D1D5DB; border: 1px solid rgba(107, 114, 128, 0.3); }
.topic-crime { background-color: rgba(239, 68, 68, 0.2); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.topic-police { background-color: rgba(59, 130, 246, 0.2); color: #60A5FA; border: 1px solid rgba(59, 130, 246, 0.3); }
.topic-health { background-color: rgba(236, 72, 153, 0.2); color: #F472B6; border: 1px solid rgba(236, 72, 153, 0.3); }
.topic-environment { background-color: rgba(234, 179, 8, 0.2); color: #FACC15; border: 1px solid rgba(234, 179, 8, 0.3); }

/* --- Scrollbar for Horizontal Lists --- */
.horizontal-scroll-container { 
    display: flex; 
    overflow-x: auto; 
    padding: 4px; 
    gap: 16px; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}
.horizontal-scroll-container::-webkit-scrollbar { display: none; }

/* --- Table Styles --- */
table th, table td {
    border-color: rgba(255, 255, 255, 0.05);
}
/* Scrollbar specific for the matrix if it overflows */
.overflow-x-auto::-webkit-scrollbar {
    height: 4px;
}
.overflow-x-auto::-webkit-scrollbar-track {
    background: #0B0F19;
}
.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 2px;
}

/* --- Dropdowns --- */
.dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: #D1D5DB;
    transition: background-color 0.2s;
}
.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* =========================================
   ANIMATIONS & VISUAL EFFECTS
   ========================================= */

/* 1. Standard Content Fade In */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    will-change: opacity, transform;
}

/* 2. Ticker Animation (Continuous Scroll) */
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Move half width */
}
.animate-ticker {
    display: flex;
    width: max-content;
    animation: ticker 40s linear infinite;
    will-change: transform;
}
.pause-hover:hover {
    animation-play-state: paused;
}

/* 3. Slow Pulse (Used for Alerts/Badges) */
@keyframes softPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.animate-pulse-slow {
    animation: softPulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 4. Network Graph: Flowing Lines */
/* Animates the stroke-dasharray of SVG paths to simulate data flow */
@keyframes dashFlow {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}
.animate-dash {
    animation: dashFlow 2s linear infinite;
}

/* 5. Bar Chart Growth (Divergence Meters) */
@keyframes growWidth {
    from { width: 0; }
    to { width: var(--target-width); }
}
.animate-grow {
    animation: growWidth 1s ease-out forwards;
}

/* --- Utility Overrides --- */
/* Ensure SVG sparklines don't get clipped */
.overflow-visible {
    overflow: visible;
}