/* ==========================================
   CALENDARFP - VERSION MODERNE
   ========================================== */

.cal_wrapper {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #374151;
    max-width: 1400px;
    margin: 2rem auto;
}

.cal_wrapper li {
    list-style: none;
}

/* ==========================================
   CONTENEURS
   ========================================== */

.the_months {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.clear {
    clear: both;
}

.img_loading_month {
    margin: 50px;
}

/* ==========================================
   BOUTONS DE NAVIGATION
   ========================================== */

.cal_controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.cal_prev,
.cal_next,
.cal_admin {
    float: none !important;
    margin: 0 !important;
}

.cal_controls a,
.cal_controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .9rem;
    border-radius: 8px;
    text-decoration: none;
    background: #2563eb;
    color: white;
    transition: all .2s ease;
}

.cal_controls a:hover,
.cal_controls button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* ==========================================
   MOIS
   ========================================== */

.cal_month {
    width: 280px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    overflow: hidden;
    margin: 0;
    min-height: auto;
    border: 1px solid #e5e7eb;
}

.cal_month .cal_title {
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: .9rem;
    border: none;
}

/* ==========================================
   GRILLE DES JOURS
   ========================================== */

.cal_month ul {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin: 0;
    padding: 0.75rem !important;
    width: auto;
}

.cal_month ul li {
    width: auto;
    height: 36px;
    line-height: 36px;
    margin: 0;
    text-align: center;
    border-radius: 8px;
    border: none;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.85rem;
    transition: all .2s ease;
}

.cal_month ul li:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
}

/* ==========================================
   JOURS DE LA SEMAINE
   ========================================== */

.cal_month ul.cal_weekday li {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

/* ==========================================
   CASES VIDES
   ========================================== */

.cal_month ul li.cal_empty {
    background: transparent;
    color: #d1d5db;
}

/* ==========================================
   ÉTATS DE RÉSERVATION
   ========================================== */

/* Réservé */
.cal_month ul li.booked {
    background: #ef4444;
    color: white;
}

/* Réservation provisoire */
.cal_month ul li.booked_pr {
    background: #f59e0b;
    color: white;
}

/* Offre spéciale */
.cal_month ul li.offer {
    background: #10b981;
    color: white;
}

/* Changement */
.cal_month ul li.changeover {
    background: #8b5cf6;
    color: white;
}

/* ==========================================
   DEMI-JOURNÉES
   ========================================== */

.cal_month ul li.booked_am {
    background: linear-gradient(
        to right,
        #ef4444 50%,
        #f3f4f6 50%
    );
}

.cal_month ul li.booked_pm {
    background: linear-gradient(
        to right,
        #f3f4f6 50%,
        #ef4444 50%
    );
}

.cal_month ul li.booked_pr_am {
    background: linear-gradient(
        to right,
        #f59e0b 50%,
        #f3f4f6 50%
    );
}

.cal_month ul li.booked_pr_pm {
    background: linear-gradient(
        to right,
        #f3f4f6 50%,
        #f59e0b 50%
    );
}

/* ==========================================
   WEEK-ENDS
   ========================================== */

.cal_month ul li.weekend {
    background: #ecfeff;
}

/* ==========================================
   AUJOURD'HUI
   ========================================== */

.cal_month ul li.today {
    border: 2px solid #2563eb;
    font-weight: 700;
}

/* ==========================================
   NUMÉROS DE SEMAINE
   ========================================== */

.cal_month ul li.weeknum_spacer {
    width: auto;
    background: transparent;
    border: none;
}

.cal_month ul li.weeknum {
    background: #cbd5e1;
    color: #475569;
    font-size: 0.7rem;
}

/* ==========================================
   LÉGENDE
   ========================================== */

.key_wrapper {
    vertical-align: top;
}

#key {
    width: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

#key ul {
    margin: 0;
    padding: 1rem;
}

#key ul li {
    display: flex;
    align-items: center;
    margin-bottom: .75rem;
}

#key ul li span {
    margin-left: .75rem;
    width: auto;
}

#key #footer_data {
    font-size: .8rem;
    padding: 1rem;
    color: #6b7280;
}

/* ==========================================
   TOOLTIPS
   ========================================== */

.tips {
    background: #111827;
    color: white;
    padding: .75rem;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {

    .the_months {
        justify-content: center;
    }

    .cal_month {
        width: 100%;
        max-width: 380px;
    }

    #key {
        width: 100%;
        max-width: 380px;
        margin-top: 1rem;
    }
}