/* --- RESET & STRUCTURE DE BASE --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Arial', sans-serif; 
}
body { 
    display: flex; 
    background-color: #f4f4f4; 
    color: #111; 
    overflow-x: hidden; 
}

/* --- BANDE LATÉRALE (PARALLAXE) --- */
.sidebar {
    width: 360px; /* Largeur augmentée x3 */
    height: 100vh;
    position: fixed;
    left: 0; 
    top: 0;
    background-color: #fff;
    display: flex; 
    justify-content: center; 
    align-items: center;
    overflow: hidden; 
    z-index: 10;
    border-right: 1px solid #ddd;
}
.sidebar-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 140px;
    font-weight: 900;
    white-space: nowrap;
    color: #111;
}

/* --- CONTENU PRINCIPAL --- */
.main-content {
    margin-left: 360px;
    padding: 0 40px 40px 40px;
    width: calc(100% - 360px);
}

/* --- EN-TÊTE COLLANT (STICKY HEADER) --- */
.sticky-header {
    position: sticky;
    top: 0;
    background-color: #f4f4f4;
    z-index: 100;
    padding: 30px 0;
}
.header-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: nowrap; /* Maintient le logo, les filtres et la recherche sur la même ligne */
}

/* Logo */
.logo-container { flex-shrink: 0; }
.main-logo { height: 60px; width: auto; display: block; }

/* Filtres */
.filters { 
    display: flex; 
    gap: 15px; 
    flex-shrink: 0;
}
.filter-btn {
    background: none; 
    border: none; 
    font-weight: bold; 
    cursor: pointer;
    font-size: 13px; 
    color: #555; 
    white-space: nowrap;
}
.filter-btn.active { 
    color: #111; 
    border-bottom: 2px solid #111; 
}

/* Barre de recherche large avec loupe */
.search-container {
    display: flex;
    flex: 1; /* Prend l'espace restant */
    max-width: 600px;
    min-width: 200px;
}
#search-bar {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
}
.search-icon-btn {
    padding: 0 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Boutons Grille/Liste */
.view-toggles { 
    display: flex; 
    gap: 10px; 
    flex-shrink: 0; 
}
.view-toggles button { 
    background: none; 
    border: none; 
    font-size: 22px; 
    cursor: pointer; 
    color: #999; 
}
.view-toggles button.active { color: #111; }

/* --- GRILLE DES CONCERTS --- */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px); 
    /* 70px d'espace vertical (entre les lignes) et 70px d'espace horizontal (entre les colonnes) */
    gap: 70px 70px; 
    justify-content: space-between; 
    padding-top: 20px;
    width: 100%;
    
    /* Calcul strict pour 6 concerts maximum : 
       (6 affiches de 160px) + (5 espaces de 70px) = 1310px. */
    max-width: 1310px; 
}

/* Centrage de la grille si l'écran est plus large que le max-width */
#concerts-wrapper {
    margin: 0 auto;
}

/* --- SURVOL IMAGE (MODAL) --- */
.card-image-wrapper {
    position: relative;
    width: 160px; /* On force la largeur */
    height: 160px; /* On force la hauteur pour avoir un carré parfait */
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer; 
    flex-shrink: 0; /* Empêche le conteneur de s'étirer */
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Coupe l'image sans la déformer */
    display: block;
    transition: transform 0.3s ease;
}

.hover-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Fond légèrement sombre pour faire ressortir le texte */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.plus-infos {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    border: 1px solid #fff;
    padding: 5px 10px;
}

.card-image-wrapper:hover .hover-overlay { opacity: 1; }
.card-image-wrapper:hover img { transform: scale(1.05); }

/* --- TYPOGRAPHIE DES CARTES UNIFIÉE --- */
.concert-card h3 { 
    font-size: 15px; 
    font-weight: bold; 
    margin-bottom: 4px; 
}
.concert-card .date { 
    font-size: 15px; 
    font-weight: bold; 
    margin-bottom: 4px; 
}
.concert-card .lieu { 
    font-size: 15px; 
    font-weight: normal; 
    color: #111; 
    margin-bottom: 12px; 
}

/* --- DIMENSIONS DU SVG TICKET --- */
.ticket-icon-hover {
    width: 50px !important;
    max-width: 50px !important;
    height: auto !important;
    object-fit: contain !important;
    transform: none !important; 
}
.ticket-btn-icon {
    width: 15px !important;
    max-width: 15px !important;
    height: auto !important;
    vertical-align: middle !important;
    margin-right: 5px !important;
    display: inline-block !important;
}
.btn-reserver { 
    text-decoration: none; 
    color: #111; 
    font-size: 15px; 
    font-weight: normal; 
}
.btn-reserver:hover { text-decoration: underline; }

/* --- MODE LISTE (BARRE CLIQUABLE) --- */
.list-view { display: flex; flex-direction: column; gap: 10px; }
.list-view .concert-card {
    display: flex; 
    flex-direction: row; 
    align-items: center;
    background: #fff; 
    padding: 10px 20px; 
    border-radius: 6px;
    cursor: pointer; 
    transition: 0.3s;
}
.list-view .card-image-wrapper { 
    width: 60px; 
    height: 60px; 
    flex-shrink: 0; 
    margin-bottom: 0; 
}
.list-view .hover-overlay { 
    background: rgba(255, 255, 255, 0.7); 
}
.list-view .ticket-icon-hover {
    width: 25px !important;
    max-width: 25px !important;
}
.list-view .card-info {
    display: flex; 
    flex: 1; 
    justify-content: space-between; 
    align-items: center;
    margin-left: 20px;
}
.list-view .concert-card:hover { background: rgba(255,255,255,0.7); }

/* --- UTILITAIRES --- */
.hidden { display: none !important; }

/* --- MODAL --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8);
    overflow-y: auto;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 40px;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    position: relative;
    color: #111;
}

.event-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 900;
    border-radius: 4px;
    z-index: 10;
    color: #fff;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.badge-last { background-color: #f0ad4e; } /* Orange */
.badge-soldout { background-color: #d9534f; } /* Rouge */

/* Important : le conteneur de l'image (carte ET modal) doit avoir "position: relative;" pour que le badge se place bien en haut à droite */

.close-modal {
    position: absolute;
    right: 20px; top: 10px;
    font-size: 35px; cursor: pointer;
    color: #999;
}

.modal-body-top {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.modal-left { flex: 0 0 300px; }
.modal-left img { width: 100%; border-radius: 4px; }

.modal-right { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.modal-right h2 { font-size: 32px; font-weight: 900; margin-bottom: 10px; }
.modal-bold { font-weight: bold; font-size: 18px; margin-bottom: 5px; }
.modal-right p { font-size: 18px; margin-bottom: 20px; }

.btn-reserver-modal {
    display: inline-block;
    background: #111; color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    font-weight: bold; border-radius: 4px;
    width: fit-content;
}

.modal-spotify { margin: 30px 0; border-top: 1px solid #eee; padding-top: 30px; }

.modal-suggestions { border-top: 1px solid #eee; padding-top: 30px; }
.modal-suggestions h3 { font-size: 20px; margin-bottom: 20px; }

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Style des cartes miniatures dans le modal */
.suggestion-item { cursor: pointer; text-decoration: none; color: inherit; }
.suggestion-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; margin-bottom: 10px; }
.suggestion-item h4 { font-size: 14px; font-weight: bold; }
.suggestion-item p { font-size: 12px; }

/* Correction image trigger pour le curseur */
.image-trigger { cursor: pointer; display: block; }

@media screen and (max-width: 768px) {
    
    /* 1. LE COUPABLE : On cache complètement la barre latérale sur mobile */
    .sidebar {
        display: none !important;
    }

    /* 2. LA ZONE PRINCIPALE : On enlève la marge gauche de 360px */
    .main-content {
        margin-left: 0 !important;
        padding: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 3. LE HEADER ET LES FILTRES : On empile proprement au centre */
    header, .header-line {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px;
        padding: 10px 0 !important;
        width: 100%;
    }

    .filter-buttons, .filters {
        display: flex;
        overflow-x: auto; 
        white-space: nowrap;
        width: 100%;
        padding-bottom: 10px;
        -ms-overflow-style: none;  
        scrollbar-width: none;  
    }
    .filter-buttons::-webkit-scrollbar, .filters::-webkit-scrollbar { 
        display: none; 
    }

    /* 4. LES CARTES DE CONCERTS : 1 seule colonne qui prend toute la largeur */
    .grid-view {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Force 1 seule colonne */
        gap: 30px !important;
        width: 100% !important;
        padding-top: 10px;
    }

    .concert-card {
        width: 100% !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
        align-items: center; /* Centre la carte */
    }

    .card-image-wrapper {
        width: 100% !important;
        max-width: 350px !important; /* Evite que l'image soit gigantesque sur une tablette */
        height: auto !important;
        aspect-ratio: 1 / 1 !important; /* Maintient le format carré */
    }
    
    .card-image-wrapper img {
        width: 100% !important;
        height: 100% !important;
    }
    
    .card-info {
        width: 100%;
        max-width: 350px;
        text-align: center; /* Centre le texte en mode mobile */
        margin-top: 10px;
    }

    /* 5. LE MODAL (+ D'INFOS) */
    .modal-content {
        width: 95% !important;
        margin: 5% auto !important;
        padding: 20px !important;
    }
    
    .modal-body-top {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .modal-left {
        flex: auto !important;
        width: 100% !important;
    }
    
    .modal-right {
        width: 100% !important;
    }

    #modal-artiste { font-size: 24px !important; }
    
    .btn-reserver-modal {
        display: block !important;
        text-align: center !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .modal-spotify iframe { height: 152px !important; }
    
    .suggestions-grid {
        grid-template-columns: 1fr 1fr !important; /* 2 suggestions côte à côte */
    }
}

/* Pour les tout petits écrans */
@media screen and (max-width: 480px) {
    .suggestions-grid {
        grid-template-columns: 1fr !important; /* 1 seule suggestion par ligne */
    }
}