/* ============================================
   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 CALENDRIER ---------- */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 4px;
        padding: 0 4px;
    }
    .calendar-day {
        min-height: 60px;
        padding: 6px 2px;
        border-radius: 8px;
    }
    .calendar-day .day-number {
        font-size: 14px;
    }
    .calendar-day .day-price {
        font-size: 11px;
        padding: 2px 6px;
    }
    .calendar-day .day-price small {
        font-size: 8px !important;
    }
    .calendar-header {
        font-size: 10px;
        padding: 4px 0;
        border-radius: 6px;
    }
    .calendar-month-title {
        font-size: 18px;
        padding: 16px 0 10px 0;
    }
    .calendar-month-title::after {
        width: 40px;
        height: 3px;
    }
}

@media (max-width: 480px) {
    .calendar-grid {
        gap: 2px;
        padding: 0 2px;
    }
    .calendar-day {
        min-height: 48px;
        padding: 4px 1px;
        border-radius: 4px;
        border-width: 1px;
    }
    .calendar-day .day-number {
        font-size: 12px;
    }
    .calendar-day .day-price {
        font-size: 9px;
        padding: 1px 4px;
    }
    .calendar-day .day-price small {
        font-size: 7px !important;
        margin-top: 0 !important;
    }
    .calendar-day .day-no-flight {
        font-size: 9px;
    }
    .calendar-header {
        font-size: 8px;
        padding: 2px 0;
        border-radius: 4px;
    }
    .calendar-month-title {
        font-size: 15px;
        padding: 12px 0 8px 0;
    }
    .calendar-month-title::after {
        width: 32px;
        height: 2px;
    }
    .calendar-legend {
        font-size: 11px;
        padding: 8px 12px;
    }
}

@media (max-width: 360px) {
    .calendar-grid {
        gap: 1px;
        padding: 0 1px;
    }
    .calendar-day {
        min-height: 38px;
        padding: 2px 0;
        border-radius: 3px;
    }
    .calendar-day .day-number {
        font-size: 10px;
    }
    .calendar-day .day-price {
        font-size: 7px;
        padding: 0 2px;
    }
    .calendar-day .day-price small {
        font-size: 6px !important;
        display: none; /* Cacher les sous-titres sur très petits écrans */
    }
    .calendar-header {
        font-size: 7px;
        padding: 1px 0;
    }
    .calendar-month-title {
        font-size: 13px;
        padding: 8px 0 4px 0;
    }
}

/* ============================================
   LAY-BUY TICKET - STYLES MODERNES
   ============================================ */

/* --- Conteneur des cartes --- */
#laybuy-list {
    padding: 10px 0;
}

.laybuy-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Carte individuelle --- */
.laybuy-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f7;
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 20px 24px;
}

.laybuy-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #003580;
}

/* --- Header de la carte --- */
.laybuy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.flight-route {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.origin-code,
.destination-code {
    font-size: 24px;
    font-weight: 900;
    color: #003580;
    letter-spacing: 0.5px;
}

.route-arrow {
    font-size: 20px;
    color: #ff5a5f;
}

.route-city {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    margin-left: 4px;
}

.status-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-overdue {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Corps de la carte --- */
.laybuy-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flight-info-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #475569;
}

.flight-airline {
    font-weight: 700;
    color: #0f1a2a;
}

.flight-number {
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.flight-date {
    color: #64748b;
}

.passenger-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #0f1a2a;
    font-weight: 500;
}

.roundtrip-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* --- Informations de prix --- */
.price-info {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid #eef2f7;
}

.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #475569;
}

.price-row .price-label {
    font-weight: 500;
}

.price-row .price-value {
    font-weight: 700;
    color: #0f1a2a;
}

.price-row.penalty .price-value {
    color: #e74c3c;
}

.price-row.total-due {
    border-top: 2px solid #e2e8f0;
    padding-top: 8px;
    margin-top: 4px;
}

.price-row.total-due .price-label {
    font-weight: 700;
    color: #0f1a2a;
}

.price-row.total-due .price-value {
    font-size: 18px;
    color: #003580;
}

/* --- Date d'échéance --- */
.deadline-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 8px;
}

.deadline-label {
    font-weight: 600;
    color: #64748b;
}

.deadline-date {
    font-weight: 600;
    color: #0f1a2a;
}

.days-left {
    font-weight: 700;
    color: #003580;
    padding: 2px 12px;
    border-radius: 12px;
    background: #e0f2fe;
}

.days-left.overdue {
    color: #e74c3c;
    background: #fee2e2;
}

/* --- Footer de la carte --- */
.laybuy-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
    display: flex;
    justify-content: flex-end;
}

.laybuy-footer .btn {
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pay-balance-btn {
    background: linear-gradient(135deg, #003580, #0057b8);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 53, 128, 0.25);
}

.pay-balance-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 53, 128, 0.35);
}

.download-pdf-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.download-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}


/* --- Pagination --- */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding: 16px 0;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    padding: 8px 16px;
    border-radius: 40px;
    border: 1px solid #e2e8f0;
}

.pagination-btn {
    padding: 8px 18px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 14px;
    color: #0f1a2a;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #003580;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

/* --- Animation de transition de page --- */
#laybuy-list.page-transition .laybuy-card {
    animation: fadeSlideUp 0.4s ease forwards;
}

#laybuy-list.page-transition .laybuy-card:nth-child(1) { animation-delay: 0.05s; }
#laybuy-list.page-transition .laybuy-card:nth-child(2) { animation-delay: 0.1s; }
#laybuy-list.page-transition .laybuy-card:nth-child(3) { animation-delay: 0.15s; }
#laybuy-list.page-transition .laybuy-card:nth-child(4) { animation-delay: 0.2s; }
#laybuy-list.page-transition .laybuy-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Styles pour le modal de modification de vol*/
#change-form-container .field {
    margin-bottom: 16px;
}
#change-form-container .row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
#change-form-container .row .field {
    flex: 1;
    min-width: 180px;
}
.change-offer-item {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.change-offer-item:hover {
    border-color: #003580;
}
.change-offer-item.selected {
    border-color: #003580;
    background-color: #f0f7ff;
}
.change-offer-item .price {
    font-weight: 700;
    font-size: 18px;
    color: #003580;
}
.change-offer-item .details {
    font-size: 14px;
    color: #475569;
}

.change-offers-pagination button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.change-offers-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.change-offers-pagination span {
    font-size: 14px;
    color: var(--text-secondary);
}

/* --- Modal de paiement --- */
.payment-modal-content {
    max-width: 480px;
}

.payment-amount-display {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    margin-bottom: 20px;
}

.payment-amount-display .amount-label {
    display: block;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.payment-amount-display .amount-value {
    display: block;
    font-size: 28px;
    font-weight: 900;
    color: #003580;
    margin-top: 4px;
}

/* Méthodes de paiement (style checkout) */
#payment-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#payment-methods .payment-method {
    flex: 1;
    min-width: 120px;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

#payment-methods .payment-method:hover {
    border-color: #003580;
    transform: translateY(-2px);
}

#payment-methods .payment-method.active {
    border-color: #003580;
    background: #f0f9ff;
    box-shadow: 0 4px 12px rgba(0, 53, 128, 0.1);
}

#payment-methods .payment-method img {
    height: 32px;
    width: auto;
    display: block;
    margin: 0 auto 6px;
}

#payment-methods .payment-method .payment-icons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

#payment-methods .payment-method .payment-icons img {
    height: 28px;
    width: auto;
}

#payment-methods .payment-method .method-name {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: #0f1a2a;
}

#payment-methods .payment-method .method-desc {
    display: block;
    font-size: 11px;
    color: #94a3b8;
}

/* Détails du paiement */
.payment-details {
    padding: 16px 0;
    border-top: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.payment-details .form-group {
    margin-bottom: 14px;
}

.payment-details .form-group label {
    font-weight: 600;
    font-size: 13px;
    color: #0f1a2a;
    display: block;
    margin-bottom: 4px;
}

.payment-details .form-group .required {
    color: #e74c3c;
}

.payment-details .form-group select,
.payment-details .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: white;
}

.payment-details .form-group select:focus,
.payment-details .form-group input:focus {
    outline: none;
    border-color: #003580;
    box-shadow: 0 0 0 3px rgba(0, 53, 128, 0.1);
}

.payment-details .form-group small {
    font-size: 12px;
    color: #94a3b8;
    display: block;
    margin-top: 4px;
}

#payment-error {
    color: #e74c3c;
    font-size: 14px;
    padding: 8px 12px;
    background: #fee2e2;
    border-radius: 8px;
    margin-bottom: 12px;
}
