:root {
    color-scheme: light;
    --dreba-bg: #f8fafc;
    --dreba-surface: #ffffff;
    --dreba-panel: #f1f5f9;
    --dreba-card: #ffffff;
    --dreba-text: #0f172a;
    --dreba-muted: #475569;
    --dreba-border: rgba(15, 23, 42, 0.12);
    --dreba-overlay: rgba(15, 23, 42, 0.75);
    --dreba-body-gradient: radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.15), transparent 45%), radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.12), transparent 40%), linear-gradient(180deg, #f8fafc 0%, #f0fdf4 100%);
    --dreba-card-glow: rgba(15, 118, 110, 0.2);
    --dreba-scrollbar-track: rgba(15, 23, 42, 0.08);
    --dreba-scrollbar-thumb: rgba(16, 185, 129, 0.65);
    --dreba-input-bg: #ffffff;
    --dreba-text-on-light: #0f172a;
    --dreba-text-on-dark: #f8fafc;
    --dreba-muted-on-dark: rgba(248, 250, 252, 0.75);
    --dreba-card-border-light: rgba(15, 23, 42, 0.08);
    --dreba-card-shadow: 0 25px 45px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

[data-theme="dark"] {
    color-scheme: dark;
    --dreba-bg: #020617;
    --dreba-surface: #0f172a;
    --dreba-panel: #0a1628;
    --dreba-card: #ffffff;
    --dreba-text: #e2e8f0;
    --dreba-muted: #94a3b8;
    --dreba-border: rgba(148, 163, 184, 0.35);
    --dreba-overlay: rgba(2, 6, 23, 0.88);
    --dreba-body-gradient: radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.2), transparent 45%), radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.18), transparent 40%), linear-gradient(180deg, #020617 0%, #020617 100%);
    --dreba-card-glow: rgba(16, 185, 129, 0.35);
    --dreba-scrollbar-track: rgba(15, 23, 42, 0.65);
    --dreba-scrollbar-thumb: rgba(45, 212, 191, 0.8);
    --dreba-input-bg: rgba(8, 23, 45, 0.85);
}

html,
body {
    min-height: 100%;
    width: 100%;
}

img,
video,
canvas,
iframe,
picture,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    background-color: var(--dreba-bg);
    color: var(--dreba-text);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    word-break: break-word;
}

[data-theme="dark"] body {
    background-color: var(--dreba-bg);
    background-image: var(--dreba-body-gradient);
    background-attachment: fixed;
    scrollbar-color: var(--dreba-scrollbar-thumb) var(--dreba-scrollbar-track);
}

::selection {
    background: rgba(16, 185, 129, 0.35);
    color: #ffffff;
}

[data-theme="dark"] ::selection {
    background: rgba(45, 212, 191, 0.5);
    color: #020617;
}

body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: var(--dreba-scrollbar-track);
}

body::-webkit-scrollbar-thumb {
    background: var(--dreba-scrollbar-thumb);
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.9);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.08));
    color: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(52, 211, 153, 0.6);
}

.theme-toggle:focus-visible {
    outline: 2px solid rgba(52, 211, 153, 0.75);
    outline-offset: 2px;
}

.theme-toggle i {
    font-size: 1rem;
}

.theme-toggle-icon {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    gap: 0;
}

.theme-toggle-icon i {
    font-size: 0.95rem;
}

.theme-toggle-responsive {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    gap: 0;
}

@media (min-width: 768px) {
    .theme-toggle-responsive {
        width: auto;
        height: auto;
        padding: 0.45rem 0.95rem;
        gap: 0.35rem;
    }
}

.theme-toggle-responsive i {
    font-size: 0.95rem;
}

:is([class~="bg-gray-900"],
    [class~="bg-gray-800"],
    [class~="bg-slate-900"],
    [class~="bg-slate-800"],
    [class~="bg-black"],
    [class~="bg-emerald-600"],
    [class~="bg-emerald-700"],
    [class~="bg-green-600"],
    [class~="bg-green-700"],
    [class*="from-emerald-600"],
    [class*="from-emerald-700"],
    [class*="from-green-600"],
    [class*="from-green-700"],
    [class*="from-gray-900"],
    [class*="from-black"],
    [class*="via-emerald-900"],
    [class*="via-gray-900"],
    [class*="to-emerald-800"],
    [class*="to-emerald-900"],
    [class*="to-green-700"],
    [class*="to-green-800"],
    [class*="to-gray-900"],
    [class*="to-black"]) {
    color: var(--dreba-text-on-dark);
}

:is([class~="bg-gray-900"],
    [class~="bg-gray-800"],
    [class~="bg-slate-900"],
    [class~="bg-slate-800"],
    [class~="bg-black"],
    [class~="bg-emerald-600"],
    [class~="bg-emerald-700"],
    [class~="bg-green-600"],
    [class~="bg-green-700"],
    [class*="from-emerald-600"],
    [class*="from-emerald-700"],
    [class*="from-green-600"],
    [class*="from-green-700"],
    [class*="from-gray-900"],
    [class*="from-black"],
    [class*="via-emerald-900"],
    [class*="via-gray-900"],
    [class*="to-emerald-800"],
    [class*="to-emerald-900"],
    [class*="to-green-700"],
    [class*="to-green-800"],
    [class*="to-gray-900"],
    [class*="to-black"]) a {
    color: rgba(224, 255, 244, 0.95);
}

:is([class~="bg-gray-900"],
    [class~="bg-gray-800"],
    [class~="bg-slate-900"],
    [class~="bg-slate-800"],
    [class~="bg-black"],
    [class~="bg-emerald-600"],
    [class~="bg-emerald-700"],
    [class~="bg-green-600"],
    [class~="bg-green-700"],
    [class*="from-emerald-600"],
    [class*="from-emerald-700"],
    [class*="from-green-600"],
    [class*="from-green-700"],
    [class*="from-gray-900"],
    [class*="from-black"],
    [class*="via-emerald-900"],
    [class*="via-gray-900"],
    [class*="to-emerald-800"],
    [class*="to-emerald-900"],
    [class*="to-green-700"],
    [class*="to-green-800"],
    [class*="to-gray-900"],
    [class*="to-black"]) :is(.text-gray-900,
    .text-gray-800,
    .text-gray-700,
    .text-slate-900,
    .text-black) {
    color: var(--dreba-text-on-dark) !important;
}

:is([class~="bg-gray-900"],
    [class~="bg-gray-800"],
    [class~="bg-slate-900"],
    [class~="bg-slate-800"],
    [class~="bg-black"],
    [class~="bg-emerald-600"],
    [class~="bg-emerald-700"],
    [class~="bg-green-600"],
    [class~="bg-green-700"],
    [class*="from-emerald-600"],
    [class*="from-emerald-700"],
    [class*="from-green-600"],
    [class*="from-green-700"],
    [class*="from-gray-900"],
    [class*="from-black"],
    [class*="via-emerald-900"],
    [class*="via-gray-900"],
    [class*="to-emerald-800"],
    [class*="to-emerald-900"],
    [class*="to-green-700"],
    [class*="to-green-800"],
    [class*="to-gray-900"],
    [class*="to-black"]) :is(.text-gray-600,
    .text-gray-500,
    .text-gray-400,
    .text-slate-600,
    .text-slate-500,
    .text-stone-500) {
    color: var(--dreba-muted-on-dark) !important;
}

:is(.glass,
    .glass-effect,
    .glass-effect-blue,
    .client-booking-glass,
    .request-card,
    .stats-card,
    .price-calculator,
    .info-card,
    .feature-card,
    .testimonial-card,
    .reservation-status-banner,
    .card-hover,
    .drawer,
    .drawer .menu-item,
    .modal-content,
    .modal-panel,
    .modal-shell,
    .smart-suggestions,
    .request-modal-content,
    .driver-details-modal .modal-panel,
    .driver-details-modal .modal-shell,
    .active-ride-panel,
    .celebration-panel,
    .list-card,
    .faq-item,
    .timeline-card) {
    background-color: #ffffff !important;
    color: var(--dreba-text-on-light) !important;
    border-color: var(--dreba-card-border-light) !important;
    box-shadow: var(--dreba-card-shadow) !important;
}

:is(.glass,
    .glass-effect,
    .glass-effect-blue,
    .client-booking-glass,
    .request-card,
    .stats-card,
    .price-calculator,
    .info-card,
    .feature-card,
    .testimonial-card,
    .reservation-status-banner,
    .card-hover,
    .drawer,
    .drawer .menu-item,
    .modal-content,
    .modal-panel,
    .modal-shell,
    .smart-suggestions,
    .request-modal-content,
    .driver-details-modal .modal-panel,
    .driver-details-modal .modal-shell,
    .active-ride-panel,
    .celebration-panel,
    .list-card,
    .faq-item,
    .timeline-card) :is(.text-gray-900,
    .text-gray-800,
    .text-gray-700,
    .text-slate-900,
    .text-black) {
    color: var(--dreba-text-on-light) !important;
}

:is(.glass,
    .glass-effect,
    .glass-effect-blue,
    .client-booking-glass,
    .request-card,
    .stats-card,
    .price-calculator,
    .info-card,
    .feature-card,
    .testimonial-card,
    .reservation-status-banner,
    .card-hover,
    .drawer,
    .drawer .menu-item,
    .modal-content,
    .modal-panel,
    .modal-shell,
    .smart-suggestions,
    .request-modal-content,
    .driver-details-modal .modal-panel,
    .driver-details-modal .modal-shell,
    .active-ride-panel,
    .celebration-panel,
    .list-card,
    .faq-item,
    .timeline-card) :is(.text-gray-600,
    .text-gray-500,
    .text-gray-400,
    .text-slate-600,
    .text-slate-500,
    .text-stone-500) {
    color: #0f172a !important;
}

[data-theme="dark"] .theme-toggle {
    background: linear-gradient(135deg, rgba(4, 47, 73, 0.9), rgba(15, 23, 42, 0.9));
    border-color: rgba(94, 234, 212, 0.35);
    color: var(--dreba-text);
}

.glass-effect,
.glass-effect-blue,
.modal-content,
.card-hover,
.price-calculator {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .vtc-particles-bg {
    opacity: 0.3;
}

[data-theme="dark"] .pagination li {
    background: rgba(8, 23, 45, 0.5);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--dreba-muted);
}

[data-theme="dark"] .pagination li.active,
[data-theme="dark"] .pagination li:hover {
    color: #34d399;
}

[data-theme="dark"] .border-white\/60,
[data-theme="dark"] .border-white\/40,
[data-theme="dark"] .border-white\/20,
[data-theme="dark"] .border-white\/10 {
    border-color: rgba(148, 163, 184, 0.25) !important;
}

[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-slate-900,
[data-theme="dark"] .text-slate-800,
[data-theme="dark"] .text-black {
    color: var(--dreba-text) !important;
}

[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-slate-600,
[data-theme="dark"] .text-slate-500,
[data-theme="dark"] .text-stone-500 {
    color: #0f172a !important;
}

/* Textes gris sur cartes claires en mode nuit = noir */
[data-theme="dark"] :is(.glass,
    .glass-effect,
    .glass-effect-blue,
    .client-booking-glass,
    .request-card,
    .stats-card,
    .price-calculator,
    .info-card,
    .feature-card,
    .testimonial-card,
    .reservation-status-banner,
    .card-hover,
    .modal-content,
    .modal-panel,
    .modal-shell,
    .smart-suggestions,
    .request-modal-content,
    .driver-details-modal .modal-panel,
    .driver-details-modal .modal-shell,
    .active-ride-panel,
    .celebration-panel,
    .list-card,
    .faq-item,
    .timeline-card) .text-gray-600,
[data-theme="dark"] :is(.glass,
    .glass-effect,
    .glass-effect-blue,
    .client-booking-glass,
    .request-card,
    .stats-card,
    .price-calculator,
    .info-card,
    .feature-card,
    .testimonial-card,
    .reservation-status-banner,
    .card-hover,
    .modal-content,
    .modal-panel,
    .modal-shell,
    .smart-suggestions,
    .request-modal-content,
    .driver-details-modal .modal-panel,
    .driver-details-modal .modal-shell,
    .active-ride-panel,
    .celebration-panel,
    .list-card,
    .faq-item,
    .timeline-card) .text-gray-500,
[data-theme="dark"] :is(.glass,
    .glass-effect,
    .glass-effect-blue,
    .client-booking-glass,
    .request-card,
    .stats-card,
    .price-calculator,
    .info-card,
    .feature-card,
    .testimonial-card,
    .reservation-status-banner,
    .card-hover,
    .modal-content,
    .modal-panel,
    .modal-shell,
    .smart-suggestions,
    .request-modal-content,
    .driver-details-modal .modal-panel,
    .driver-details-modal .modal-shell,
    .active-ride-panel,
    .celebration-panel,
    .list-card,
    .faq-item,
    .timeline-card) .text-gray-400 {
    color: #0f172a !important;
}

[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300,
[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-slate-200,
[data-theme="dark"] .border-stone-100,
[data-theme="dark"] .border-stone-200,
[data-theme="dark"] .border-emerald-100 {
    border-color: var(--dreba-border) !important;
}

[data-theme="dark"] .shadow-lg,
[data-theme="dark"] .shadow-xl,
[data-theme="dark"] .shadow-2xl {
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.55) !important;
}

[data-theme="dark"] .from-green-50 {
    --tw-gradient-from: rgba(8, 23, 45, 0.95) !important;
    --tw-gradient-to: rgba(4, 12, 24, 0.85) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

[data-theme="dark"] .from-blue-50 {
    --tw-gradient-from: rgba(5, 25, 45, 0.95) !important;
    --tw-gradient-to: rgba(3, 14, 30, 0.9) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

[data-theme="dark"] .from-purple-50 {
    --tw-gradient-from: rgba(26, 8, 36, 0.95) !important;
    --tw-gradient-to: rgba(17, 6, 24, 0.9) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

[data-theme="dark"] .from-orange-50 {
    --tw-gradient-from: rgba(30, 12, 4, 0.95) !important;
    --tw-gradient-to: rgba(24, 8, 3, 0.9) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

[data-theme="dark"] .from-teal-50 {
    --tw-gradient-from: rgba(4, 24, 26, 0.95) !important;
    --tw-gradient-to: rgba(3, 18, 20, 0.9) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

[data-theme="dark"] .via-emerald-50 {
    --tw-gradient-stops: var(--tw-gradient-from), rgba(8, 47, 73, 0.75), var(--tw-gradient-to);
}

[data-theme="dark"] .to-blue-50,
[data-theme="dark"] .to-blue-100 {
    --tw-gradient-to: rgba(3, 20, 36, 0.85) !important;
}

[data-theme="dark"] .to-purple-50,
[data-theme="dark"] .to-purple-100 {
    --tw-gradient-to: rgba(24, 6, 36, 0.85) !important;
}

[data-theme="dark"] .to-orange-50,
[data-theme="dark"] .to-orange-100 {
    --tw-gradient-to: rgba(34, 14, 5, 0.85) !important;
}

[data-theme="dark"] .to-teal-100 {
    --tw-gradient-to: rgba(3, 18, 20, 0.85) !important;
}

[data-theme="dark"] .to-teal-50,
[data-theme="dark"] .to-emerald-50 {
    --tw-gradient-to: rgba(5, 23, 38, 0.85) !important;
}

[data-theme="dark"] #mobileMenu {
    background-image: linear-gradient(135deg, rgba(5, 23, 45, 0.95), rgba(4, 55, 73, 0.9)) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] #mobileMenu a,
[data-theme="dark"] #mobileMenu button {
    color: var(--dreba-text) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .smart-suggestions,
[data-theme="dark"] .smart-suggestions button,
[data-theme="dark"] .smart-suggestions-empty {
    background-color: var(--dreba-input-bg) !important;
    color: var(--dreba-text) !important;
    border-color: var(--dreba-border) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: rgba(148, 163, 184, 0.8);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    outline: none;
    border-color: #34d399 !important;
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.45);
}

[data-theme="dark"] .smart-suggestions button:hover {
    background-color: rgba(16, 185, 129, 0.12) !important;
}

[data-theme="dark"] table,
[data-theme="dark"] th,
[data-theme="dark"] td {
    border-color: var(--dreba-border) !important;
    color: var(--dreba-text);
}

[data-theme="dark"] thead {
    background-color: rgba(8, 23, 45, 0.9);
}

[data-theme="dark"] tbody tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.5);
}

[data-theme="dark"] .leaflet-container {
    background: #0b1120 !important;
    filter: grayscale(0.1) brightness(0.85);
}

[data-theme="dark"] .leaflet-control,
[data-theme="dark"] .leaflet-popup-content-wrapper,
[data-theme="dark"] .leaflet-popup-tip {
    background: rgba(11, 23, 41, 0.95) !important;
    color: var(--dreba-text);
    border-color: var(--dreba-border) !important;
}

[data-theme="dark"] .request-modal-content,
[data-theme="dark"] .drawer,
[data-theme="dark"] .drawer .menu-item,
[data-theme="dark"] .active-ride-panel,
[data-theme="dark"] .celebration-panel {
    background-color: var(--dreba-panel) !important;
    color: var(--dreba-text);
    border-color: var(--dreba-border) !important;
}

[data-theme="dark"] .celebration-panel {
    background-image: linear-gradient(135deg, rgba(4, 45, 73, 0.85), rgba(4, 47, 73, 0.65));
}

[data-theme="dark"] footer,
[data-theme="dark"] .bg-gray-900,
[data-theme="dark"] .bg-slate-900 {
    background-color: #020617 !important;
}

[data-theme="dark"] .hero-section::after,
[data-theme="dark"] .hero-overlay {
    background: var(--dreba-overlay);
}

[data-theme="dark"] .card-hover {
    background: var(--dreba-card);
    border-color: var(--dreba-border);
}

[data-theme="dark"] .stats-card,
[data-theme="dark"] .request-card,
[data-theme="dark"] .price-calculator,
[data-theme="dark"] .reservation-status-banner,
[data-theme="dark"] .info-card {
    background-color: var(--dreba-card) !important;
    border-color: var(--dreba-border) !important;
    color: var(--dreba-text);
}

[data-theme="dark"] .info-card .text-sm,
[data-theme="dark"] .reservation-status-banner .text-sm {
    color: var(--dreba-muted);
}

[data-theme="dark"] .badge,
[data-theme="dark"] .status-pill,
[data-theme="dark"] .tag {
    background: rgba(16, 185, 129, 0.18);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .notification,
[data-theme="dark"] .alert {
    background-color: rgba(15, 23, 42, 0.85);
    border-color: rgba(248, 250, 252, 0.15);
}

[data-theme="dark"] .timeline::before,
[data-theme="dark"] .timeline-step::before,
[data-theme="dark"] .step-line {
    background-color: rgba(148, 163, 184, 0.35);
}

[data-theme="dark"] .cta-button,
[data-theme="dark"] .hero-cta {
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .stat-box,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .testimonial-card {
    background-color: var(--dreba-card) !important;
    border-color: var(--dreba-border) !important;
}

[data-theme="dark"] .driver-marker-icon {
    border-color: var(--dreba-surface);
}

[data-theme="dark"] .drawer .menu-item:hover,
[data-theme="dark"] .request-card:hover,
[data-theme="dark"] .card-hover:hover {
    background-color: rgba(52, 211, 153, 0.08) !important;
    border-color: rgba(52, 211, 153, 0.35) !important;
}

[data-theme="dark"] .timeline-card,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .list-card {
    background-color: var(--dreba-panel) !important;
    border-color: var(--dreba-border) !important;
}
