/* Custom CSS for King BI Training Management System Dashboard */

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

body {
    font-family: 'Cairo', 'Outfit', sans-serif;
    background-color: #0b0f19;
    color: #f1f5f9;
    transition: background-color 0.25s ease, color 0.25s ease;
}

aside#sidebar, header, .glass-panel, .modal-content {
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

/* Custom Scrollbars - Dark Theme (Default) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a855f7;
}

/* Glassmorphism Styles */
.glass-panel {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-panel-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel-hover:hover {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 10px 25px -5px rgba(168, 85, 247, 0.1), 0 8px 10px -6px rgba(168, 85, 247, 0.1);
    transform: translateY(-2px);
}

/* Glowing Neon Effects */
.glow-purple {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.glow-blue {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.glow-emerald {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}

/* Tab/Row transitions */
.student-row {
    transition: all 0.2s ease;
}

.student-row:hover {
    background-color: rgba(30, 41, 59, 0.5) !important;
}

/* Custom Checkbox/Input styling for dark-mode */
input[type="text"], input[type="tel"], input[type="date"], input[type="number"], input[type="email"], input[type="password"], select, textarea {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: rgba(51, 65, 85, 1);
    color: #f8fafc;
    transition: all 0.2s ease;
}

input[type="text"]:focus, input[type="tel"]:focus, input[type="date"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus, textarea:focus {
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2) !important;
    outline: none !important;
}

/* Gradient text */
.text-gradient-purple-blue {
    background: linear-gradient(135deg, #c084fc 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===================================================
   LIGHT MODE THEME (الوضع النهاري الفاتح)
   =================================================== */
html.light {
    color-scheme: light;
    background-color: #f8fafc !important;
}

html.light body {
    background-color: #f8fafc !important;
    color: #1e293b !important;
}

/* Main Sidebar Light Mode */
html.light aside#sidebar {
    background-color: #ffffff !important;
    border-left-color: #e2e8f0 !important;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.03) !important;
}

html.light aside#sidebar .border-b,
html.light aside#sidebar .border-t {
    border-color: #f1f5f9 !important;
}

html.light aside#sidebar nav a {
    color: #475569;
}

html.light aside#sidebar nav a:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Header Light Mode */
html.light header {
    background-color: rgba(255, 255, 255, 0.88) !important;
    border-bottom-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    backdrop-filter: blur(12px) !important;
}

/* Glass Panels & Cards Light Mode */
html.light .glass-panel {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

html.light .glass-panel-hover:hover {
    background: #ffffff !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
    box-shadow: 0 10px 25px -5px rgba(168, 85, 247, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Modals Light Mode */
html.light .modal-container {
    background-color: rgba(15, 23, 42, 0.5) !important;
}

html.light .modal-content {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}

/* Primary Text Overrides in Light Mode */
html.light .text-white,
html.light .text-slate-100,
html.light .text-slate-200 {
    color: #0f172a !important;
}

html.light .text-slate-300,
html.light .text-slate-400 {
    color: #475569 !important;
}

html.light .text-slate-500 {
    color: #64748b !important;
}

/* Surface & Background Overrides in Light Mode */
html.light .bg-\[\#0b0f19\],
html.light .bg-\[\#0b0f19\]\/80,
html.light .bg-\[\#0d1321\],
html.light .bg-\[\#0d1321\]\/95,
html.light .bg-\[\#0d1321\]\/80,
html.light .bg-\[\#0d1321\]\/30,
html.light .bg-\[\#0f172a\],
html.light .bg-slate-950,
html.light .bg-slate-900,
html.light .bg-slate-900\/80,
html.light .bg-slate-900\/60,
html.light .bg-slate-900\/40,
html.light .bg-slate-900\/30 {
    background-color: #ffffff !important;
}

html.light .bg-slate-800,
html.light .bg-slate-800\/60,
html.light .bg-slate-800\/50,
html.light .bg-slate-800\/40,
html.light .bg-slate-800\/30,
html.light .bg-slate-800\/20 {
    background-color: #f1f5f9 !important;
}

html.light .hover\:bg-slate-800\/30:hover,
html.light .hover\:bg-slate-800\/50:hover,
html.light .hover\:bg-slate-800:hover,
html.light .hover\:bg-slate-700:hover,
html.light .hover\:bg-slate-700\/50:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Border Overrides in Light Mode */
html.light .border-slate-800,
html.light .border-slate-800\/80,
html.light .border-slate-800\/60,
html.light .border-slate-800\/50,
html.light .border-slate-800\/40,
html.light .border-slate-700,
html.light .border-slate-700\/60,
html.light .border-slate-700\/50,
html.light .border-slate-600 {
    border-color: #e2e8f0 !important;
}

html.light .divide-slate-800 > :not([hidden]) ~ :not([hidden]),
html.light .divide-slate-800\/60 > :not([hidden]) ~ :not([hidden]),
html.light .divide-slate-700 > :not([hidden]) ~ :not([hidden]) {
    border-color: #e2e8f0 !important;
}

/* Form Controls in Light Mode */
html.light input[type="text"],
html.light input[type="tel"],
html.light input[type="date"],
html.light input[type="number"],
html.light input[type="email"],
html.light input[type="password"],
html.light select,
html.light textarea {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
    color: #94a3b8 !important;
}

html.light input:focus,
html.light select:focus,
html.light textarea:focus {
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2) !important;
}

/* Tables in Light Mode */
html.light table thead tr {
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

html.light table thead th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

html.light tbody tr.student-row:hover,
html.light tbody tr:hover {
    background-color: #f8fafc !important;
}

html.light tbody td {
    border-color: #f1f5f9 !important;
}

/* Light Mode Scrollbars */
html.light ::-webkit-scrollbar-track {
    background: #f1f5f9;
}
html.light ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}
html.light ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Theme Toggle Button Styling */
.theme-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn .theme-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn:hover .theme-icon {
    transform: rotate(20deg) scale(1.1);
}

/* Print Styles */
@media print {
    aside, header, .glass-panel > div:first-child button, [data-modal-target],
    #search-students, #filter-cohort, #filter-status, #filter-discount,
    button, a[href]:not([href^="uploads"]) { display: none !important; }

    body { background: #fff !important; color: #000 !important; font-family: sans-serif; }
    main { display: block !important; }
    .glass-panel { background: #fff !important; border: 1px solid #ddd !important; backdrop-filter: none !important; }
    table { width: 100%; border-collapse: collapse; font-size: 11px; }
    th, td { border: 1px solid #ccc; padding: 6px 8px; color: #000 !important; text-align: left; }
    th { background: #f0f0f0 !important; }
    .student-row:hover { background: none !important; }

    /* Print header */
    main::before {
        content: "King BI — Répertoire des Étudiants — " attr(data-date);
        display: block;
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 12px;
    }
}

/* Mobile responsive utilities (xs breakpoint) */
@media (max-width: 480px) {
    .xs\:hidden {
        display: none !important;
    }
    .xs\:inline {
        display: inline !important;
    }
    .xs\:block {
        display: block !important;
    }
}
