/* ============================================
   DATES.CSS - Calendrier des prix
   Harmonisé avec le thème G2T Corp (clair)
   Utilise les variables CSS de styles4.4.css
   ============================================ */

/* ---------- Conteneur principal ---------- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 28px;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- En-tête du mois ---------- */
.calendar-month-title {
    grid-column: span 7;
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    padding: 24px 0 16px 0;
    color: var(--text-primary, #0f172a);
    letter-spacing: -0.02em;
    position: relative;
}

.calendar-month-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary, #003580), var(--accent, #ff5a5f));
    border-radius: 4px;
}

/* ---------- Jours de la semaine ---------- */
.calendar-header {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary, #475569);
    text-align: center;
    padding: 10px 0 8px 0;
    background: var(--border-light, #f1f5f9);
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* ---------- Cellules des jours ---------- */
.calendar-day {
    background: var(--surface, #ffffff);
    border-radius: 14px;
    padding: 14px 6px;
    text-align: center;
    border: 2px solid var(--border-light, #eef2f6);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
}

.calendar-day:hover {
    border-color: var(--primary, #003580);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 53, 128, 0.15);
}

.calendar-day:active {
    transform: translateY(-2px) scale(0.98);
}

/* ---------- Jour actuel (aujourd'hui) ---------- */
.calendar-day.today {
    border-color: var(--primary, #003580);
    background: rgba(0, 53, 128, 0.06);
    box-shadow: 0 0 0 4px rgba(0, 53, 128, 0.08);
}

/* ---------- Week-end ---------- */
.calendar-day.weekend {
    background: var(--bg-primary, #fafbfc);
}

/* ---------- Jour sélectionné ---------- */
.calendar-day.selected {
    border-color: var(--accent, #ff5a5f);
    background: rgba(255, 90, 95, 0.08);
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(255, 90, 95, 0.18);
}

/* ---------- Numéro du jour ---------- */
.calendar-day .day-number {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary, #0f172a);
    line-height: 1.2;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.calendar-day:hover .day-number {
    color: var(--primary, #003580);
}

/* ---------- Prix du jour ---------- */
.calendar-day .day-price {
    font-weight: 800;
    font-size: 16px;
    color: var(--accent, #ff5a5f);
    margin-top: 2px;
    padding: 3px 10px;
    background: rgba(255, 90, 95, 0.08);
    border-radius: 20px;
    transition: all 0.25s;
    font-feature-settings: "tnum";
}

.calendar-day:hover .day-price {
    background: rgba(255, 90, 95, 0.15);
    transform: scale(1.06);
}

/* ---------- Pas de vol ---------- */
.calendar-day .day-no-flight {
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
    margin-top: 4px;
    font-weight: 500;
}

/* ---------- Légende ---------- */
.calendar-legend {
    margin-top: 24px;
    text-align: center;
    color: var(--text-secondary, #475569);
    font-size: 14px;
    padding: 14px 20px;
    background: var(--bg-primary, #f8fafc);
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.calendar-legend span::before {
    content: '💡';
    font-size: 16px;
}

/* ---------- Animation d'apparition ---------- */
.calendar-day {
    animation: fadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.calendar-day:nth-child(1)  { animation-delay: 0.02s; }
.calendar-day:nth-child(2)  { animation-delay: 0.04s; }
.calendar-day:nth-child(3)  { animation-delay: 0.06s; }
.calendar-day:nth-child(4)  { animation-delay: 0.08s; }
.calendar-day:nth-child(5)  { animation-delay: 0.10s; }
.calendar-day:nth-child(6)  { animation-delay: 0.12s; }
.calendar-day:nth-child(7)  { animation-delay: 0.14s; }
.calendar-day:nth-child(8)  { animation-delay: 0.16s; }
.calendar-day:nth-child(9)  { animation-delay: 0.18s; }
.calendar-day:nth-child(10) { animation-delay: 0.20s; }
.calendar-day:nth-child(11) { animation-delay: 0.22s; }
.calendar-day:nth-child(12) { animation-delay: 0.24s; }
.calendar-day:nth-child(13) { animation-delay: 0.26s; }
.calendar-day:nth-child(14) { animation-delay: 0.28s; }
.calendar-day:nth-child(15) { animation-delay: 0.30s; }
.calendar-day:nth-child(16) { animation-delay: 0.32s; }
.calendar-day:nth-child(17) { animation-delay: 0.34s; }
.calendar-day:nth-child(18) { animation-delay: 0.36s; }
.calendar-day:nth-child(19) { animation-delay: 0.38s; }
.calendar-day:nth-child(20) { animation-delay: 0.40s; }
.calendar-day:nth-child(21) { animation-delay: 0.42s; }
.calendar-day:nth-child(22) { animation-delay: 0.44s; }
.calendar-day:nth-child(23) { animation-delay: 0.46s; }
.calendar-day:nth-child(24) { animation-delay: 0.48s; }
.calendar-day:nth-child(25) { animation-delay: 0.50s; }
.calendar-day:nth-child(26) { animation-delay: 0.52s; }
.calendar-day:nth-child(27) { animation-delay: 0.54s; }
.calendar-day:nth-child(28) { animation-delay: 0.56s; }
.calendar-day:nth-child(29) { animation-delay: 0.58s; }
.calendar-day:nth-child(30) { animation-delay: 0.60s; }
.calendar-day:nth-child(31) { animation-delay: 0.62s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Prix bas / haut ---------- */
.calendar-day .day-price.lowest {
    color: var(--success, #10b981);
    background: rgba(16, 185, 129, 0.12);
}

.calendar-day .day-price.highest {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

/* ---------- Tooltip au survol ---------- */
.calendar-day[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    background: var(--text-primary, #0f172a);
    color: white;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.calendar-day:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 6px;
        padding: 0 4px;
    }
    .calendar-day {
        min-height: 72px;
        padding: 10px 4px;
        border-radius: 10px;
    }
    .calendar-day .day-number {
        font-size: 17px;
    }
    .calendar-day .day-price {
        font-size: 14px;
        padding: 2px 8px;
    }
    .calendar-header {
        font-size: 11px;
        padding: 8px 0;
        border-radius: 8px;
    }
    .calendar-month-title {
        font-size: 22px;
        padding: 18px 0 12px 0;
    }
    .calendar-month-title::after {
        width: 48px;
    }
    .calendar-legend {
        font-size: 13px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .calendar-grid {
        gap: 4px;
    }
    .calendar-day {
        min-height: 58px;
        padding: 6px 2px;
        border-radius: 8px;
        border-width: 1.5px;
    }
    .calendar-day .day-number {
        font-size: 15px;
    }
    .calendar-day .day-price {
        font-size: 11px;
        padding: 1px 6px;
    }
    .calendar-day .day-no-flight {
        font-size: 11px;
    }
    .calendar-header {
        font-size: 9px;
        padding: 5px 0;
        border-radius: 6px;
    }
    .calendar-month-title {
        font-size: 18px;
        padding: 14px 0 10px 0;
    }
    .calendar-month-title::after {
        width: 36px;
        height: 3px;
    }
    .calendar-legend {
        font-size: 12px;
        padding: 10px 12px;
    }
    .calendar-day[data-tooltip]::after {
        font-size: 10px;
        padding: 3px 10px;
        bottom: calc(100% + 6px);
    }
}