@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* --- Règle globale pour un layout prédictible --- */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #079bb2;
    --secondary-color: #612E0F;
    --light-gray: #f0f2f5;
    --text-color: #333;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(45deg, #aeeff9, #079bb2);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-color);
    display: flex;
    flex-direction: column; /* <--- LIGNE À AJOUTER */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
}

/* --- Style en-tête avec logo --- */
.main-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Espace entre le logo et le titre */
    margin-bottom: 30px; /* Marge en dessous du titre */
}

.header-logo {
    height: 50px; /* Ajustez la hauteur du logo selon vos besoins */
    width: auto;  /* La largeur s'adaptera automatiquement */
}

/* On ajuste la marge du h1 car elle est maintenant gérée par le conteneur */
.main-header h1 {
    margin: 0;
    text-align: center;
    color: #4a5568;
}


.booking-wrapper {
    display: flex;
    flex-wrap: wrap; 
    max-width: 900px;
    width: 100%;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* --- Conteneur du Calendrier (gauche) --- */
.calendar-container {
    flex: 1;
    min-width: 300px; /* Largeur minimale pour les grands écrans */
    padding: 25px;
    border-right: 1px solid var(--border-color);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--secondary-color);
}
.calendar-header button {
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 8px;
}
.calendar-header button:hover {
    background-color: var(--light-gray);
}

.calendar-weekdays, .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: center;
    gap: 5px;
}

.calendar-weekdays {
    font-weight: 500;
    color: #999;
    margin-bottom: 10px;
}

.calendar-day {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    border-radius: 50%;
    cursor: default;
    color: #ccc; 
}
.current-month {
    color: var(--text-color);
}
.has-slots {
    cursor: pointer;
    font-weight: 700;
    background-color: #eaf8fa; 
    color: var(--primary-color);
}
.has-slots:hover {
    background-color: #d1f0f5;
}
.today {
    border: 2px solid var(--primary-color);
}
.selected {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* --- Conteneur des Créneaux (droite) --- */
.slots-container {
    flex: 1;
    min-width: 300px;
    padding: 25px;
}
#slots-header {
    text-align: center;
    font-size: 1.2em;
    font-weight: 500;
    margin-bottom: 20px;
    min-height: 2em;
}
#slots-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}
.slot-button {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
}
.slot-button:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #fff;
}

/* --- Responsive pour les petits écrans --- */
@media (max-width: 768px) {
    .booking-wrapper {
        flex-direction: column;
        align-items: center;
        min-width: 0; 
    }

    .calendar-container, .slots-container {
       border-right: none;
       width: 100%;
       /* LA CORRECTION QUI ANNULE LA LARGEUR MINIMALE SUR MOBILE */
       min-width: 0; 
    }

    .calendar-container {
        border-bottom: 1px solid var(--border-color);
    }
}