/**
 * Module "Quand" - Styles dédiés
 * Gestion de la sélection de dates (début, fin, raccourcis)
 */

/* ===== DROPDOWN QUAND ===== */

#quand-dropdown {
    min-width: 320px;
}

#quand-dropdown .dropdown-content {
    padding: 1rem;
}

/* ===== BOUTONS DATES RAPIDES ===== */

.quick-dates {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.quick-date-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.6rem 1rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.quick-date-btn i {
    font-size: 0.9rem;
    color: #2c3e50;
}

.quick-date-btn:hover {
    border-color: #2c3e50;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    color: #2c3e50;
}

.quick-date-btn.active {
    border-color: #2c3e50;
    background: #2c3e50;
    color: white;
}

.quick-date-btn.active i {
    color: white;
}

/* ===== INPUTS DE DATES ===== */

.date-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.date-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.date-field label i {
    color: #2c3e50;
    font-size: 0.9rem;
}

.date-field input[type="date"] {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #333;
    background: white;
    transition: all 0.2s ease;
}

.date-field input[type="date"]:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-field input[type="date"]:hover {
    border-color: #b0b0b0;
}

/* Placeholder style pour les dates */
.date-field input[type="date"]::-webkit-datetime-edit-text,
.date-field input[type="date"]::-webkit-datetime-edit-month-field,
.date-field input[type="date"]::-webkit-datetime-edit-day-field,
.date-field input[type="date"]::-webkit-datetime-edit-year-field {
    color: #333;
}

.date-field input[type="date"]:invalid::-webkit-datetime-edit {
    color: #999;
}

/* Icône calendrier personnalisée */
.date-field input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.date-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* ===== SÉPARATEUR VISUEL ===== */

.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.8rem;
    margin: 0.25rem 0;
}

.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
    margin: 0 0.75rem;
}

/* ===== AFFICHAGE DURÉE ===== */

.date-duration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 8px;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #2c3e50;
    font-weight: 500;
}

.date-duration i {
    font-size: 0.9rem;
}

.date-duration .nights {
    font-weight: 700;
}

/* ===== BOUTON APPLIQUER ===== */

.quand-apply-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.quand-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===== ÉTAT AVEC SÉLECTION ===== */

#quand-btn.has-selection {
    border-color: #2c3e50;
    background: linear-gradient(to right, #f0f4ff 0%, #ffffff 100%);
}

#quand-btn.has-selection span {
    color: #2c3e50;
    font-weight: 600;
}

#quand-selector.has-selection .search-label {
    color: #2c3e50;
}

/* ===== PRESETS DE DATES (optionnel) ===== */

.date-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.date-preset {
    padding: 0.5rem 0.75rem;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.date-preset:hover {
    border-color: #2c3e50;
    background: #f0f4ff;
    color: #2c3e50;
}

.date-preset.active {
    border-color: #2c3e50;
    background: #2c3e50;
    color: white;
}

/* ===== MESSAGE D'ERREUR ===== */

.date-error {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #c62828;
}

.date-error i {
    font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    #quand-dropdown {
        min-width: 100%;
    }

    .quick-dates {
        flex-direction: column;
    }

    .quick-date-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .date-field input[type="date"] {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }

    .date-presets {
        grid-template-columns: 1fr;
    }
}

/* ===== MODE INLINE (pour recherche_sejour) ===== */

.quand-inline {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.quand-inline .date-field {
    flex: 1;
}

@media (max-width: 768px) {
    .quand-inline {
        flex-direction: column;
        gap: 0.75rem;
    }
}
