/* Styles pour l'affichage des résultats de recherche */

/* Indicateur de chargement pour la géolocalisation */
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid rgba(0, 120, 212, 0.2);
    border-top: 4px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

:root {
    --background: #ffffff;
    --background-gray: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border: #e0e0e0;
    --primary: #0078d4;
    --primary-light: #e6f2fc;
    --slot-available: #e8f5fe;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Section des résultats */
body {
    padding-top: 70px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    background-color: #121212;
}

/* Couleur de fond du main en mode clair */
[data-bs-theme="light"] main {
    background-color: #f8f9fa;
}

/* Section des résultats */
.results-section {
    padding: 10px 0 40px;
    background-color: var(--bs-body-bg, #121212); /* Utilise la couleur de fond du body de Bootstrap */
    min-height: 400px;
}

/* Section d'en-tête des résultats */
.results-header-section {
    background-color: white;
}

/* En-tête des résultats */
.results-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header-main h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

#back-to-search {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
}

/* Nombre de résultats */
.result-count {
    font-size: 16px;
    font-weight: 500;
    color: #555;
}

/* Conteneur principal des résultats */
.results-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Carte du club */
.club-card {
    display: flex;
    margin-bottom: var(--spacing-lg);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bs-body-bg, #000);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Header des résultats */
.results-header {
    background-color: var(--bs-body-bg, #000);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Nombre de résultats */
.results-count {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.results-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
    text-align: center;
}

/* Colonne de gauche avec les infos du club */
.club-left-column {
    width: 280px;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    background-color: var(--bs-body-bg, #000);
    position: relative;
    z-index: 2;
    box-shadow: 0 1px 5px rgba(0,0,0,0.3);
    border: 1px solid var(--bs-border-color, #444);
    color: var(--bs-body-color, #e0e0e0);
}

/* En-tête du club avec logo et infos */
.club-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-mg);
    width: 100%;
    position: relative;
}

.club-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--bs-tertiary-bg, #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-md);
    overflow: hidden;
    flex-shrink: 0;
}

.club-avatar-placeholder {
    color: var(--primary);
    font-weight: bold;
    font-size: 24px;
}

.club-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.club-name {
    font-size: 20px;
    font-weight: 500;
    color: var(--bs-body-color, #fff);
    margin: 0 0 var(--spacing-md) 0;
    line-height: 1.2;
}

.club-distance {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: #C6FF00;
    position: absolute;
    top: 4px;
    right: 10px;
}

.club-address {
    font-size: 14px;
    color: var(--bs-body-color, #fff);
    margin: var(--spacing-md) 0;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
    position: relative;
    padding-left: 25px;
}

.club-address::before {
    content: '📍'; /* Emoji épingle de localisation */
    position: absolute;
    left: 0;
    top: 0;
    font-size: 16px;
    color: #C6FF00;
}

.icon {
    width: 16px;
    height: 16px;
    margin-right: var(--spacing-xs);
    color: #C6FF00;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Bouton de réservation */
.reserve-btn {
    background-color: #C6FF00;
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    font-weight: 600;
    text-align: center;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
    letter-spacing: 0.5px;
    width: 100%;
    margin-top: 0;
}

.reserve-btn:hover {
    background-color: #d8ff4d;
}

/* Colonne de droite avec les créneaux */
.slots-right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* En-tête des jours */
.days-header {
    display: flex;
    border-bottom: 1px solid #444;
    background-color: #2d2d2d;
}

.day-column {
    flex: 1;
    text-align: center;
    padding: var(--spacing-md) var(--spacing-xs);
}

.day-name {
    font-weight: 500;
    font-size: 14px;
    color: #e0e0e0;
}

.day-date {
    display: block;
    font-size: 12px;
    color: #adb5bd;
    margin-top: 4px;
}

/* Conteneur des créneaux */
.slots-container {
    flex: 1;
    padding: var(--spacing-md);
}

/* Conteneur avec défilement horizontal */
.slots-right-column {
    overflow-x: auto;
    position: relative;
    background-color: #2d2d2d;
    z-index: 1;
    color: #e0e0e0;
}

/* Flèches de navigation */
.slots-table-header {
    position: relative;
}

.nav-arrow {
    width: 30px;
    height: 30px;
    background-color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    color: #C6FF00;
    font-size: 16px;
    transition: all 0.2s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.nav-arrow:hover {
    background-color: #222;
    color: #d8ff4d;
}

.nav-arrow.prev {
    left: 5px;
}

.nav-arrow.next {
    right: 5px;
}

/* Tableau des créneaux */
.slots-table {
    width: 100%;
    min-width: 600px; /* Largeur minimale pour assurer que les colonnes sont larges */
    border-collapse: collapse;
    border-radius: 0px 8px 0px 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background-color: white;
}

/* En-tête du tableau */
.slots-table-header {
    background-color: #222;
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Cellule d'en-tête */
.slots-table-header-cell {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    border-bottom: 1px solid #444;
    min-width: 120px; /* Largeur minimale pour chaque colonne */
    background-color: #333; /* Fond sombre pour l'en-tête */
}

/* Type de terrain */
.court-type {
    font-weight: 500;
    color: #fff !important; /* Force la couleur blanche */
    text-align: left;
    min-width: 120px;
    font-size: 14px;
}

/* Nom du court dans l'en-tête */
.court-name {
    color: #fff;
    font-weight: 500;
}

/* Alternance de couleurs pour les colonnes du tableau */
.slots-table-cell:nth-child(odd) {
    background-color: #6c6c6c; /* Gris clair */
}

.slots-table-cell:nth-child(even) {
    background-color: #555; /* Gris plus foncé */
}

/* Ligne du tableau */
.slots-table-row {
    border-bottom: 1px solid #f0f0f0;
}

/* Effet de survol sur les lignes */
.slots-table-row:hover {
    background-color: #555;
}

/* Cellule du tableau */
.slots-table-cell {
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
    height: 40px;
    background-color: #6c6c6c; /* Gris clair spécifié */
    color: #fff;
}

/* Créneau disponible */
.slot-available {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px 15px;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s;
    width: 90%;
    margin: 0 auto;
}

.slot-available:hover {
    color: #C6FF00;
}

/* Icône d'horloge pour les créneaux */
.slot-available::before {
    content: '⏱️';
    margin-right: 5px;
    font-size: 12px;
}

/* Style déjà défini plus haut */

.slot-empty {
    color: #ccc;
    font-size: 16px;
    font-weight: 300;
}

/* Styles pour les types de terrains */
.court-name {
    font-weight: 500;
    text-align: center;
    margin-bottom: 0;
}

.court-type-row {
    border-bottom: 1px solid #f0f0f0;
}

.court-type {
    font-size: 11px;
    font-weight: normal;
    color: #000;
    display: block;
    width: 100%;
    text-align: center;
}

.slot-time {
    background-color: var(--slot-available);
    color: var(--primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-block;
}

.slot-time:hover {
    background-color: #d1e8f8;
}

/* Media query pour mobile */
@media (max-width: 768px) {
    /* Styles mobile */
    .club-card {
        flex-direction: column;
        border-radius: 0;
        margin-left: -16px;
        margin-right: -16px;
        width: calc(100% + 32px);
    }
    
    .club-left-column {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    /* Styles améliorés pour le header en mobile */
    body {
        padding-top: 85px; /* Réduction de l'espace entre le header et le contenu */
    }
    
    .navbar-modern {
        padding: 0;
        background-color: #1a1a1a;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .navbar-modern .container {
        padding: 0;
    }
    
    /* Styles pour la partie supérieure du header mobile */
    .mobile-header-top {
        padding: 10px 15px;
        width: 100%;
    }
    
    .navbar-brand {
        margin: 0;
        padding: 0;
    }
    
    .navbar-brand img {
        height: 36px;
    }
    
    /* Séparateur entre les deux parties du header */
    .mobile-header-separator {
        height: 1px;
        background-color: rgba(255, 255, 255, 0.1);
        width: 100%;
        margin: 0;
    }
    
    /* Styles pour la partie inférieure du header mobile */
    .mobile-header-bottom {
        padding: 10px 15px;
        width: 100%;
    }
    
    .mobile-header-bottom h2 {
        font-size: 1.1rem !important;
        line-height: 1.2;
        margin: 0;
        font-weight: 500;
        color: #fff;
    }
    
    .theme-switcher {
        transform: scale(0.85);
        margin-right: 10px !important;
    }
    
    .btn-sm.btn-outline-primary {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.35rem !important;
        margin-right: 8px !important;
        border-width: 1px;
        border-color: #C6FF00;
        color: #C6FF00;
        font-weight: 500;
    }
    
    .btn-sm.btn-outline-primary:hover {
        background-color: #C6FF00;
        color: #1a1a1a;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 0.25em 0.5em;
        background-color: #C6FF00;
        color: #1a1a1a;
    }
}

/* Ajustements spécifiques pour très petits écrans */
@media (max-width: 400px) {
    body {
        padding-top: 80px;
    }
    
    .mobile-header-top {
        padding: 8px 12px;
    }
    
    .navbar-brand img {
        height: 30px;
    }
    
    .mobile-header-bottom {
        padding: 8px 12px;
    }
    
    .mobile-header-bottom h2 {
        font-size: 0.9rem !important;
    }
    
    .theme-switcher {
        transform: scale(0.75);
        margin-right: 6px !important;
    }
    
    .btn-sm.btn-outline-primary {
        padding: 0.1rem 0.3rem !important;
        font-size: 0.9rem !important;
        margin-right: 6px !important;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 0.2em 0.4em;
    }
}

/* ========================================
   STYLES MOBILE - Ajout sans modification du desktop
   ======================================== */

/* Styles pour l'affichage mobile en liste */
@media (max-width: 768px) {
    /* Supprimer le padding du container Bootstrap sur mobile */
    .results-section .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Container mobile */
    .mobile-results-container {
        padding: 0;
        background-color: var(--bs-body-bg, #000000);
    }
    
    .mobile-results-count {
        color: #ccc;
        font-size: 16px;
        font-weight: 600;
        text-align: center;
        margin: 12px 0;
    }
    
    /* Liste des créneaux mobile */
    .mobile-slots-list {
        padding: 0;
    }
    
    /* Carte de créneau mobile - Design exact comme image 2 */
    .mobile-slot-card {
        background-color: transparent;
        border: none;
        border-bottom: 1px solid #333;
        margin: 0;
        padding: 16px 5px;
        border-radius: 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        position: relative;
    }
    
    .mobile-slot-card:hover {
        background-color: #222;
        border-color: #333;
        transform: none;
        box-shadow: none;
    }
    
    /* Partie gauche de la carte */
    .mobile-slot-left {
        flex: 1;
    }
    
    .mobile-slot-club {
        color: white;
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 4px;
    }
    
    .mobile-slot-court {
        color: #ccc;
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .mobile-slot-location {
        color: #999;
        font-size: 14px;
        margin-top: 8px;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .mobile-distance, .mobile-wind-info {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        color: #C6FF00; /* Couleur lime pour la distance et l'icône voiture */
        font-weight: 500;
    }
    
    .mobile-distance .icon {
        width: 14px;
        height: 14px;
        color: #C6FF00;
    }
    
    /* Partie droite de la carte */
    .mobile-slot-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        min-width: 65px;
    }
    
    .mobile-slot-time {
        color: white;
        font-size: 18px;
        font-weight: 600;
    }
    
    .mobile-slot-type {
        color: #999;
        font-size: 14px;
        text-align: right;
    }
    
    /* Informations météo et distance */
    .mobile-weather-info {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin-top: 2px;
    }
    
    .mobile-wind-info {
        color: #999;
        font-size: 12px;
    }
    
    .mobile-weather-icon {
        width: 26px;
        height: 26px;
    }
    
    .mobile-weather-temp {
        color: #fff;
        font-size: 14px;
        font-weight: 500;
    }
    
    /* Bouton de réservation mobile */
    .mobile-reserve-btn {
        background: #C6FF00;
        color: #000000;
        border: none;
        padding: 4px 35px;
        border-radius: 6px;
        font-weight: 500;
        font-size: 12px;
        margin-top: 15px;
        cursor: pointer;
        transition: all 0.2s ease;
        text-transform: none;
        letter-spacing: normal;
        min-width: auto;
        position: relative;
        overflow: hidden;
        box-shadow: none;
    }
    
    .mobile-reserve-btn::before {
        display: none;
    }
    
    .mobile-reserve-btn:hover::before {
        display: none;
    }
    
    .mobile-reserve-btn:active {
        background: #A8E600;
        transform: scale(0.98);
        box-shadow: none;
    }
    
    /* Filtres mobiles */
    .mobile-results-container {
        padding: 0;
        background-color: #000000;
    }
    
    .mobile-results-header {
        background-color: #000;
        padding: 0;
        border-bottom: none;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    /* Filtres mobiles horizontaux - Type */
    .mobile-filters:first-child {
        display: flex;
        margin: 8px 0px;
        background-color: #222;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
        padding: 2px;
        height: 32px;
    }
    
    .mobile-filters:first-child .mobile-filter-btn {
        flex: 1;
        background-color: transparent;
        color: #aaa;
        border: none;
        padding: 6px 0;
        font-size: 13px;
        font-weight: 400;
        border-radius: 10px;
        margin: 0;
        transition: all 0.2s ease;
        letter-spacing: 0.3px;
        line-height: 1;
    }
    
    .mobile-filters:first-child .mobile-filter-btn.active {
        background-color: #444;
        color: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    /* Filtres mobiles horizontaux - Clubs */
    .mobile-filters:nth-child(2) {
        display: flex;
        gap: 6px;
        margin: 12px 0 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    /* Masquer la scrollbar pour Chrome/Safari */
    .mobile-filters:nth-child(2)::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-filters:nth-child(2) .mobile-filter-btn {
        background-color: rgba(40, 40, 40, 0.8);
        color: #bbb;
        border: 1px solid #444;
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 12px;
        white-space: nowrap;
        transition: all 0.2s ease;
        line-height: 1.2;
        height: 24px;
    }
    
    .mobile-filters:nth-child(2) .mobile-filter-btn.active {
        background-color: #C6FF00; /* Couleur lime du logo */
        color: #000000 !important; /* Texte noir, !important pour surcharger */
        border-color: #C6FF00;
    }
}

/* Masquer l'affichage mobile sur desktop */
@media (min-width: 769px) {
    .mobile-results-container,
    .mobile-slots-list,
    .mobile-slot-card {
        display: none !important;
    }
}

/* ===== STYLES POUR LE MODE LIGHT MOBILE ===== */
@media (max-width: 768px) {
    html[data-bs-theme="light"] body {
        background-color: #ffffff !important;
    }
    
    html[data-bs-theme="light"] main {
        background-color: #ffffff !important;
    }
    
    html[data-bs-theme="light"] .results-section {
        background-color: #ffffff !important;
    }
    
    html[data-bs-theme="light"] .results-section .container {
        background-color: #ffffff !important;
    }
    
    html[data-bs-theme="light"] .mobile-results-container {
        background-color: #ffffff !important;
        color: #000000;
    }
    
    html[data-bs-theme="light"] .mobile-results-header {
        background-color: #ffffff !important;
        color: #000000;
    }
    
    html[data-bs-theme="light"] .mobile-slots-list {
        background-color: #ffffff !important;
    }
    
    html[data-bs-theme="light"] .mobile-slot-card {
        background-color: #ffffff !important;
        border: none;
        border-bottom: 1px solid #e9ecef;
        color: #000000;
    }
    
    html[data-bs-theme="light"] .mobile-slot-club {
        color: #000000;
        font-weight: 600;
    }
    
    html[data-bs-theme="light"] .mobile-slot-court {
        color: #495057;
    }
    
    html[data-bs-theme="light"] .mobile-slot-time {
        color: #000000;
    }
    
    html[data-bs-theme="light"] .mobile-slot-type {
        color: #6c757d;
    }
    
    html[data-bs-theme="light"] .mobile-distance, 
    html[data-bs-theme="light"] .mobile-wind-info {
        color: #000000; /* Noir en mode light */
    }
    
    html[data-bs-theme="light"] .mobile-distance .icon {
        color: #000000; /* Icône noire */
    }
    
    html[data-bs-theme="light"] .mobile-weather-temp {
        color: #000000;
    }
    
    html[data-bs-theme="light"] .mobile-weather-info {
        color: #000000;
    }
    
    /* Filtres mobiles en mode Light */
    html[data-bs-theme="light"] .mobile-filters:first-child {
        background-color: #e9ecef;
    }
    
    html[data-bs-theme="light"] .mobile-filters:first-child .mobile-filter-btn {
        color: #495057;
    }
    
    html[data-bs-theme="light"] .mobile-filters:first-child .mobile-filter-btn.active {
        background-color: #C6FF00;
        color: #000000;
    }
    
    html[data-bs-theme="light"] .mobile-filters:nth-child(2) .mobile-filter-btn {
        background-color: #f8f9fa;
        color: #495057;
        border: 1px solid #dee2e6;
    }
    
    html[data-bs-theme="light"] .mobile-filters:nth-child(2) .mobile-filter-btn.active {
        background-color: #C6FF00;
        color: #000000;
        border-color: #C6FF00;
    }
    
    /* Header mobile en mode Light */
    html[data-bs-theme="light"] .mobile-header {
        background-color: #ffffff;
        color: #000000;
        border-bottom: 1px solid #e9ecef;
    }
    
    html[data-bs-theme="light"] .mobile-header h1 {
        color: #000000;
    }
    
    html[data-bs-theme="light"] .mobile-header-bottom h2 {
        color: #000000 !important;
    }
    
    html[data-bs-theme="light"] #search-date-display-mobile {
        color: #000000 !important;
    }
    
    /* Bouton Réserver en mode Light - garder le jaune */
    html[data-bs-theme="light"] .mobile-reserve-btn {
        background: #C6FF00;
        color: #000000;
    }
    
    html[data-bs-theme="light"] .mobile-reserve-btn:active {
        background: #A8E600;
        color: #000000;
    }
    
    /* Ajout des styles pour harmoniser le chargement en mode light mobile */
    html[data-bs-theme="light"] .loading-container {
        background-color: #ffffff !important;
    }
    
    html[data-bs-theme="light"] .results-container {
        background-color: #ffffff !important;
    }
}
