/* =================================== */
/* SAFARI & iOS DARK MODE OVERRIDE */
/* =================================== */

/* Force le mode clair sur Safari et iOS */
:root {
    color-scheme: light only !important;
    -webkit-color-scheme: light only !important;
}

/* Force les couleurs de base en mode clair */
html {
    color-scheme: light only !important;
    -webkit-color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #212529 !important;
}

body {
    background-color: #f5f7fa !important;
    color: #212529 !important;
    color-scheme: light only !important;
    -webkit-color-scheme: light only !important;
}

/* =================================== */
/* OVERRIDE SPÉCIFIQUE POUR WEBKIT */
/* =================================== */

/* Forcer les couleurs des éléments de base */
*, *::before, *::after {
    color-scheme: light only !important;
    -webkit-color-scheme: light only !important;
}

/* Headers et navigation */
header {
    background: linear-gradient(135deg, #20c997 0%, #18a47c 100%) !important;
    color: #ffffff !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: rgba(255, 255, 255, 1) !important;
}

.navbar-dark .navbar-nav .nav-link.active {
    color: rgba(255, 255, 255, 1) !important;
}

.navbar-brand {
    color: #ffffff !important;
}

/* =================================== */
/* CARTES ET CONTENEURS */
/* =================================== */

.card {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.card-header {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.card-body {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.card-footer {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border-top: 1px solid #dee2e6 !important;
}

/* Cartes de pharmacies */
.pharmacy-card {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.pharmacy-card .card-title {
    color: #212529 !important;
}

.pharmacy-card small {
    color: #6c757d !important;
}

/* =================================== */
/* SECTIONS SPÉCIFIQUES */
/* =================================== */

/* Section hero */
.hero-compact {
    background: linear-gradient(135deg, #20c997 0%, #18a47c 100%) !important;
    color: #ffffff !important;
}

.hero-compact h1,
.hero-compact p,
.hero-compact .small {
    color: #ffffff !important;
}

/* Section d'informations */
.comprehensive-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    color: #212529 !important;
}

.comprehensive-info .card {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.comprehensive-info .card-body {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Section pharmaciens */
.pharmacy-info-section {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f9f0 100%) !important;
    color: #2d2d2d !important;
}

/* =================================== */
/* FORMULAIRES ET INPUTS */
/* =================================== */

.form-control {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}

.form-control:focus {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #20c997 !important;
    box-shadow: 0 0 0 0.2rem rgba(32, 201, 151, 0.25) !important;
}

.form-control::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
}

.form-select {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}

.form-select:focus {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #20c997 !important;
    box-shadow: 0 0 0 0.2rem rgba(32, 201, 151, 0.25) !important;
}

/* Input groups */
.input-group-text {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}

/* =================================== */
/* BOUTONS */
/* =================================== */

.btn-primary {
    background-color: #20c997 !important;
    border-color: #20c997 !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #18a47c !important;
    border-color: #18a47c !important;
    color: #ffffff !important;
}

.btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #ffffff !important;
}

.btn-success:hover {
    background-color: #218838 !important;
    border-color: #218838 !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    background-color: transparent !important;
    color: #20c997 !important;
    border-color: #20c997 !important;
}

.btn-outline-primary:hover {
    background-color: #20c997 !important;
    color: #ffffff !important;
    border-color: #20c997 !important;
}

.btn-outline-success {
    background-color: transparent !important;
    color: #28a745 !important;
    border-color: #28a745 !important;
}

.btn-outline-success:hover {
    background-color: #28a745 !important;
    color: #ffffff !important;
    border-color: #28a745 !important;
}

/* =================================== */
/* ALERTES ET NOTIFICATIONS */
/* =================================== */

.alert {
    color: inherit !important;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1) !important;
    color: #155724 !important;
    border-color: #c3e6cb !important;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #721c24 !important;
    border-color: #f5c6cb !important;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
    color: #856404 !important;
    border-color: #ffeaa7 !important;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1) !important;
    color: #0c5460 !important;
    border-color: #b8daff !important;
}

/* =================================== */
/* DROPDOWNS ET MENUS */
/* =================================== */

.dropdown-menu {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.dropdown-item {
    color: #212529 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.dropdown-item.active {
    background-color: #20c997 !important;
    color: #ffffff !important;
}

.dropdown-header {
    color: #6c757d !important;
}

.dropdown-divider {
    border-color: #dee2e6 !important;
}

/* =================================== */
/* NAVIGATION ET BREADCRUMBS */
/* =================================== */

.breadcrumb {
    background-color: transparent !important;
}

.breadcrumb-item {
    color: #6c757d !important;
}

.breadcrumb-item a {
    color: #20c997 !important;
}

.breadcrumb-item.active {
    color: #212529 !important;
}

/* =================================== */
/* TABLEAUX */
/* =================================== */

.table {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.table th {
    background-color: #212529 !important;
    color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.table td {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

.table tbody tr:hover {
    background-color: rgba(32, 201, 151, 0.05) !important;
    color: #212529 !important;
}

/* =================================== */
/* BADGES ET LABELS */
/* =================================== */

.badge {
    color: #ffffff !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
    color: #ffffff !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

.badge.bg-primary {
    background-color: #20c997 !important;
    color: #ffffff !important;
}

/* =================================== */
/* SECTIONS DE FILTRES */
/* =================================== */

.filter-section .card-header {
    background: linear-gradient(135deg, #20c997 0%, #18a47c 100%) !important;
    color: #ffffff !important;
}

.filter-btn {
    color: #ffffff !important;
}

.filter-btn[data-filter="all"] {
    background-color: #6f42c1 !important;
    color: #ffffff !important;
}

.filter-btn[data-filter="current"] {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.filter-btn[data-filter="closed"] {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.filter-btn[data-filter="upcoming"] {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

.filter-btn[data-filter="past"] {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

.filter-btn[data-filter="normal"] {
    background-color: #17a2b8 !important;
    color: #ffffff !important;
}

/* =================================== */
/* INFORMATIONS DE GARDE */
/* =================================== */

.guard-period {
    background: rgba(255, 243, 205, 0.8) !important;
    border-left: 3px solid #ffeaa7 !important;
    color: #212529 !important;
}

.guard-info {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border-left: 3px solid #ffc107 !important;
}

/* =================================== */
/* ACCORDÉONS ET FAQ */
/* =================================== */

.accordion-button {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border: none !important;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(32, 201, 151, 0.1) !important;
    color: #18a47c !important;
}

.accordion-button:focus {
    border-color: #20c997 !important;
    box-shadow: 0 0 0 0.25rem rgba(32, 201, 151, 0.25) !important;
}

.accordion-item {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.accordion-body {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* =================================== */
/* LIENS ET TEXTES */
/* =================================== */

a {
    color: #20c997 !important;
}

a:hover {
    color: #18a47c !important;
}

.text-primary {
    color: #20c997 !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #17a2b8 !important;
}

.text-secondary {
    color: #6c757d !important;
}

.text-muted {
    color: #6c757d !important;
}

.text-dark {
    color: #212529 !important;
}

.text-white {
    color: #ffffff !important;
}

/* =================================== */
/* SECTIONS COLORÉES */
/* =================================== */

.bg-light {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.bg-dark {
    background-color: #343a40 !important;
    color: #ffffff !important;
}

.bg-primary {
    background-color: #20c997 !important;
    color: #ffffff !important;
}

.bg-success {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.bg-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.bg-warning {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

.bg-info {
    background-color: #17a2b8 !important;
    color: #ffffff !important;
}

.bg-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

/* =================================== */
/* FOOTER */
/* =================================== */

footer {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* =================================== */
/* CORRECTIONS SPÉCIFIQUES WEBKIT */
/* =================================== */

/* Forcer le rendu des couleurs système */
@supports (-webkit-appearance: none) {
    input, 
    select, 
    textarea, 
    button {
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"] {
        background-color: #ffffff !important;
        color: #212529 !important;
        border: 1px solid #ced4da !important;
    }
    
    select {
        background-color: #ffffff !important;
        color: #212529 !important;
        border: 1px solid #ced4da !important;
    }
    
    textarea {
        background-color: #ffffff !important;
        color: #212529 !important;
        border: 1px solid #ced4da !important;
    }
}

/* =================================== */
/* MEDIA QUERIES SPÉCIFIQUES iOS */
/* =================================== */

/* iPhone et iPad */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-text-size-adjust: 100% !important;
        background-color: #f5f7fa !important;
        color: #212529 !important;
    }
    
    .card {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .form-control {
        -webkit-appearance: none !important;
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    input {
        -webkit-appearance: none !important;
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    button {
        -webkit-appearance: none !important;
    }
}

/* =================================== */
/* CORRECTION POUR LES MODES SOMBRES FORCÉS */
/* =================================== */

/* Annuler complètement les préférences de couleur système */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light only !important;
        -webkit-color-scheme: light only !important;
    }
    
    html {
        color-scheme: light only !important;
        -webkit-color-scheme: light only !important;
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    body {
        background-color: #f5f7fa !important;
        color: #212529 !important;
        color-scheme: light only !important;
        -webkit-color-scheme: light only !important;
    }
    
    .card {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .pharmacy-card {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .form-control,
    .form-select,
    input,
    textarea,
    select {
        background-color: #ffffff !important;
        color: #212529 !important;
        border-color: #ced4da !important;
    }
    
    .dropdown-menu {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .dropdown-item {
        color: #212529 !important;
    }
    
    .table {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .table td {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .accordion-button {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
    
    .accordion-body {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
}

/* =================================== */
/* UTILITAIRES DE DÉBOGAGE */
/* =================================== */

/* Classe pour forcer le mode clair sur un élément spécifique */
.force-light-mode {
    color-scheme: light only !important;
    -webkit-color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Classe pour les textes qui doivent rester visibles */
.ensure-visible-text {
    color: #212529 !important;
    background-color: transparent !important;
}

/* Classe pour les arrière-plans qui doivent rester clairs */
.ensure-light-background {
    background-color: #ffffff !important;
    color: #212529 !important;
}