/* ==========================================================================
   1. STRUCTURE GÉNÉRALE
   ========================================================================== */

#cdp-main-container {
    max-width: 1200px;
    margin: 30px auto;
    font-family: inherit;
    transition: opacity 0.3s ease;
    touch-action: pan-y;
}

/* ==========================================================================
   2. NAVIGATION STICKY
   ========================================================================== */

.cdp-global-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #ffffff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 9999;
    margin-bottom: 40px;
}

.cdp-ajax-nav {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    background: #2c3e50;
    color: white;
    transition: all 0.2s ease;
}

.cdp-ajax-nav:hover {
    background: #34495e;
    transform: translateY(-1px);
}

.btn-today {
    background: #e67e22;
}

/* ==========================================================================
   3. CALENDRIERS ET GRILLE
   ========================================================================== */

.cdp-logement-title {
    text-align: center;
    margin: 60px 0 30px;
    font-size: 1.8em;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.cdp-triple-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

.cdp-month-header {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    position: relative; /* Nécessaire pour positionner l'animation */
}

.cdp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cdp-day-name {
    text-align: center;
    font-weight: bold;
    font-size: 0.85em;
    padding-bottom: 8px;
    color: #555;
}

.cdp-day {
    min-height: 55px;
    padding: 6px;
    border-radius: 4px;
    text-align: right;
    font-size: 0.9em;
    color: #fff;
}

/* COULEURS */
.cdp-day.available { background: #2ecc71; }
.cdp-day.reserved  { background: #e74c3c; }
.cdp-day.is-past   { background: #e0e0e0 !important; color: #888 !important; }
.cdp-day.is-today  { outline: 3px solid #000; }
.cdp-day.empty     { background: transparent; }

/* ==========================================================================
   4. RESPONSIVE & ANIMATION TACTILE
   ========================================================================== */

@media (max-width: 1024px) {
    .cdp-triple-wrapper { grid-template-columns: repeat(2, 1fr); }
    .m3 { display: none !important; }
}

@media (max-width: 767px) {
    .btn-prev, .btn-next { display: none !important; }
    .cdp-triple-wrapper { grid-template-columns: 1fr; }
    .m2, .m3 { display: none !important; }

    /* L'onde d'impact (Le point de contact) */
    .cdp-month-header::before {
        content: "";
        position: absolute;
        top: 110%; /* Placé sous le nom du mois */
        left: 50%;
        width: 20px;
        height: 20px;
        background: rgba(230, 126, 34, 0.3);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
        animation: touchRipple 3s ease-in-out infinite;
    }

    /* Le doigt (L'indicateur de mouvement) */
    .cdp-month-header::after {
        content: "☝️";
        position: absolute;
        top: 110%;
        left: 50%;
        font-size: 1.4em;
        pointer-events: none;
        animation: touchSwipe 3s ease-in-out infinite;
    }

    /* Animation de l'onde */
    @keyframes touchRipple {
        0%, 10% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
        15% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
        25% { transform: translate(30px, -50%) scale(1); opacity: 0.5; }
        50% { transform: translate(-30px, -50%) scale(1); opacity: 0.5; }
        75%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
    }

    /* Animation du doigt en Ping-Pong */
    @keyframes touchSwipe {
        0%, 10% { transform: translate(-50%, 0) scale(1.2); opacity: 0; }
        15% { transform: translate(-50%, 0) scale(1.2); opacity: 1; }
        35% { transform: translate(30px, 0) scale(1); opacity: 1; }
        60% { transform: translate(-30px, 0) scale(1); opacity: 1; }
        80% { transform: translate(-50%, 0) scale(1.2); opacity: 1; }
        100% { transform: translate(-50%, 0) scale(1); opacity: 0; }
    }
}