/* styles.css - Executive Education Analytics Dashboard Sở GD&ĐT Thái Nguyên */
:root {
    --brand-primary: #059669;    /* Emerald Green */
    --brand-secondary: #1e3a8a;  /* Navy Blue */
    --brand-accent: #0284c7;     /* Sky Blue */
    --brand-warning: #f59e0b;    /* Amber */
    --brand-danger: #ef4444;     /* Red */
    --brand-success: #10b981;    /* Green */
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

body {
    transition: background-color 0.3s, color 0.3s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

.card {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Insight Cards */
.insight-red {
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.insight-green {
    border-left: 4px solid #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.insight-yellow {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.insight-blue {
    border-left: 4px solid #0284c7;
    background: rgba(2, 132, 199, 0.05);
}

.insight-purple {
    border-left: 4px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.dark .insight-red { background: rgba(239, 68, 68, 0.12); }
.dark .insight-green { background: rgba(16, 185, 129, 0.12); }
.dark .insight-yellow { background: rgba(245, 158, 11, 0.12); }
.dark .insight-blue { background: rgba(2, 132, 199, 0.12); }
.dark .insight-purple { background: rgba(139, 92, 246, 0.12); }

/* Early Warning System (EWS) Badges & Alerts */
.ews-critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.03) 100%);
    border-left: 4px solid #ef4444;
}
.dark .ews-critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.ews-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.03) 100%);
    border-left: 4px solid #f59e0b;
}
.dark .ews-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.ews-pulse-red {
    animation: pulse-red 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.35s ease-out forwards;
}

/* Clickable Interactive Cards */
.cursor-pointer.card:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 10px 18px -3px rgba(5, 150, 105, 0.15);
}

#sidebar-nav::-webkit-scrollbar {
    display: none;
}

/* Drag and drop BI builder styling */
.dropzone {
    min-height: 52px;
    transition: all 0.2s ease;
}

.dropzone.dragover {
    border-color: #059669;
    background-color: rgba(5, 150, 105, 0.08);
}

/* Responsive & Drawer for Mobile/Tablet */
@media (max-width: 1024px) {
    #sidebar.w-16 { 
        position: fixed;
        transform: translateX(-100%);
        z-index: 100;
        height: 100%;
    }
    #sidebar.w-64 {
        position: fixed;
        transform: translateX(0);
        z-index: 100;
        height: 100%;
        width: 280px;
        box-shadow: 20px 0 25px -5px rgba(0, 0, 0, 0.15);
    }
    #sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
        backdrop-filter: blur(2px);
    }
    #sidebar.w-64 ~ #sidebar-backdrop {
        display: block;
    }
    main {
        width: 100vw !important;
        flex: none;
    }
}

@media (max-width: 640px) {
    #dashboard-title { font-size: 0.95rem; }
    #dashboard-subtitle { display: none; }
    .p-6 { padding: 0.85rem 0.65rem; }
    .chart-container { height: 260px; }
    #kpi-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
    #ai-insights { grid-template-columns: 1fr; }
    header { padding-left: 0.5rem; padding-right: 0.5rem; }
    #global-year, #global-level, #global-commune { 
        max-width: 85px; 
        font-size: 11px;
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }
}

/* ========================================================= */
/* A4 LANDSCAPE PRINT STYLESHEET (EDUCATIONAL PASSPORT 360°) */
/* ========================================================= */
@media print {
    @page {
        size: A4 landscape;
        margin: 10mm 12mm 10mm 12mm;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
    }

    #sidebar, header, footer, #btn-pwa-install, #btn-export, #btn-reset, #btn-theme,
    #filter-summary, #sidebar-backdrop, .no-print {
        display: none !important;
    }

    main {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #main-scroll {
        overflow: visible !important;
        padding: 0 !important;
    }

    .card {
        border: 1px solid #e2e8f0 !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Fixed Repeat Header on Every Printed Page */
    .print-header-fixed {
        display: block !important;
        position: running(header);
        border-bottom: 2px solid #059669;
        padding-bottom: 8px;
        margin-bottom: 15px;
    }
}
