/* ===== SIMPEG-SP MAIN SYSTEM CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html, input, button, select, textarea {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #f8fafc;
    color: #1e293b;
}

/* Sidebar scrollbar styling */
.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}
.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Mobile Sidebar Overlay */
#sidebarOverlay {
    display: none;
}
#sidebarOverlay.active {
    display: block;
}

/* ===== SUBMENU SLIDE-DOWN ANIMATION ===== */
.sidebar-accordion-submenu,
#settingSubmenuList,
#settingSubmenu {
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease-in-out, padding 0.3s ease-in-out;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
}

.sidebar-accordion-submenu.accordion-expanded,
#settingSubmenuList.open-submenu,
#settingSubmenu.accordion-expanded {
    max-height: 250px !important;
    opacity: 1 !important;
}

/* ===== MOBILE SIDEBAR OVERLAY & BLUR (Z-INDEX 9998 & 9999) ===== */
@media (max-width: 767px) {
    #sidebarOverlay {
        display: none;
    }
    #sidebarOverlay.active {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background-color: rgba(15, 23, 42, 0.75) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        z-index: 9998 !important;
    }
    #sidebar {
        z-index: 9999 !important;
    }
}

/* ===== HOPE UI MINI SIDEBAR STYLES ===== */
@media (min-width: 768px) {
    #sidebar {
        transition: width 0.3s ease-in-out;
    }

    #sidebar.mini-sidebar {
        width: 80px !important;
    }

    #sidebar.mini-sidebar ~ #mainContent {
        margin-left: 80px !important;
    }

    #sidebar.mini-sidebar .sidebar-text {
        display: none !important;
    }

    #sidebar.mini-sidebar .brand-container,
    #sidebar.mini-sidebar nav a,
    #sidebar.mini-sidebar nav button,
    #sidebar.mini-sidebar .user-footer-container {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #sidebar.mini-sidebar .sidebar-accordion-submenu {
        display: none !important;
    }
}

@media (max-width: 767px) {
    #mainContent {
        margin-left: 0 !important;
    }
}

/* ================= SYSTEM DYNAMIC THEMES (EXCLUDING LOGIN) ================= */

/* EMERALD EDUCATION THEME OVERRIDES */
html[data-theme="emerald"] .bg-gradient-to-r.from-blue-950.via-blue-900.to-indigo-950 {
    background: linear-gradient(to right, #022c22, #064e3b, #134e4a) !important;
}
html[data-theme="emerald"] .bg-blue-800 {
    background-color: #047857 !important;
}
html[data-theme="emerald"] .hover\:bg-blue-900:hover {
    background-color: #065f46 !important;
}
html[data-theme="emerald"] .text-blue-800 {
    color: #047857 !important;
}
html[data-theme="emerald"] .bg-blue-100 {
    background-color: #d1fae5 !important;
}
html[data-theme="emerald"] .border-blue-800 {
    border-color: #047857 !important;
}

/* ROYAL PURPLE THEME OVERRIDES */
html[data-theme="purple"] .bg-gradient-to-r.from-blue-950.via-blue-900.to-indigo-950 {
    background: linear-gradient(to right, #2e1065, #4c1d95, #312e81) !important;
}
html[data-theme="purple"] .bg-blue-800 {
    background-color: #6b21a8 !important;
}
html[data-theme="purple"] .hover\:bg-blue-900:hover {
    background-color: #581c87 !important;
}
html[data-theme="purple"] .text-blue-800 {
    color: #6b21a8 !important;
}
html[data-theme="purple"] .bg-blue-100 {
    background-color: #f3e8ff !important;
}
html[data-theme="purple"] .border-blue-800 {
    border-color: #6b21a8 !important;
}

/* ================= DARK MODE (MIDNIGHT SLATE) OVERRIDES ================= */
html[data-theme="dark"] body,
html[data-theme="dark"] main#mainContent {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] header,
html[data-theme="dark"] aside,
html[data-theme="dark"] .bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-700 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400 {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-gray-100,
html[data-theme="dark"] .bg-gray-50\/50,
html[data-theme="dark"] .bg-gray-50\/80,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-200\/80 {
    border-color: #334155 !important;
}

html[data-theme="dark"] .bg-gradient-to-r.from-blue-950.via-blue-900.to-indigo-950 {
    background: linear-gradient(to right, #020617, #0f172a, #1e293b) !important;
}

html[data-theme="dark"] .bg-blue-800 {
    background-color: #2563eb !important;
}

html[data-theme="dark"] .hover\:bg-blue-900:hover {
    background-color: #1d4ed8 !important;
}

html[data-theme="dark"] .text-blue-800 {
    color: #60a5fa !important;
}

html[data-theme="dark"] .bg-blue-100 {
    background-color: #1e3a8a !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] thead {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: #334155 !important;
}

/* Remove Card & Panel Shadows in Dark Mode */
html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow-md,
html[data-theme="dark"] .shadow-lg,
html[data-theme="dark"] .shadow-xl,
html[data-theme="dark"] .shadow-2xl,
html[data-theme="dark"] [class*="shadow-"] {
    box-shadow: none !important;
}
