/**
 * League Manager - Preline Design System Theme Engine
 * Automatic System-Preferred Detection (prefers-color-scheme)
 * Seamless Light/Dark Mode Switching with Zero-FOUC
 */

/* Theme Toggle Sun & Moon Icons */
.theme-icon-sun {
    display: none;
}
.theme-icon-moon {
    display: inline-block;
}
html.dark .theme-icon-sun {
    display: inline-block;
}
html.dark .theme-icon-moon {
    display: none;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
html.dark ::-webkit-scrollbar-track {
    background: #020617;
}
html.dark ::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

html:not(.dark) ::-webkit-scrollbar-track {
    background: #f1f5f9;
}
html:not(.dark) ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
html:not(.dark) ::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

/* Vanilla Calendar Pro (Preline Datepicker Engine) Theme Rules */
html.dark .vc {
    --vc-bg: #0f172a !important;
    --vc-color: #f8fafc !important;
    --vc-border-color: #334155 !important;
    --vc-btn-primary-bg: #f59e0b !important;
    --vc-btn-primary-color: #020617 !important;
    border-radius: 1rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
    border: 1px solid #334155 !important;
    font-family: 'Inter', sans-serif !important;
    z-index: 99999 !important;
}

html:not(.dark) .vc {
    --vc-bg: #ffffff !important;
    --vc-color: #0f172a !important;
    --vc-border-color: #e2e8f0 !important;
    --vc-btn-primary-bg: #f59e0b !important;
    --vc-btn-primary-color: #020617 !important;
    border-radius: 1rem !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
    font-family: 'Inter', sans-serif !important;
    z-index: 99999 !important;
}

/* ==========================================================================
   LIGHT MODE PALETTE & DESIGN SYSTEM (Preline Neutral Clean)
   Active whenever html does not have the .dark class
   ========================================================================== */
html:not(.dark) {
    color-scheme: light;
}

html:not(.dark) body {
    background-color: #f8fafc !important; /* slate-50 */
    color: #0f172a !important; /* slate-900 */
}

/* Preline Global Sticky Header */
html:not(.dark) header {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-bottom-color: #e2e8f0 !important;
}

/* Mobile Drawer */
html:not(.dark) #mobileNavMenu {
    background-color: rgba(255, 255, 255, 0.98) !important;
    border-color: #e2e8f0 !important;
}

/* Surface backgrounds */
html:not(.dark) .bg-slate-950 {
    background-color: #f8fafc !important;
}
html:not(.dark) .bg-slate-950\/80,
html:not(.dark) .bg-slate-950\/85,
html:not(.dark) .bg-slate-950\/90,
html:not(.dark) .bg-slate-950\/95 {
    background-color: rgba(255, 255, 255, 0.92) !important;
}

html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-900\/80,
html:not(.dark) .bg-slate-900\/90,
html:not(.dark) .bg-slate-900\/95 {
    background-color: #ffffff !important;
}

html:not(.dark) .bg-slate-850,
html:not(.dark) .bg-slate-800,
html:not(.dark) .bg-slate-800\/80,
html:not(.dark) .bg-slate-800\/50 {
    background-color: #f1f5f9 !important;
}

/* Hover surfaces */
html:not(.dark) .hover\:bg-slate-800:hover,
html:not(.dark) .hover\:bg-slate-850:hover {
    background-color: #f1f5f9 !important;
}
html:not(.dark) .hover\:bg-slate-700:hover {
    background-color: #e2e8f0 !important;
}

/* Borders and dividers */
html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-800\/80,
html:not(.dark) .border-slate-800\/50,
html:not(.dark) .border-slate-800\/60,
html:not(.dark) .divide-slate-800 > * + * {
    border-color: #e2e8f0 !important;
}
html:not(.dark) .border-slate-700 {
    border-color: #cbd5e1 !important;
}

/* Typography contrast */
html:not(.dark) .text-white {
    color: #0f172a !important;
}
html:not(.dark) .text-slate-100 {
    color: #1e293b !important;
}
html:not(.dark) .text-slate-200 {
    color: #334155 !important;
}
html:not(.dark) .text-slate-300 {
    color: #475569 !important;
}
html:not(.dark) .text-slate-400 {
    color: #64748b !important;
}
html:not(.dark) .text-slate-500 {
    color: #94a3b8 !important;
}
html:not(.dark) .hover\:text-white:hover {
    color: #0f172a !important;
}

/* Form inputs & controls */
html:not(.dark) input:not([type="checkbox"]):not([type="radio"]),
html:not(.dark) select,
html:not(.dark) textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
    color: #94a3b8 !important;
}

/* Amber highlights tuned for light mode contrast */
html:not(.dark) .text-amber-400 {
    color: #d97706 !important; /* amber-600 */
}
html:not(.dark) .hover\:text-amber-400:hover {
    color: #b45309 !important; /* amber-700 */
}
html:not(.dark) .group-hover\:text-amber-400 {
    color: #d97706 !important;
}
html:not(.dark) .bg-amber-500\/10,
html:not(.dark) .bg-amber-500\/15,
html:not(.dark) .bg-amber-500\/20 {
    background-color: #fef3c7 !important; /* amber-100 */
}
html:not(.dark) .border-amber-500\/20,
html:not(.dark) .border-amber-500\/30,
html:not(.dark) .border-amber-500\/40 {
    border-color: #fcd34d !important; /* amber-300 */
}

/* Retain high-contrast dark text on bright amber buttons & chips */
html:not(.dark) .bg-amber-500.text-slate-950,
html:not(.dark) .bg-amber-400.text-slate-950 {
    color: #020617 !important;
}

/* Status Badge Accents (Emerald, Rose, Sky) */
html:not(.dark) .text-emerald-400 {
    color: #059669 !important;
}
html:not(.dark) .bg-emerald-500\/10,
html:not(.dark) .bg-emerald-500\/15 {
    background-color: #d1fae5 !important;
}
html:not(.dark) .border-emerald-500\/30 {
    border-color: #6ee7b7 !important;
}

html:not(.dark) .text-rose-400 {
    color: #e11d48 !important;
}
html:not(.dark) .bg-rose-500\/10,
html:not(.dark) .bg-rose-500\/15 {
    background-color: #ffe4e6 !important;
}
html:not(.dark) .border-rose-500\/30 {
    border-color: #fda4af !important;
}

html:not(.dark) .text-sky-400 {
    color: #0284c7 !important;
}
html:not(.dark) .bg-sky-500\/10,
html:not(.dark) .bg-sky-500\/15 {
    background-color: #e0f2fe !important;
}
html:not(.dark) .border-sky-500\/30 {
    border-color: #7dd3fc !important;
}

/* Modals and Dropdowns */
html:not(.dark) .modal-backdrop {
    background-color: rgba(15, 23, 42, 0.45) !important;
}
html:not(.dark) .nav-dropdown-menu,
html:not(.dark) .shadow-2xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}
html:not(.dark) .shadow-xl {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.03) !important;
}
html:not(.dark) .shadow-lg {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03) !important;
}
html:not(.dark) .shadow-sm,
html:not(.dark) .shadow-xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Calendar Scrubber & Event Elements */
html:not(.dark) .border-l-amber-500 {
    border-left-color: #f59e0b !important;
}

/* Fixture Agenda rows & Day Gutters in Light Mode */
html:not(.dark) .divide-slate-800\/80 > * + *,
html:not(.dark) .divide-slate-800\/60 > * + * {
    border-color: #e2e8f0 !important;
}
html:not(.dark) .border-slate-800\/80,
html:not(.dark) .border-slate-800\/60 {
    border-color: #e2e8f0 !important;
}
html:not(.dark) .hover\:bg-slate-800\/40:hover,
html:not(.dark) .hover\:bg-slate-800\/30:hover,
html:not(.dark) .hover\:bg-slate-800\/20:hover {
    background-color: #f8fafc !important;
}
