body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 0; 
    min-height: 100vh;
    box-sizing: border-box;
}

body.page-image {
    background-color: #f5f5f5; 
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)), 
        url('./images/background/mer.jpg');
    background-size: cover;       
    background-position: center;  
    background-repeat: no-repeat;
    background-attachment: fixed; 
}

/* Header & Navigation (Plein écran en haut) */
.site-header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 2rem;
}

.navbar {
    max-width: 1280px; 
    margin: 0 auto;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; 
    gap: 0.8rem;
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.2s, transform 0.2s;
}

.nav-brand a:hover {
    color: #0056b3;
    transform: scale(1.1);
}

/* Bouton burger masqué par défaut (sur ordinateur) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    padding: 0.4rem;
}

/* Regroupement Menu pour ordinateur */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.8rem; 
    flex: 1;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem; 
    margin: 0;
    padding: 0;
    flex: 1;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #007bff;
    background-color: #f0f4f9;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #495057;
}

.user-badge svg,
.user-badge i {
    color: #007bff;
}

.btn-logout {
    color: #dc3545;
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border: 1px solid #dc3545;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.btn-logout:hover {
    background-color: #dc3545;
    color: #fff;
}

/* Le conteneur principal centré pour la carte et le texte */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;        
    padding: 0 1rem 2rem 1rem; 
    box-sizing: border-box;
    gap: 1.5rem;
}

/* 1er bloc : La Carte */
.card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

h1 {
    color: #007bff;
    margin-top: 0;
}

/* 2ème bloc : Le contenu en dessous */
.content-below {
    width: 100%;
    text-align: left;
}

.content-below p {
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* STYLES EXCLUSIFS POUR MOBILES (< 768px) */
@media screen and (max-width: 768px) {
    /* La navbar passe en colonne : la ligne 1 = nav-header, la ligne 2 = nav-menu */
    .navbar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0 !important;
    }

    /* La ligne du haut occupe toute la largeur avec Home à gauche et Burger à droite */
    .nav-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    /* Affiche le bouton burger */
    .menu-toggle {
        display: block !important;
    }

    /* Le menu déroulant s'affiche en-dessous de la nav-header */
    .nav-menu {
        display: none !important;
        flex-direction: column !important;
        width: 100% !important;
        margin-top: 1rem;
        padding-top: 1rem;
        gap: 1rem;
        border-top: 1px solid #eee;
    }

    /* Quand le JS ajoute la classe .open sur .nav-menu */
    .nav-menu.open {
        display: flex !important;
    }

    .nav-links {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.5rem;
    }

    .nav-links a {
        display: block;
        text-align: center;
        padding: 0.8rem;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-user {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding-top: 0.5rem;
        gap: 0.8rem;
        align-items: center;
    }
}

/* Styles pour le tableau de tarifs */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tarifs-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.tarifs-table th {
    background-color: #007bff;
    color: #ffffff;
    font-weight: 600;
    padding: 0.8rem 1rem;
}

.tarifs-table th:first-child,
.tarifs-table td:first-child {
    text-align: left !important;
}

.tarifs-table th:last-child,
.tarifs-table td:last-child {
    text-align: right !important;
}

.tarifs-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.tarifs-table tbody tr:nth-child(odd) {
    background-color: #f1f5f9;
}

.tarifs-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e9ecef;
    color: #333333;
}

.tarifs-table tr:last-child td {
    border-bottom: none;
}

.tarifs-table tbody tr:hover {
    background-color: #e2e8f0;
}

.tarifs-table td i {
    color: #007bff;
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

/* Badge pour les tarifs gratuits */
.price-badge.free {
    background-color: #28a745;
    color: #ffffff;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.important {
    color: #dc3545;
}


h3 {
    color: #007bff;
    text-align: left;
    width: 100%;
    margin-top: 1.5rem;   
    margin-bottom: 0.2rem; 
}


#titre_checkout_departure {
    margin-bottom: 2rem;
}


h3 + p {
    margin-top: 0;
}

.instruction{
    width: 100%;
    text-align: left;
}

/* --- Menu Flottant (Sommaire) --- */
.floating-summary {
    position: fixed;
    top: 100px; /* Aligné par rapport au haut sous le header */
    left: 20px; /* Calé sur le bord gauche de l'écran */
    width: 220px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 100;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.floating-summary .summary-title {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #f0f4f9;
    padding-bottom: 0.4rem;
}

.floating-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.floating-summary li {
    margin-bottom: 0.4rem;
}

.floating-summary a {
    color: #495057;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s, padding-left 0.2s;
    display: block;
}

.floating-summary a:hover {
    color: #007bff;
    padding-left: 4px; /* Petit effet de glissement au survol */
}

/* Fluidité du défilement lors du clic sur l'ancre */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Évite que le header collant masque le titre après le saut */
}

/* menu flottant sur écran mobile/tablette */
@media screen and (max-width: 1200px) {
    .floating-summary {
        position: static;      /* Ne flotte plus sur les petits écrans */
        width: 100%;           /* Prend toute la largeur disponible */
        max-height: none;      /* S'agrandit pour afficher les liens */
        margin-bottom: 1.5rem; /* Espace avec le contenu du dessous */
        box-sizing: border-box;
    }
}

iframe {
    max-width: 100%;
    border-radius: 8px;
}

/* RESERVATIONS */

.form-reservation {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.input-calendar {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #fff;
    cursor: pointer;
}

.btn-reserver {
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reserver:hover {
    background-color: #0056b3;
}

.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

.alert-success { 
    background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; 
}

.alert-danger { 
    background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; 
}

.mes-sejours-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.mes-sejours-table th, .mes-sejours-table td {
    padding: 8px 5px;
    border-bottom: 1px solid #eee;
    text-align: center;
    white-space: nowrap;
}

.btn-annuler {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-annuler:hover { 
    background-color: #bd2130; 
}

/* --- Style pour le Panneau d'Administration & Calendrier --- */
.admin-container {
    max-width: 950px; /* Plus large que 500px pour offrir une meilleure lisibilité au calendrier */
    width: 100%;
}

.calendar-card {
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

#calendar {
    margin-top: 1.5rem;
    background-color: #ffffff;
    width: 100%;
}

/* Personnalisation des boutons et titres du calendrier */
.fc-toolbar-title {
    font-size: 1.25rem !important;
    color: #007bff;
}

.fc-button-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
}

.fc-button-primary:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}

/* Ajustements spécifiques pour Mobile du panel Admin (< 768px) */
@media screen and (max-width: 768px) {
    .calendar-card {
        padding: 1rem 0.5rem; /* Réduit l'interstice intérieur sur smartphone */
    }

    /* Empile la barre de navigation du calendrier (boutons / titre) pour les petits écrans */
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.8rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1.1rem !important;
        text-align: center;
    }

    .fc .fc-button {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem !important;
    }
}

/* MESSAGERIE */

.chat-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    width: 100%;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.2s;
}

.tab-btn.active {
    background: #007bff;
    color: #fff;
}

.chat-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #f8f9fa;
    margin-bottom: 1rem;
    text-align: left;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-message.me {
    align-self: flex-end;
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-message.others {
    align-self: flex-start;
    background-color: #ffffff;
    color: #333;
    border: 1px solid #dee2e6;
    border-bottom-left-radius: 2px;
}

.chat-header {
    font-size: 0.75rem;
    margin-bottom: 4px;
    opacity: 0.85;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
        
.btn-delete-msg {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-delete-msg:hover {
    opacity: 1;
    color: #ffc107; /* Couleur lors du survol sur mes messages bleus */
}

.chat-input-area {
    display: flex;
    gap: 10px;
    width: 100%;
}

.chat-input-area textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: none;
    height: 50px;
    font-family: inherit;
}

/* Pastille de notification générale */
.badge-notification {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Positionnement relatif pour les liens contenant la pastille dans la navbar */
.nav-links a {
    position: relative;
}

/* --- Responsivité pour la Messagerie sur Écran Mobile (< 768px) --- */
@media screen and (max-width: 768px) {
    /* Ajustement des marges internes de la carte globale */
    .admin-container .card {
        padding: 1rem 0.75rem;
    }

    /* Onglets Privé / Public adaptés aux écrans étroits */
    .chat-tabs {
        gap: 6px;
        margin-bottom: 1rem;
    }

    .tab-btn {
        padding: 8px 6px;
        font-size: 0.85rem;
    }

    /* Optimisation de la zone d'affichage des messages */
    .chat-box {
        padding: 0.75rem 0.5rem;
        max-height: 55vh; /* S'adapte mieux à la hauteur de l'écran mobile */
    }

    /* Élargissement des bulles de conversation pour libérer de l'espace de lecture */
    .chat-message {
        max-width: 90%;
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    /* Zone de saisie et bouton d'envoi */
    .chat-input-area {
        gap: 6px;
    }

    .chat-input-area textarea {
        height: 45px;
        padding: 8px;
        font-size: 0.9rem;
    }

    .chat-input-area .btn-reserver {
        padding: 0 15px !important;
        font-size: 0.9rem;
    }
}

/* --- GALERIE PHOTOS --- */

/* Sécurité pour empêcher tout débordement de la carte */
.main-container .card {
    overflow: hidden; 
}

.gallery-grid {
    display: grid;
    /* Crée des colonnes responsives d'au moins 200px */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.gallery-item {
    position: relative;
    width: 100%;
    /* Force un ratio fixe 4:3 (ou 16:9 si vous préférez) pour TOUTES les vignettes */
    aspect-ratio: 4 / 3; 
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    background-color: #f0f4f9;
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Normalisation stricte de l'image */
.gallery-item img {
    width: 100% !important;
    height: 100% !important;
    /* Recadre intelligemment l'image au centre sans la déformer */
    object-fit: cover !important; 
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

/* Effet au survol */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 123, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #ffffff;
    font-size: 1.5rem;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Adaptation Smartphone (< 768px) */
@media screen and (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.6rem;
    }
}

/* CHECKLIST */

.task-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.task-item {
    padding: 0;        
    margin-bottom: 0.8rem;    
    display: flex;
    align-items: flex-start;
    gap: 8px;              
}

.task-item label {
    margin: 0;
    font-size: 0.9em;      
    line-height: 1.4;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
}

.task-item input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
    flex-shrink: 0;             
    cursor: pointer;
}

.sejour-block {
    margin-bottom: 2rem;
    text-align: left;
}

.sejour-block .task-item label {
    white-space: normal;
}

.checklist-container {
    width: 100%;
    max-width: 500px;   
}

.checklist-container .card {
    width: 100%;
    text-align: left;       
}

/* checklist responsive : Adaptation aux téléphones (< 768px) */
@media screen and (max-width: 768px) {

    /* Réduit les marges internes de la carte (ex: de 2rem à 0.75rem sur les côtés) */
    .checklist-container .card {
        padding: 1.25rem 0.75rem; 
    }

    /* Optimise l'alignement et réduit l'espace entre la case et le texte */
    .task-item {
        gap: 6px; 
    }
}

#group_participants .form-group {
    margin-top: 1.2rem;
}

.urgence_contact {
    text-align: left;
}

.btn-accepter {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.btn-accepter:hover {
    background-color: #218838;
}

/* MENU DE L'ADMIN PANEL */
.admin-container ~ .floating-summary,
body:has(.admin-container) .floating-summary {
    left: 20px;
}

/* Sur tablettes et mobiles, le sommaire repasse au-dessus en bloc standard */
@media screen and (max-width: 1200px) {
    body:has(.admin-container) .floating-summary {
        position: static;
        width: 100%;
        margin-bottom: 1.5rem;
    }
}

.btn-documents {
    padding: 12px;
    margin: 12px auto;
    background-color: #6e59c2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.btn-documents:hover {
    background-color: #5232d1;
}

/* PAGE DECOUVERTES */
/* --- GRILLE & CARDS DECOUVERTES --- */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-item {
    padding: 0 !important;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover .card-item {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #f0f4f9;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.card-content {
    padding: 1.2rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-content .external-icon {
    font-size: 0.85rem;
    color: #007bff;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.card-link:hover .external-icon {
    opacity: 1;
}

.card-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

/* Responsivité Mobile (< 768px) */
@media screen and (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
