/* --- Filament Custom Theme (Anti-Plaisantins Premium Responsive Styling) --- */

/* Global Font Face */
body, html {
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif !important;
}

/* ==========================================================================
   1. DARK MODE STYLES (.dark class only)
   ========================================================================== */

.dark .fi-layout, .dark body, .dark html {
    background-color: #06080d !important;
    color: #f4f4f5 !important;
}

.dark .fi-main-ctn, .dark .fi-main {
    background-color: #06080d !important;
}

/* Sidebar Custom Styling (Dark) */
.dark .fi-sidebar {
    background-color: #0a0d14 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.dark .fi-sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.dark .fi-sidebar-item-button {
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
}

.dark .fi-sidebar-item-button.fi-active {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15)) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    color: #8b5cf6 !important;
}

/* Topbar Custom Styling (Dark) */
.dark .fi-topbar {
    background-color: rgba(10, 13, 20, 0.8) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* Cards, Sections and Tables Styling (Dark) */
.dark .fi-section, .dark .fi-ta, .dark .fi-fo, .dark .fi-card, .dark .fi-widget,
.dark .fi-section-header, .dark .fi-ta-ctn, .dark .fi-ta-content, .dark .fi-modal-window {
    background-color: #111726 !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    border-radius: 16px !important;
}

.dark .fi-ta-header, .dark .fi-ta-header-cell {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.dark .fi-ta-record {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

.dark .fi-ta-record:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Forms and Input Fields (Dark) */
.dark input, .dark select, .dark textarea, .dark .fi-fo-select, .dark .fi-fo-text-input {
    background-color: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f4f4f5 !important;
    border-radius: 8px !important;
}

.dark input:focus, .dark select:focus, .dark textarea:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2) !important;
}

/* FullCalendar (Dark) */
.dark #calendar {
    background-color: #111726 !important;
}

.dark .fc-theme-standard td, .dark .fc-theme-standard th {
    border-color: rgba(255, 255, 255, 0.06) !important;
}

.dark .fc-col-header-cell {
    background-color: rgba(255, 255, 255, 0.02) !important;
    color: #a1a1aa !important;
}

.dark .fc-daygrid-day:hover {
    background-color: rgba(255, 255, 255, 0.01) !important;
}

.dark .fc-day-today {
    background-color: rgba(99, 102, 241, 0.05) !important;
}

.dark .fc-button {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f4f4f5 !important;
}

.dark .fc-button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   2. LIGHT MODE STYLES (Only active when NOT in dark mode)
   ========================================================================== */

html:not(.dark) body, html:not(.dark) .fi-layout {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

html:not(.dark) .fi-main-ctn, html:not(.dark) .fi-main {
    background-color: #f8fafc !important;
}

/* Sidebar Custom Styling (Light) */
html:not(.dark) .fi-sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid rgba(15, 23, 42, 0.06) !important;
}

html:not(.dark) .fi-sidebar-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}

html:not(.dark) .fi-sidebar-item-button {
    border-radius: 12px !important;
}

html:not(.dark) .fi-sidebar-item-button.fi-active {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05)) !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
    color: #4f46e5 !important;
}

/* Topbar Custom Styling (Light) */
html:not(.dark) .fi-topbar {
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* Cards, Sections and Tables (Light) */
html:not(.dark) .fi-section, html:not(.dark) .fi-ta, html:not(.dark) .fi-fo, html:not(.dark) .fi-card, html:not(.dark) .fi-widget,
html:not(.dark) .fi-section-header, html:not(.dark) .fi-ta-ctn, html:not(.dark) .fi-ta-content, html:not(.dark) .fi-modal-window {
    background-color: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.06) !important;
    border-radius: 16px !important;
}

html:not(.dark) .fi-ta-header, html:not(.dark) .fi-ta-header-cell {
    background-color: rgba(15, 23, 42, 0.01) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}

html:not(.dark) .fi-ta-record {
    border-bottom: 1px solid rgba(15, 23, 42, 0.03) !important;
}

html:not(.dark) .fi-ta-record:hover {
    background-color: rgba(15, 23, 42, 0.01) !important;
}

/* Forms and Inputs (Light) */
html:not(.dark) input, html:not(.dark) select, html:not(.dark) textarea {
    background-color: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    color: #0f172a !important;
    border-radius: 8px !important;
}

html:not(.dark) input:focus, html:not(.dark) select:focus, html:not(.dark) textarea:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1) !important;
}

/* FullCalendar (Light) */
html:not(.dark) #calendar {
    background-color: #ffffff !important;
}

html:not(.dark) .fc-theme-standard td, html:not(.dark) .fc-theme-standard th {
    border-color: rgba(15, 23, 42, 0.06) !important;
}

html:not(.dark) .fc-col-header-cell {
    background-color: rgba(15, 23, 42, 0.01) !important;
    color: #64748b !important;
}

html:not(.dark) .fc-daygrid-day:hover {
    background-color: rgba(15, 23, 42, 0.01) !important;
}

html:not(.dark) .fc-day-today {
    background-color: rgba(99, 102, 241, 0.02) !important;
}

html:not(.dark) .fc-button {
    background-color: rgba(15, 23, 42, 0.02) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    color: #334155 !important;
}

html:not(.dark) .fc-button:hover {
    background-color: rgba(15, 23, 42, 0.05) !important;
}

/* ==========================================================================
   3. GLOBAL BUTTONS & CALENDAR HACKS
   ========================================================================== */

.fi-btn, button[type="submit"] {
    border-radius: 9999px !important;
    transition: all 0.2s ease !important;
}

.fi-btn-color-primary, .fi-btn-color-warning {
    background: linear-gradient(to right, #3b82f6, #8b5cf6) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2) !important;
}

.fi-btn-color-primary:hover, .fi-btn-color-warning:hover {
    transform: scale(1.03) !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35) !important;
}

#calendar {
    font-family: 'Outfit', sans-serif !important;
    padding: 1.5rem !important;
    border-radius: 16px !important;
}

.fc-event {
    border-radius: 6px !important;
    padding: 4px 8px !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.2s ease !important;
}

.fc-event:hover {
    transform: scale(1.02) !important;
    filter: brightness(1.1) !important;
}

.fc-button {
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-transform: capitalize !important;
    transition: all 0.2s ease !important;
}

.fc-button-active {
    background: linear-gradient(to right, #3b82f6, #8b5cf6) !important;
    border: none !important;
    color: white !important;
}

.fc-dom-external {
    display: none !important;
}
