.share-buttons {
    margin-top: 2rem;
    margin-bottom: 2rem;
}
.share-item {
    margin-bottom: 1.5rem;
}
.share-label {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: inherit;
}
.qr-section {
    margin-top: 2rem;
}
.qr-code-container {
    background-color: white;
    padding: 1rem;
    display: inline-block;
    border-radius: 8px;
    margin: 1.5rem 0;
}
.qr-code-image {
    width: 200px;
    height: 200px;
    display: block;
}
.qr-actions {
    margin-top: 1.5rem;
}
.qr-actions .btn {
    margin: 0 0.5rem;
}
.qr-actions .btn i {
    margin-right: 0.5rem;
    vertical-align: middle;
}
.modal {
    color: rgba(0, 0, 0, 0.87);
    background-color: #fff;
}
/* Support du thème sombre */
@media (prefers-color-scheme: dark) {
    .modal {
        color: rgba(255, 255, 255, 0.87);
        background-color: #424242;
    }
    .modal .modal-footer {
        background-color: #424242;
    }
    .share-label {
        color: rgba(255, 255, 255, 0.87);
    }
    .btn-flat {
        color: #fff;
    }
    .divider {
        background-color: rgba(255, 255, 255, 0.12);
    }
}

/* ========================================
   STYLES POUR LE MODAL D'AVIS
   ======================================== */

/* Modal plein écran */
.modal-fullscreen-avis {
    width: 100vw !important;
    max-height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow-y: auto !important;
    background-color: #fafafa !important;
    position: fixed !important;
}

.modal-content-avis {
    padding: 0 !important;
    position: relative;
    min-height: calc(100vh - 80px);
}

.container-avis {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem 6rem 1rem;
}

/* Bouton fermer en haut à droite */
.modal-close-btn-avis {
    position: sticky;
    top: 20px;
    float: right;
    margin: 20px 20px 0 0;
    z-index: 1002;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.modal-close-btn-avis i {
    font-size: 2rem;
}

.modal-close-btn-avis:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Image d'aperçu */
.avis-image-preview {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

/* Header d'avis */
.avis-header {
    margin-bottom: 2rem;
}

/* Étoiles de notation */
.stars-container {
    padding: 1.5rem 0;
}

.stars-rating {
    display: inline-flex;
    gap: 0.5rem;
    cursor: pointer;
}

.star-icon {
    font-size: 3rem;
    color: #ddd;
    transition: all 0.2s ease;
    cursor: pointer;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 48;
}

.star-icon:hover,
.star-icon.active {
    color: #e74c3c;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
    transform: scale(1.1);
}

.rating-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: #424242 !important;
    min-height: 1.5rem;
}

/* Titres du modal */
.modal-title-avis {
    color: #1976d2;
    font-weight: 500;
    margin-top: 1rem;
}

.modal-subtitle-avis {
    color: #424242;
}

/* Labels personnalisés */
.form-label-custom {
    font-size: 1.1rem;
    font-weight: 500;
    color: #424242 !important;
    display: block;
    margin-bottom: 1rem;
}

.label-avis {
    color: #424242 !important;
}

/* Cards dans le modal */
.card-avis {
    background-color: #fff !important;
}

.card-avis .card-content {
    color: #424242 !important;
}

.card-avis .card-action {
    background-color: #f5f5f5 !important;
}

/* Compteur de caractères */
#charCount {
    display: block;
    font-size: 0.9rem;
    color: #666 !important;
    margin-top: 0.5rem;
}

#charCount.error {
    color: #f44336 !important;
}

#charCount.success {
    color: #4caf50 !important;
}

/* Texte de la checkbox */
.checkbox-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #424242 !important;
}

/* Styles pour les radio buttons et checkbox labels */
.modal-fullscreen-avis label > span {
    color: #424242 !important;
}

/* Select et textarea */
.modal-fullscreen-avis select.browser-default {
    display: block !important;
    width: 100% !important;
    height: 3rem !important;
    background-color: #fff !important;
    border: 1px solid #9e9e9e !important;
    color: #424242 !important;
    padding: 0 12px !important;
    border-radius: 4px !important;
    font-size: 1rem !important;
    line-height: 3rem !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    appearance: auto !important;
}

.modal-fullscreen-avis select.browser-default:focus {
    outline: none !important;
    border-color: #26a69a !important;
    box-shadow: 0 0 0 1px #26a69a !important;
}

.modal-fullscreen-avis .input-field {
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
}

.modal-fullscreen-avis .input-field label {
    position: static !important;
    transform: none !important;
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.modal-fullscreen-avis textarea.materialize-textarea {
    border: 1px solid #9e9e9e !important;
    border-radius: 4px !important;
    color: #424242 !important;
    min-height: 120px !important;
    padding: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    resize: vertical !important;
}

.modal-fullscreen-avis textarea.materialize-textarea:focus {
    outline: none !important;
    border-color: #26a69a !important;
    box-shadow: 0 0 0 1px #26a69a !important;
}

.modal-fullscreen-avis textarea.materialize-textarea::placeholder {
    color: #9e9e9e !important;
    opacity: 0.8 !important;
}

/* Messages d'erreur */
.helper-text {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Marges personnalisées */
.mb-3 {
    margin-bottom: 2rem !important;
}

.mt-1 {
    margin-top: 0.5rem !important;
}

.mt-2 {
    margin-top: 1rem !important;
}

.ml-1 {
    margin-left: 0.5rem !important;
}

.ml-2 {
    margin-left: 1rem !important;
}

/* Alignement des boutons */
.modal-fullscreen-avis .btn i.material-symbols-outlined {
    vertical-align: middle !important;
    line-height: inherit !important;
    display: inline-block !important;
}

.modal-fullscreen-avis .btn.icon-left i,
.modal-fullscreen-avis .btn i.left {
    margin-right: 0.5rem !important;
}

.modal-fullscreen-avis .card-action .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: normal !important;
}

/* Message global */
#messageAvis {
    margin-top: 1.5rem;
    padding: 1rem;
}

#messageAvis.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

#messageAvis.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Responsive */
@media only screen and (max-width: 600px) {
    /* Ajustement du modal pour mobile */
    .modal-fullscreen-avis {
        height: 100dvh !important; /* dvh prend en compte la barre d'adresse mobile */
        max-height: 100dvh !important;
    }

    .modal-content-avis {
        min-height: auto;
        padding-bottom: 80px !important; /* Espace pour les boutons */
    }

    .container-avis {
        padding: 1rem 0.5rem 8rem 0.5rem !important; /* Plus d'espace en bas */
    }

    .modal-close-btn-avis {
        top: 10px;
        right: 10px;
        margin: 10px 10px 0 0;
    }

    .star-icon {
        font-size: 2.5rem;
    }

    .avis-image-preview {
        max-width: 150px;
    }

    .modal-title-avis {
        font-size: 1.5rem;
    }

    /* S'assurer que les boutons d'action sont toujours visibles */
    .card-avis .card-action {
        position: sticky;
        bottom: 0;
        z-index: 100;
        padding: 1.5rem 1rem !important;
        background-color: #f5f5f5 !important;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
        margin-top: 2rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    /* Boutons empilés verticalement sur mobile */
    .card-avis .card-action .btn {
        width: 100%;
        margin: 0 !important;
    }

    /* Réduire les marges sur mobile */
    .avis-header {
        margin-bottom: 1rem;
    }

    .card-avis .card-content {
        padding: 1rem !important;
    }

    .row.mb-3 {
        margin-bottom: 1rem !important;
    }
}

@media only screen and (min-width: 601px) {
    /* Boutons côte à côte sur tablette et desktop */
    .card-avis .card-action {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }

    .card-avis .card-action .btn {
        width: auto;
        min-width: 150px;
    }
}

@media only screen and (min-width: 993px) {
    .container-avis {
        padding: 3rem 2rem;
    }
}

@media only screen and (min-width: 1200px) {
    .container-avis {
        padding: 4rem 3rem;
    }
}

/* Support du thème sombre pour le modal d'avis */
@media (prefers-color-scheme: dark) {
    .modal-fullscreen-avis {
        background-color: #303030 !important;
    }

    .modal-title-avis {
        color: #64b5f6 !important;
    }

    .modal-subtitle-avis {
        color: rgba(255, 255, 255, 0.87) !important;
    }

    .form-label-custom {
        color: rgba(255, 255, 255, 0.87) !important;
    }

    .label-avis {
        color: rgba(255, 255, 255, 0.87) !important;
    }

    .rating-text {
        color: rgba(255, 255, 255, 0.87) !important;
    }

    .checkbox-text {
        color: rgba(255, 255, 255, 0.7) !important;
    }

    .modal-fullscreen-avis label > span {
        color: rgba(255, 255, 255, 0.87) !important;
    }

    #charCount {
        color: rgba(255, 255, 255, 0.6) !important;
    }

    .card-avis {
        background-color: #424242 !important;
    }

    .card-avis .card-content {
        color: rgba(255, 255, 255, 0.87) !important;
    }

    .card-avis .card-action {
        background-color: #333 !important;
    }

    .modal-fullscreen-avis select.browser-default {
        background-color: #424242 !important;
        border-color: #666 !important;
        color: rgba(255, 255, 255, 0.87) !important;
    }

    .modal-fullscreen-avis select.browser-default:focus {
        border-color: #26a69a !important;
        box-shadow: 0 0 0 1px #26a69a !important;
    }

    .modal-fullscreen-avis select.browser-default option {
        background-color: #424242 !important;
        color: rgba(255, 255, 255, 0.87) !important;
    }

    .modal-fullscreen-avis textarea.materialize-textarea {
        background-color: #424242 !important;
        border-color: #666 !important;
        color: rgba(255, 255, 255, 0.87) !important;
    }

    .modal-fullscreen-avis textarea.materialize-textarea:focus {
        border-color: #26a69a !important;
        box-shadow: 0 0 0 1px #26a69a !important;
    }

    .modal-fullscreen-avis textarea.materialize-textarea::placeholder {
        color: rgba(255, 255, 255, 0.5) !important;
    }
}

/* Mode sombre + mobile : card-action sticky avec ombre adaptée */
@media only screen and (max-width: 600px) and (prefers-color-scheme: dark) {
    .card-avis .card-action {
        background-color: #333 !important;
        box-shadow: 0 -2px 8px rgba(255,255,255,0.1);
    }
}

/* Forcer les couleurs en mode light (surcharge si nécessaire) */
html:not([data-theme="dark"]) .modal-fullscreen-avis,
body:not([data-theme="dark"]) .modal-fullscreen-avis {
    background-color: #fafafa !important;
}

html:not([data-theme="dark"]) .card-avis,
body:not([data-theme="dark"]) .card-avis {
    background-color: #fff !important;
}

html:not([data-theme="dark"]) .modal-fullscreen-avis .modal-title-avis,
body:not([data-theme="dark"]) .modal-fullscreen-avis .modal-title-avis {
    color: #1976d2 !important;
}

html:not([data-theme="dark"]) .modal-fullscreen-avis .modal-subtitle-avis,
html:not([data-theme="dark"]) .modal-fullscreen-avis .form-label-custom,
html:not([data-theme="dark"]) .modal-fullscreen-avis .label-avis,
html:not([data-theme="dark"]) .modal-fullscreen-avis .rating-text,
html:not([data-theme="dark"]) .modal-fullscreen-avis .checkbox-text,
html:not([data-theme="dark"]) .modal-fullscreen-avis label > span,
body:not([data-theme="dark"]) .modal-fullscreen-avis .modal-subtitle-avis,
body:not([data-theme="dark"]) .modal-fullscreen-avis .form-label-custom,
body:not([data-theme="dark"]) .modal-fullscreen-avis .label-avis,
body:not([data-theme="dark"]) .modal-fullscreen-avis .rating-text,
body:not([data-theme="dark"]) .modal-fullscreen-avis .checkbox-text,
body:not([data-theme="dark"]) .modal-fullscreen-avis label > span {
    color: #424242 !important;
}

/* Assurer la visibilité du texte dans tous les cas */
.modal-fullscreen-avis input[type="radio"] + span,
.modal-fullscreen-avis input[type="checkbox"] + span {
    color: #424242 !important;
}

.modal-fullscreen-avis .helper-text {
    color: #666 !important;
}

/* Styles additionnels pour écrans larges */
@media only screen and (min-width: 1600px) {
    .container-avis {
        max-width: 1600px;
    }
}

/* Smooth scroll pour les ancres */
html {
    scroll-behavior: smooth;
}

/* === BLOC D'AFFICHAGE DES AVIS SUR LA FICHE === */
.bloc-avis-fiche {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Hexagones (remplace les étoiles) */
.avis-etoiles {
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
}

/* Hexagone avec pointe vers le haut */
.hexagone-complet,
.hexagone-demi,
.hexagone-vide {
    display: inline-block;
    width: 20px;
    height: 23px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: transform 0.2s ease;
}

.hexagone-complet:hover,
.hexagone-demi:hover,
.hexagone-vide:hover {
    transform: scale(1.1);
}

/* Hexagone complet - bleu clair */
.hexagone-complet {
    background: linear-gradient(135deg, #64B5F6 0%, #42A5F5 100%);
    box-shadow: 0 2px 4px rgba(66, 165, 245, 0.3);
}

/* Demi-hexagone - moitié bleu, moitié gris */
.hexagone-demi {
    background: linear-gradient(90deg, #64B5F6 50%, #CCC 50%);
    box-shadow: 0 2px 4px rgba(66, 165, 245, 0.2);
}

/* Hexagone vide - gris clair */
.hexagone-vide {
    background: #CCC;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Note et nombre d'avis */
.avis-note {
    font-size: 18px;
    font-weight: 500;
    color: #fff; /* Blanc par défaut pour les cards classiques avec fond sombre */
}

.avis-nombre {
    font-size: 14px;
    color: #fff; /* Blanc par défaut pour les cards classiques avec fond sombre */
}

/* Sur les modern-cards, adapter les couleurs */
.modern-card .avis-note {
    color: #333; /* Texte foncé sur fond clair */
}

.modern-card .avis-nombre {
    color: #666; /* Texte gris sur fond clair */
}

.lien-vers-avis {
    color: #2196F3;
    text-decoration: none;
    transition: all 0.2s ease;
}

.lien-vers-avis:hover {
    color: #1976D2;
    text-decoration: underline;
}

/* Support du thème sombre */
@media (prefers-color-scheme: dark) {
    .lien-vers-avis {
        color: #64B5F6;
    }

    .lien-vers-avis:hover {
        color: #90CAF9;
    }

    /* Hexagones en mode sombre - plus lumineux */
    .hexagone-complet {
        background: linear-gradient(135deg, #90CAF9 0%, #64B5F6 100%);
        box-shadow: 0 2px 6px rgba(144, 202, 249, 0.4);
    }

    .hexagone-demi {
        background: linear-gradient(90deg, #90CAF9 50%, #555 50%);
        box-shadow: 0 2px 4px rgba(144, 202, 249, 0.3);
    }

    .hexagone-vide {
        background: #555;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }

    /* Modern-cards en mode sombre */
    .modern-card .avis-note {
        color: #fff; /* Texte blanc sur fond sombre */
    }

    .modern-card .avis-nombre {
        color: #bbb; /* Texte gris clair sur fond sombre */
    }
}

/* Responsive */
@media only screen and (max-width: 600px) {
    .bloc-avis-fiche {
        gap: 6px;
    }

    .avis-etoiles {
        font-size: 18px;
        gap: 2px;
    }

    /* Hexagones plus petits sur mobile */
    .hexagone-complet,
    .hexagone-demi,
    .hexagone-vide {
        width: 16px;
        height: 18px;
    }

    .avis-note {
        font-size: 16px;
    }

    .avis-nombre {
        font-size: 12px;
    }
}

/* === SECTION COMPLÈTE DES AVIS === */
.section-avis-complete {
    margin: 40px 0;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* État vide (aucun avis) */
.avis-vide {
    text-align: center;
    padding: 60px 20px;
}

.avis-vide-icon {
    font-size: 80px;
    color: #2196F3;
    margin-bottom: 20px;
}

.avis-vide-icon i {
    font-size: 80px;
}

.avis-vide-titre {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.avis-vide-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* En-tête des avis */
.avis-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.avis-titre {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
}

.avis-stats-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.avis-etoiles-large {
    font-size: 32px;
    line-height: 1;
    display: flex;
    gap: 4px;
}

.avis-etoiles-large .etoile-complete,
.avis-etoiles-large .etoile-demie,
.avis-etoiles-large .etoile-vide {
    font-size: 32px;
}

.avis-score-large {
    font-size: 36px;
    font-weight: bold;
    color: #2196F3;
}

.avis-total {
    font-size: 16px;
    color: #666;
}

/* Liste des avis */
.avis-liste {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Item d'avis individuel */
.avis-item {
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
    transition: all 0.3s ease;
}

.avis-item:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.avis-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.avis-item-note {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avis-item-etoiles {
    font-size: 20px;
    color: #FFD700;
}

.avis-item-note-num {
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

.avis-item-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.avis-item-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.avis-item-body {
    margin: 15px 0;
}

.avis-item-texte {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.avis-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 10px;
}

.avis-item-conseille {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.icone-conseille {
    font-size: 18px;
}

.avis-item-date-pub {
    font-size: 13px;
    color: #999;
}

/* Footer avec bouton ajouter avis */
.avis-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

/* Support du thème sombre pour la section avis */
@media (prefers-color-scheme: dark) {
    .section-avis-complete {
        background: #2c2c2c;
    }

    .avis-vide-titre,
    .avis-titre {
        color: #fff;
    }

    .avis-vide-description,
    .avis-total {
        color: #aaa;
    }

    .avis-header {
        border-bottom-color: #444;
    }

    .avis-item {
        background: #383838;
    }

    .avis-item:hover {
        background: #424242;
    }

    .avis-item-note-num,
    .avis-item-texte {
        color: #fff;
    }

    .avis-item-meta,
    .avis-item-conseille {
        color: #aaa;
    }

    .avis-item-footer {
        border-top-color: #555;
    }

    .avis-footer {
        border-top-color: #444;
    }
}

/* Responsive pour la section avis */
@media only screen and (max-width: 768px) {
    .section-avis-complete {
        padding: 20px;
        margin: 20px 0;
    }

    .avis-titre {
        font-size: 22px;
    }

    .avis-etoiles-large {
        font-size: 24px;
    }

    .avis-etoiles-large .etoile-complete,
    .avis-etoiles-large .etoile-demie,
    .avis-etoiles-large .etoile-vide {
        font-size: 24px;
    }

    .avis-score-large {
        font-size: 28px;
    }

    .avis-item {
        padding: 15px;
    }

    .avis-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .avis-item-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .avis-vide {
        padding: 40px 15px;
    }

    .avis-vide-icon i {
        font-size: 60px;
    }

    .avis-vide-titre {
        font-size: 20px;
    }

    /* Bouton "Soyez le premier" responsive sur mobile */
    .avis-vide .btn-large {
        font-size: 14px;
        padding: 12px 16px;
        height: auto;
        line-height: 1.4;
        white-space: normal;
        max-width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .avis-vide .btn-large i {
        font-size: 20px;
        margin-right: 8px;
    }

    /* Bouton "Ajouter mon avis" responsive sur mobile */
    .avis-footer .btn {
        font-size: 14px;
        padding: 10px 16px;
        height: auto;
        line-height: 1.4;
        white-space: normal;
        max-width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .avis-footer .btn i {
        font-size: 18px;
        margin-right: 6px;
    }
}


/* Photo Gallery for Tourism Activities */

/* Empêcher le scroll horizontal sur mobile */
body {
    overflow-x: hidden;
}

/* Conteneur du carousel original (avant transformation JS) */
.atf-carousel-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
    overflow: hidden;
    background-color: #f5f5f5;
}

.atf-carousel-items {
    position: relative;
    width: 100%;
    display: block;
}

.atf-carousel-item {
    position: relative;
    width: 100%;
    display: block;
}

/* Cacher toutes les images sauf la première avant transformation JS */
.atf-carousel-item:not(:first-child) {
    display: none;
}

.atf-carousel-item img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 60vh;
    object-fit: contain;
}

/* Main photo container - adaptive to device orientation */
.atf-photo-main {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Landscape mode (default) */
.atf-photo-main img {
    width: 100%;
    display: block;
    object-fit: contain;
    background-color: #000;
    max-height: 60vh;
}

/* Styles pour la gestion des activités sans photo */
/* Pour les activités sans photo (structure originale avec .carousel-item) */
.carousel-item .image-container-ssphoto,
.atf-carousel-container .image-container-ssphoto {
    position: relative;
    width: 100%;
    min-height: 400px;
    display: block;
    background-color: #f0f0f0;
}

.carousel-item .image-container-ssphoto img.ssphoto,
.atf-carousel-container .image-container-ssphoto img.ssphoto {
    width: 100%;
    height: auto;
    display: block;
    min-height: 400px;
    object-fit: cover;
}

.carousel-item .overlay-ssphoto,
.atf-carousel-container .overlay-ssphoto {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    pointer-events: none;
}

.carousel-item .centered-text-ssphoto,
.atf-carousel-container .centered-text-ssphoto {
    position: relative;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    width: 80%;
    padding: 20px;
    z-index: 10;
}

.carousel-item .centered-text-ssphoto img,
.atf-carousel-container .centered-text-ssphoto img {
    width: 64px;
    height: 64px;
    margin: 10px auto;
    display: block;
}

.carousel-item .bottom-right-text-ssphoto,
.atf-carousel-container .bottom-right-text-ssphoto {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.8rem;
    text-align: right;
    padding: 5px;
    max-width: 80%;
    z-index: 10;
}

/* "More photos" button */
.atf-more-photos {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    z-index: 2;
}

.atf-more-photos:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* Modal Gallery */
.atf-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    background-color: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    box-sizing: border-box;
}

.atf-gallery-modal * {
    box-sizing: border-box;
}

.atf-gallery-modal.show {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Header */
.atf-gallery-header {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    z-index: 1002;
}

/* Bouton fermer en haut à droite (style identique au modal des avis) */
.atf-gallery-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1003;
    background-color: #f44336;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.atf-gallery-close i {
    font-size: 2rem;
    line-height: 1;
}

.atf-gallery-close:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Modal Content */
.atf-gallery-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Slideshow container */
.atf-gallery-slides {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease;
}

.atf-gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.atf-gallery-slide.active {
    opacity: 1;
    z-index: 1;
}

/* Image styling within slides */
.atf-gallery-slide img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Navigation arrows */
.atf-gallery-prev,
.atf-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.atf-gallery-prev {
    left: 20px;
}

.atf-gallery-next {
    right: 20px;
}

.atf-gallery-prev:hover,
.atf-gallery-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Auto-play control */
.atf-gallery-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 25px;
    z-index: 1002;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s ease;
}

.atf-gallery-controls:hover {
    background: rgba(0, 0, 0, 0.85);
}

.atf-gallery-controls input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4CAF50;
    margin: 0;
}

.atf-gallery-controls label {
    margin: 0;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Indicateur visuel quand l'autoplay est actif */
.atf-gallery-controls.active {
    background: rgba(76, 175, 80, 0.8);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.atf-gallery-controls.active:hover {
    background: rgba(76, 175, 80, 0.9);
}

/* Animation de l'icône quand l'autoplay est actif */
.atf-gallery-controls.active label i {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Portrait mode adjustments */
@media (orientation: portrait) {
    .atf-photo-main {
        max-height: 70vh;
    }

    .atf-photo-main img {
        width: 100%;
        object-fit: contain;
        max-height: 70vh;
    }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    /* Empêcher le débordement du modal */
    .atf-gallery-modal {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    .atf-gallery-header {
        padding: 0;
    }

    .atf-gallery-content {
        padding: 0 5px;
    }

    /* Flèches de navigation plus petites et plus proches des bords */
    .atf-gallery-prev,
    .atf-gallery-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .atf-gallery-prev {
        left: 5px;
    }

    .atf-gallery-next {
        right: 5px;
    }

    /* Bouton de fermeture plus petit sur mobile */
    .atf-gallery-close {
        top: 10px;
        right: 10px;
        width: 48px;
        height: 48px;
    }

    .atf-gallery-close i {
        font-size: 1.5rem;
    }

    /* Contrôles autoplay plus compacts */
    .atf-gallery-controls {
        padding: 5px 10px;
        top: 5px;
        left: 5px;
        font-size: 0.85rem;
        border-radius: 15px;
    }

    .atf-gallery-controls input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .atf-gallery-controls label {
        font-size: 0.85rem;
        gap: 5px;
    }

    .atf-gallery-controls label i {
        font-size: 1rem;
    }

    /* Images dans le modal */
    .atf-gallery-slide img {
        max-width: 95%;
        max-height: 75vh;
    }

    /* Bouton "plus de photos" */
    .atf-more-photos {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
}

