@import "/static/css/variables.css";


.custom-scrollbar::-webkit-scrollbar { width: 4px; height: 8px; }
        .custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
        .custom-scrollbar::-webkit-scrollbar-thumb { background: #374151; border-radius: 10px; }
        .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #4b5563; }

        /* Flash animation for new narratives - SOFTER WHITE FLASH */
        @keyframes flashNew {
            0% { 
                background-color: transparent;
                transform: scale(1);
                box-shadow: none;
                border-color: transparent;
            }
            10% { 
                background-color: rgba(200, 220, 255, 0.5);
                transform: scale(1.05);
                box-shadow: 0 0 30px 8px rgba(200, 220, 255, 0.7), inset 0 0 20px rgba(200, 220, 255, 0.3);
                border-color: rgba(200, 220, 255, 0.8);
            }
            25% { 
                background-color: rgba(200, 220, 255, 0.4);
                transform: scale(1.04);
                box-shadow: 0 0 25px 6px rgba(200, 220, 255, 0.6), inset 0 0 15px rgba(200, 220, 255, 0.25);
                border-color: rgba(200, 220, 255, 0.7);
            }
            50% { 
                background-color: rgba(200, 220, 255, 0.25);
                transform: scale(1.02);
                box-shadow: 0 0 20px 4px rgba(200, 220, 255, 0.5), inset 0 0 12px rgba(200, 220, 255, 0.2);
                border-color: rgba(200, 220, 255, 0.5);
            }
            75% { 
                background-color: rgba(200, 220, 255, 0.15);
                transform: scale(1.01);
                box-shadow: 0 0 12px 2px rgba(200, 220, 255, 0.4), inset 0 0 8px rgba(200, 220, 255, 0.15);
                border-color: rgba(200, 220, 255, 0.4);
            }
            100% { 
                background-color: transparent;
                transform: scale(1);
                box-shadow: none;
                border-color: transparent;
            }
        }
        
        @keyframes flashAlert {
            0% { 
                background-color: transparent;
                transform: scale(1);
                box-shadow: none;
                border-color: transparent;
            }
            10% { 
                background-color: rgba(200, 220, 255, 0.6);
                transform: scale(1.06);
                box-shadow: 0 0 35px 10px rgba(200, 220, 255, 0.8), inset 0 0 25px rgba(200, 220, 255, 0.4);
                border-color: rgba(200, 220, 255, 0.9);
            }
            25% { 
                background-color: rgba(200, 220, 255, 0.45);
                transform: scale(1.05);
                box-shadow: 0 0 30px 8px rgba(200, 220, 255, 0.7), inset 0 0 20px rgba(200, 220, 255, 0.35);
                border-color: rgba(200, 220, 255, 0.8);
            }
            50% { 
                background-color: rgba(200, 220, 255, 0.3);
                transform: scale(1.03);
                box-shadow: 0 0 25px 6px rgba(200, 220, 255, 0.6), inset 0 0 15px rgba(200, 220, 255, 0.25);
                border-color: rgba(200, 220, 255, 0.6);
            }
            75% { 
                background-color: rgba(200, 220, 255, 0.18);
                transform: scale(1.01);
                box-shadow: 0 0 15px 3px rgba(200, 220, 255, 0.5), inset 0 0 10px rgba(200, 220, 255, 0.2);
                border-color: rgba(200, 220, 255, 0.5);
            }
            100% { 
                background-color: transparent;
                transform: scale(1);
                box-shadow: none;
                border-color: transparent;
            }
        }
        
        .narrative-item.flash-new {
            animation: flashNew 1s ease-in-out;
            border: 2px solid transparent;
        }
        
        .narrative-item[data-is-alert="true"].flash-new {
            animation: flashAlert 1s ease-in-out;
            border: 3px solid transparent;
        }

        /* Mobile Layout Adjustments */
        @media (max-width: 768px) {
            body.bg-gray-900 {
                padding-bottom: 80px !important;
            }
            
            .flex-1.overflow-hidden {
                flex-direction: column;
                overflow-y: auto;
            }
            
            /* Mobile Bottom Navigation Bar - HIGH SPECIFICITY */
            body nav.mobile-nav,
            body nav.w-64.bg-gray-800 {
                position: fixed !important;
                bottom: 0 !important;
                left: 0 !important;
                right: 0 !important;
                width: 100% !important;
                height: auto !important;
                border-r: 0 !important;
                border-top: 2px solid #374151 !important;
                border-bottom: none !important;
                background: #1F2937 !important;
                flex-direction: row !important;
                flex-wrap: nowrap !important;
                padding: 0.5rem !important;
                z-index: 9999 !important;
                box-shadow: 0 -4px 20px rgba(0,0,0,0.3) !important;
                margin: 0 !important;
            }
            
            /* Navigation items in bottom bar - HIGH SPECIFICITY */
            body nav.mobile-nav a,
            body nav.w-64 a {
                flex: 1 1 25% !important;
                display: flex !important;
                flex-direction: column !important;
                justify-content: center !important;
                align-items: center !important;
                margin: 0 !important;
                padding: 0.5rem !important;
                font-size: 0.65rem !important;
                gap: 0.25rem !important;
                min-width: 0 !important;
            }
            
            /* Icon sizing in mobile nav */
            body nav.mobile-nav a i,
            body nav.w-64 a i {
                font-size: 1.25rem !important;
                width: auto !important;
                margin: 0 !important;
            }
            
            /* Show text labels on mobile */
            body nav.mobile-nav a span,
            body nav.w-64 a span {
                display: block !important;
                font-size: 0.65rem !important;
                text-align: center !important;
            }
            
            /* Hide system health on mobile */
            body nav .mt-auto {
                display: none !important;
            }
            
            /* Logout in bottom bar */
            body nav .mt-4 {
                margin-top: 0 !important;
                padding-top: 0 !important;
                border-top: 0 !important;
                display: block !important;
            }
            
            /* Add bottom padding to main content to avoid overlap with bottom nav */
            main.p-8 {
                padding: 1rem;
                padding-bottom: 5rem !important;
            }
            header {
                padding: 0.75rem 1rem;
            }
            header img, .dashboard-logo {
                height: var(--logo-height-mobile, 24px) !important;
            }
            header h1 {
                font-size: 0.875rem;
            }
            .grid {
                gap: 1rem;
            }
            
            /* Dashboard: Stack camera columns vertically on mobile */
            .flex.gap-6.overflow-x-auto {
                flex-direction: column !important;
                overflow-x: visible !important;
                gap: 1.5rem !important;
            }
            
            /* Camera columns: Full width on mobile */
            .flex.gap-6.overflow-x-auto > div {
                width: 100% !important;
                min-width: 100% !important;
                max-width: 100% !important;
                height: auto !important;
                min-height: 500px !important;
            }
            
            /* Camera Inventory Mobile Table */
            .inventory-header {
                display: none;
            }
            .inventory-row {
                flex-direction: column;
                align-items: flex-start;
                padding: 1rem 0;
            }
            .inventory-row > div {
                width: 100% !important;
                text-align: left !important;
                padding: 0.25rem 0 !important;
            }
            .inventory-actions {
                opacity: 1 !important;
                justify-content: flex-start !important;
                margin-top: 0.5rem;
            }
        }
/* ========================================
   UNIFIED LOGO STYLING
   Uses CSS variables from variables.css
   ======================================== */
.dashboard-logo {
    height: var(--logo-height-desktop, 32px);
    border-radius: var(--logo-border-radius, 6px);
    box-shadow: var(--logo-shadow, 0 2px 6px rgba(0,0,0,0.4));
}

/* Markdown Styling for AI Response */
.markdown-content h1 { font-size: 1.5rem; font-weight: bold; margin-bottom: 0.5rem; color: white; }
.markdown-content h2 { font-size: 1.25rem; font-weight: bold; margin-bottom: 0.5rem; color: white; }
.markdown-content h3 { font-size: 1.1rem; font-weight: bold; margin-bottom: 0.5rem; color: white; }
.markdown-content p { margin-bottom: 0.75rem; }
.markdown-content ul { list-style-type: disc; margin-left: 1.5rem; margin-bottom: 0.75rem; }
.markdown-content ol { list-style-type: decimal; margin-left: 1.5rem; margin-bottom: 0.75rem; }
.markdown-content li { margin-bottom: 0.25rem; }
.markdown-content code { background: #1f2937; padding: 0.1rem 0.3rem; border-radius: 0.25rem; font-family: monospace; }
.markdown-content strong { color: white; font-weight: bold; }
.markdown-content blockquote { border-left: 4px solid #3b82f6; padding-left: 1rem; color: #9ca3af; font-style: italic; margin-bottom: 0.75rem; }

