/* Modern Responsive Design Tokens & Light/Dark Theme Overrides */

/* Light Theme Global Styles & System Overrides */
html.light {
    color-scheme: light;
}

html.light body {
    background-color: #f8fafc !important;
    background-image: none !important;
    color: #0f172a !important;
}

html.light main {
    background-color: #f8fafc !important;
    background-image: none !important;
}

/* Light Mode Navigation Bar */
html.light nav {
    background-color: #ffffff !important;
    background-image: none !important;
    border-bottom: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

/* Light Mode Logo Heading ("7oz Répartition") - Fix White Text on White Background */
html.light nav h1,
html.light nav h1 *,
html.light h1.bg-clip-text {
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    color: #0f172a !important;
    text-shadow: none !important;
}

/* Light Mode Glass Panel & Glass Card Overrides */
html.light .glass-panel {
    background: #ffffff !important;
    background-image: none !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06) !important;
    color: #0f172a !important;
}

html.light .glass-card {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
    color: #0f172a !important;
}

/* Light Mode Containers & Modals */
html.light [class*="bg-slate"],
html.light .bg-slate-900,
html.light .bg-slate-950,
html.light .bg-slate-800,
html.light .bg-[#13161c],
html.light .bg-[#1a1c23] {
    --tw-bg-opacity: 1 !important;
    background-color: #f1f5f9 !important;
    background-image: none !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html.light div[class*="bg-slate-950"] {
    --tw-bg-opacity: 1 !important;
    background-color: #e2e8f0 !important;
    background-image: none !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html.light div[class*="bg-slate-900"] {
    --tw-bg-opacity: 1 !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* Light Mode Footer Override */
html.light footer {
    --tw-bg-opacity: 1 !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-top: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

/* Light Mode Text Legibility Fixes */
html.light h1, html.light h2, html.light h3, html.light h4, html.light h5, html.light h6 {
    color: #0f172a !important;
}

html.light .text-slate-100,
html.light .text-slate-200,
html.light .text-slate-300,
html.light .text-white {
    color: #0f172a !important;
}

html.light .text-slate-400,
html.light .text-slate-500,
html.light .text-slate-600 {
    color: #334155 !important;
}

html.light .text-cyan-300,
html.light .text-cyan-400 {
    color: #0369a1 !important;
}

html.light .text-amber-300,
html.light .text-amber-400 {
    color: #b45309 !important;
}

html.light .text-emerald-300,
html.light .text-emerald-400 {
    color: #047857 !important;
}

html.light .text-purple-300,
html.light .text-purple-400 {
    color: #6b21a8 !important;
}

html.light .text-blue-300,
html.light .text-blue-400 {
    color: #1d4ed8 !important;
}

html.light .text-rose-300,
html.light .text-rose-400 {
    color: #be123c !important;
}

/* Light Mode Badges & Container Statuses */
html.light .bg-blue-500\/20 { background-color: #dbeafe !important; border-color: #93c5fd !important; color: #1d4ed8 !important; }
html.light .bg-amber-500\/20 { background-color: #fef3c7 !important; border-color: #fcd34d !important; color: #b45309 !important; }
html.light .bg-purple-500\/20 { background-color: #f3e8ff !important; border-color: #d8b4fe !important; color: #6b21a8 !important; }
html.light .bg-emerald-500\/20, html.light .bg-emerald-500\/10 { background-color: #d1fae5 !important; border-color: #6ee7b7 !important; color: #047857 !important; }
html.light .bg-rose-500\/20 { background-color: #ffe4e6 !important; border-color: #fca5a5 !important; color: #be123c !important; }
html.light .bg-cyan-500\/10, html.light .bg-cyan-500\/20 { background-color: #e0f2fe !important; border-color: #7dd3fc !important; color: #0369a1 !important; }

/* Light Mode Inputs, Selects, Textareas & Options */
html.light input,
html.light select,
html.light textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html.light option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
    color: #64748b !important;
}

/* Light Mode Buttons & Navbar Controls */
html.light span.bg-slate-800,
html.light button.bg-slate-800,
html.light button.bg-slate-800\/80,
html.light a.bg-slate-800,
html.light button.bg-slate-950,
html.light a.bg-slate-950,
html.light select#lang-selector {
    background-color: #f1f5f9 !important;
    background-image: none !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html.light span.bg-slate-800 {
    background-color: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html.light span.bg-slate-800 * {
    color: #0f172a !important;
}

html.light span.bg-slate-800 .text-cyan-300,
html.light span.bg-slate-800 .text-cyan-400 {
    color: #0369a1 !important;
}

html.light #theme-icon {
    color: #d97706 !important;
}

/* Light Mode Technician Subnav Tabs */
html.light div.flex.bg-slate-950 {
    background-color: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

html.light div.flex.bg-slate-950 button:not(.bg-cyan-600) {
    color: #475569 !important;
}

/* Light Mode Table Styling */
html.light th {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

html.light td {
    border-bottom: 1px solid #f1f5f9 !important;
    color: #0f172a !important;
}

/* Light Mode Dispatcher Dashboard Overrides */
html.light div[class*="13161c"],
html.light .bg-\[\#13161c\] {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

html.light div[class*="1a1c23"],
html.light .bg-\[\#1a1c23\] {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

/* Dispatcher Dashboard Map in Light Mode */
html.light #leaflet-map {
    filter: none !important;
}

/* Dispatcher FullCalendar Theme in Light Mode */
html.light .custom-fc-theme .fc-col-header-cell,
html.light .custom-fc-theme .fc-datagrid-cell,
html.light .custom-fc-theme .fc-timeline-slot-frame {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

html.light .custom-fc-theme .fc-datagrid-cell-main,
html.light .resource-label-name,
html.light .fc-resource-title-text {
    color: #0f172a !important;
    font-weight: 700 !important;
}

html.dark .resource-label-name,
html.dark .fc-resource-title-text {
    color: #f8fafc !important;
}

html.light .custom-fc-theme .fc-resource-timeline-divider {
    background-color: #cbd5e1 !important;
}

html.light .custom-fc-theme .fc-theme-standard td,
html.light .custom-fc-theme .fc-theme-standard th {
    border-color: #e2e8f0 !important;
}

/* Light Mode FullCalendar */
html.light .fc {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

html.light .fc-toolbar-title {
    color: #0f172a !important;
}

html.light .fc-button-primary {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

html.light .fc-theme-standard td, 
html.light .fc-theme-standard th {
    border-color: #e2e8f0 !important;
}

html.light .fc-col-header-cell-cushion,
html.light .fc-daygrid-day-number {
    color: #1e293b !important;
}

/* Light Mode Buttons */
html.light .bg-indigo-600 {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
}

html.light .bg-slate-700,
html.light .bg-slate-700\/50 {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

/* Primary Action Buttons (Preserve vibrant gradients & white text) */
html.light button.bg-gradient-to-r,
html.light a.bg-gradient-to-r {
    color: #ffffff !important;
}

html.light button.bg-gradient-to-r *,
html.light a.bg-gradient-to-r * {
    color: #ffffff !important;
}

/* Leaflet Custom Map Pins & Marker Positioning Fixes */
.custom-leaflet-marker, .custom-pin, .custom-task-icon, .custom-div-icon {
    background: none !important;
    border: none !important;
    white-space: nowrap !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
}

.marker-anchor-center {
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    width: max-content;
    height: max-content;
}

.marker-anchor-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    width: max-content;
    height: max-content;
    margin-bottom: 4px;
}

.custom-pin-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 12px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    text-align: left !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
    border: 2px solid rgba(255, 255, 255, 0.95) !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
    transition: transform 0.2s ease;
    position: relative;
}

.custom-pin-badge:hover {
    transform: scale(1.08) translateY(-2px);
}

.custom-pin-badge::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: inherit;
    z-index: -1;
    border-right: 2px solid rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid rgba(255, 255, 255, 0.95);
}




/* 2026 HYPER-MODERN GANTT CHART (FullCalendar resourceTimelineDay overrides) */
.fc-theme-standard .fc-scrollgrid {
    border: none !important;
}
.fc-theme-standard td, .fc-theme-standard th {
    border-color: rgba(255, 255, 255, 0.04) !important;
}
.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 1.5rem !important;
}
.fc .fc-toolbar-title {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em;
    color: #f8fafc !important;
    text-transform: uppercase;
}
.fc .fc-button-primary {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    color: #94a3b8 !important;
    text-transform: capitalize !important;
    font-weight: 600 !important;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease !important;
    box-shadow: none !important;
}
.fc .fc-button-primary:hover {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #22d3ee !important;
    border-color: rgba(34, 211, 238, 0.5) !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: rgba(34, 211, 238, 0.1) !important;
    color: #22d3ee !important;
    border-color: #22d3ee !important;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2) !important;
}
.fc-datagrid-cell-main {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #cbd5e1 !important;
    padding: 12px !important;
}
/* Event Pills */
.fc-timeline-event {
    border-radius: 8px !important;
    border: none !important;
    border-left-style: solid !important;
    border-left-width: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    padding: 2px 6px !important;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
    transition: transform 0.2s ease, filter 0.2s ease !important;
}
.fc-timeline-event:hover {
    transform: scale(1.02) translateY(-1px);
    filter: brightness(1.2);
    z-index: 10 !important;
}
.fc-timeline-event .fc-event-main {
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.02em !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
/* Time Grid Header */
.fc-timeline-slot-cushion {
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    padding: 8px !important;
}
/* Current Time Indicator */
.fc-timeline-now-indicator-line {
    border-color: #22d3ee !important;
    border-width: 2px !important;
    box-shadow: 0 0 10px #22d3ee !important;
}
.fc-timeline-now-indicator-arrow {
    border-top-color: #22d3ee !important;
    border-bottom-color: #22d3ee !important;
}
/* Row Hover */
.fc-timeline-lane {
    transition: background 0.2s ease;
}
.fc-timeline-lane:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Reduce vertical spacing in Gantt rows */
.fc-timeline-event {
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    padding: 1px 4px !important;
}
.fc-datagrid-cell-main {
    padding: 4px 8px !important;
}

/* Flatpickr Calendar Z-Index Fix for Modals */
.flatpickr-calendar {
    z-index: 999999 !important;
}
