body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f4f9;
}

h1 {
    color: #333;
}

h4 {
    color: #581cd0;
    text-align: center;
}

.calendar-container {
    /* Styles pour écrans larges (Desktop/Tablette) */
    display: grid;
    grid-template-columns: 120px repeat(7, 1fr);
    border: 1px solid #ccc;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.header-cell,
.time-cell,
.day-cell {
    padding: 10px;
    border: 1px solid #eee;
    text-align: center;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Style de l'en-tête (jours) */
.header-cell {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    border-color: #0056b3;
    justify-content: center;
}

/* Style de la colonne d'heure */
.time-cell {
    background-color: #f0f0f0;
    font-weight: bold;
    padding-right: 5px;
    padding-left: 5px;
    justify-content: center;
    font-size: 0.9em;
    color: #555;
}

/* Style des cases de rendez-vous */
.day-cell {
    background-color: #ffffff;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s;
}

/* --- Mode Lecture Seule --- */
body.readonly-mode .day-cell {
    cursor: default;
}

body.readonly-mode .day-cell:hover {
    background-color: #ffffff !important;
}

.reserved {
    background-color: #1e8449 !important;
    color: white !important;
}



.current-day-header {
    background-color: #dc184d !important;
}

/* --- Séparation Pause Déjeuner --- */
.break-separator {
    background-color: #ffcc00;
    color: #333;
    font-weight: bold;
    font-style: italic;
    height: 20px;
    padding: 2px 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 2px solid #e0b300;
    border-bottom: 2px solid #e0b300;
}

/* --- Séparation des semaines (Bouton de mode) --- */
.week-separator {
    width: 100%;
    height: 50px;
    margin: 30px 0;
    background-color: transparent;
    /* Suppression du fond blanc */
    text-align: center;
    line-height: 50px;
    font-size: 1.2em;
    font-weight: bold;
    color: #666;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    display: flex;
    /* Ajout pour centrer le contenu */
    justify-content: center;
    align-items: center;
}

#session-end-button {
    padding: 10px 20px;
    background-color: #dc3545;
    /* Couleur d'alerte/déconnexion */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    /* Important pour les liens */
    transition: background-color 0.2s;
    display: inline-block;
    /* S'assure que le padding fonctionne */
    line-height: normal;
    /* Annule l'effet du line-height du conteneur parent */
}

#session-end-button:hover {
    background-color: #c82333;
}


/* --- Styles Modales (inchangés) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.choice-list button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.choice-list button:hover {
    background-color: #0056b3;
}

#delete-modal button {
    padding: 10px 15px;
    margin: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#confirm-delete {
    background-color: #dc3545;
    color: white;
}

#cancel-delete {
    background-color: #f0f0f0;
    color: #333;
}


/* ########################################## */
/* MEDIA QUERIES pour les smartphones (< 768px) */
/* ########################################## */
@media (max-width: 768px) {

    body {
        margin: 10px;
        /* Réduire les marges générales */
    }

    .calendar-container {
        /* Permettre le défilement horizontal */
        overflow-x: auto;

        /* La grille doit toujours exister mais avec une largeur gérable */
        display: grid;
        grid-template-columns: 80px repeat(7, 100px);
        /* 80px pour heure, 100px pour chaque jour */
        width: max-content;
        /* Permettre au contenu de définir la largeur (pour le scroll) */
        min-width: 350px;
        /* S'assurer d'une largeur minimale */
    }

    .break-separator {
        grid-column: 1 / span 8;
        /* Doit toujours s'étendre sur les 8 colonnes */
    }

    /* Ajustement des en-têtes de jours pour qu'ils soient de 100px de large */
    .calendar-container .header-cell {
        min-width: 100px;
        padding: 5px;
    }

    /* La colonne des heures doit rester fixe (sticky) */
    .time-cell {
        position: sticky;
        /* Rendre la colonne des heures fixe */
        left: 0;
        z-index: 2;
        /* Assurer qu'elle est au-dessus des jours qui défilent */
        background-color: #f0f0f0;
        min-width: 80px;
    }

    /* Rendre les cellules de jour scrollables */
    .day-cell {
        min-width: 100px;
    }
}