/* ============================================================================
   HOTEL SEARCH - ENHANCED DESIGN 2025
   Amélioration esthétique du moteur de recherche d'hôtel
   ============================================================================ */

/* --------------------------------------------------------------------------
   1. SECTION PRINCIPALE DE RECHERCHE
   -------------------------------------------------------------------------- */

#hotel-search {
    background: url("../img/hotel-search-background-EAMz0q9.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    padding: 3rem 0 4rem 0;
    position: relative;
    min-height: 500px;
}

/* Overlay pour améliorer la lisibilité */
#hotel-search::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.5) 0%, rgba(233, 236, 239, 0.6) 100%);
    z-index: 0;
}

#hotel-search > .container {
    position: relative;
    z-index: 1;
}

/* Titre principal */
#hotel-search h1 {
    color: var(--bs-primary);
    font-weight: 700;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------------------------------------
   2. CONTENEUR DU FORMULAIRE - DESIGN MODERNE
   -------------------------------------------------------------------------- */

#hotel-form .bg-white {
    /* Glassmorphism effect */
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* Ombres élégantes multicouches */
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    /* Coins arrondis élégants */
    border-radius: 24px !important;

    /* Bordure subtile */
    border: 1px solid rgba(255, 255, 255, 0.9);

    /* Padding optimisé */
    padding: 2.5rem !important;

    /* Transition fluide */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Effet de hover désactivé pour le formulaire */
#hotel-form .bg-white:hover {
    transform: none;
}

/* --------------------------------------------------------------------------
   3. LABELS ET TYPOGRAPHIE
   -------------------------------------------------------------------------- */

/* Labels principaux du formulaire */
#hotel-search .form-label {
    color: var(--bs-dark);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    letter-spacing: 0.3px;
    display: block;
    transition: color 0.2s ease;
}

#hotel-search .form-text {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   4. INPUTS ET CHAMPS DE SAISIE
   -------------------------------------------------------------------------- */

#hotel-search .form-control,
#hotel-search .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    font-weight: 500;
}

#hotel-search .form-control:hover,
#hotel-search .form-select:hover {
    border-color: var(--bs-secondary);
    /* Effet de déplacement supprimé */
}

#hotel-search .form-control:focus,
#hotel-search .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow:
        0 0 0 4px rgba(244, 103, 50, 0.12),
        0 4px 12px rgba(244, 103, 50, 0.2);
    outline: none;
    background-color: #fff;
}

/* Placeholder amélioré */
#hotel-search .form-control::placeholder {
    color: #adb5bd;
    font-style: italic;
    opacity: 0.8;
}

#hotel-search .form-control[readonly] {
    background-color: #fff;
    cursor: pointer;
}

#hotel-search .form-control[readonly]:hover {
    border-color: var(--bs-info);
}

/* --------------------------------------------------------------------------
   5. AUTOCOMPLETE / SUGGESTIONS DE DESTINATION
   -------------------------------------------------------------------------- */

#hotel-search .list-group {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--bs-secondary);
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease;
    background-color: #ffffff !important;
    z-index: 1050 !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hotel-search .list-group-item {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.9rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff !important;
}

#hotel-search .list-group-item:last-child {
    border-bottom: none;
}

#hotel-search .list-group-item:hover {
    background-color: rgba(244, 103, 50, 0.08);
    padding-left: 1.5rem;
    color: var(--bs-primary);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   6. SECTION CHAMBRES ET VOYAGEURS
   -------------------------------------------------------------------------- */

/* Conteneur principal */
#hotel-search .border.rounded {
    border: 2px solid #e9ecef !important;
    border-radius: 16px !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s ease;
    padding: 1.5rem !important;
}

#hotel-search .border.rounded:hover {
    border-color: var(--bs-secondary) !important;
    box-shadow: 0 6px 16px rgba(112, 203, 210, 0.15);
}

/* Header de la section */
#hotel-search .border.rounded > div:first-child {
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #f0f0f0;
}

/* Configuration de chambre */
.room-config {
    padding: 1.25rem;
    border-radius: 12px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

/* Row pour adultes, enfants et âges - layout dynamique */
.room-travelers-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

/* Par défaut (0 enfant): 2 colonnes - adults et children à 50% chacun */
.col-adults,
.col-children {
    flex: 1;
}

/* Masquer la colonne des âges quand elle est vide */
.col-ages:empty,
.col-ages:has(.ages-wrapper:empty) {
    display: none;
}

/* Quand la colonne des âges contient du contenu: basculer en 3 colonnes */
.col-ages:has(.ages-wrapper:not(:empty)) {
    display: block;
    flex: 1;
}

/* Container des âges - selects empilés verticalement */
.ages-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Chaque sélecteur d'âge prend toute la largeur */
.ages-wrapper > div {
    width: 100%;
}

.room-config:hover {
    border-color: var(--bs-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Titre de chambre */
.room-config h6 {
    color: var(--bs-primary);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Bouton ajouter une chambre */
#hotel-search .btn-outline-primary {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-width: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#hotel-search .btn-outline-primary:hover {
    box-shadow: 0 4px 12px rgba(244, 103, 50, 0.25);
}

/* Bouton supprimer une chambre */
#hotel-search .btn-outline-danger {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-width: 2px;
    transition: all 0.2s ease;
}

#hotel-search .btn-outline-danger:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

/* Labels dans les chambres (plus petits que les labels principaux) */
.room-config .form-label {
    font-size: 0.85rem !important;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.4rem;
}

/* Labels spécifiques dans les colonnes adultes/enfants */
.col-adults .form-label,
.col-children .form-label {
    font-size: 0.85rem !important;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.4rem;
}

/* Selects dans les chambres */
.room-config .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: #fff;
}

.room-config .form-select:hover {
    border-color: var(--bs-secondary);
    box-shadow: 0 2px 8px rgba(112, 203, 210, 0.1);
}

.room-config .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(244, 103, 50, 0.1);
}

/* Container des âges d'enfants - déjà géré au-dessus */

/* Labels pour les âges d'enfants */
[data-hotel--children-target="agesContainer"] .form-label {
    font-size: 0.85rem;
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.4rem;
    white-space: nowrap;
}

/* Selects pour les âges */
[data-hotel--children-target="agesContainer"] .form-select {
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    width: 100%;
}

/* Header "Configurez vos chambres" */
#hotel-search .border.rounded > div:first-child span {
    font-size: 1.05rem;
}

/* Texte d'information en bas */
#hotel-search .border.rounded small.form-text {
    font-size: 0.95rem;
    display: block;
    margin-top: 1rem;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   7. BOUTON PRINCIPAL DE RECHERCHE
   -------------------------------------------------------------------------- */

#hotel-search .btn-primary.btn-lg {
    padding: 1rem 3.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 16px rgba(244, 103, 50, 0.35);
    border: 2px solid var(--bs-primary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #ff7645 100%);
}

#hotel-search .btn-primary.btn-lg:hover {
    box-shadow: 0 10px 24px rgba(244, 103, 50, 0.45);
    background: linear-gradient(135deg, #ff7645 0%, var(--bs-primary) 100%);
}

#hotel-search .btn-primary.btn-lg:active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 6px 16px rgba(244, 103, 50, 0.35);
}

/* --------------------------------------------------------------------------
   8. SECTION DESTINATIONS POPULAIRES
   -------------------------------------------------------------------------- */

.bg-light {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%) !important;
}

.bg-light h2 {
    color: var(--bs-primary);
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.bg-light h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--bs-primary);
    border-radius: 2px;
}

/* Cartes de destination */
.bg-light .card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
}

/* Effet désactivé pour les cartes de destinations */
.bg-light .card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.bg-light .card-body {
    padding: 2rem 1.5rem;
    transition: background-color 0.3s ease;
}

.bg-light .card:hover .card-body {
    background: linear-gradient(135deg, rgba(244, 103, 50, 0.05) 0%, rgba(112, 203, 210, 0.05) 100%);
}

.bg-light .card-title {
    color: var(--bs-primary);
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.bg-light .card:hover .card-title {
    color: var(--bs-secondary);
}

.bg-light .card-text {
    font-size: 0.95rem;
    color: #6c757d;
}

/* --------------------------------------------------------------------------
   9. ESPACEMENTS ET MISE EN PAGE
   -------------------------------------------------------------------------- */

#hotel-search .row.mb-3 {
    margin-bottom: 2rem !important;
}

#hotel-search .row.mb-3:last-of-type {
    margin-bottom: 1.5rem !important;
}

/* --------------------------------------------------------------------------
   10. RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    /* Désactiver le parallax sur mobile pour les performances */
    #hotel-search {
        background-attachment: scroll;
    }

    #hotel-form .bg-white {
        padding: 1.75rem !important;
        border-radius: 16px !important;
    }

    #hotel-search h1 {
        font-size: 2rem;
    }

    #hotel-search .btn-primary.btn-lg {
        padding: 0.85rem 2.5rem;
        font-size: 1.1rem;
    }

    #hotel-search .form-label {
        font-size: 1.15rem;
    }

    .bg-light h2 {
        font-size: 1.5rem;
    }

    /* Sur tablette, les colonnes gardent le même comportement */
    .col-adults,
    .col-children {
        min-width: 140px;
    }
}

@media (max-width: 576px) {
    #hotel-search {
        padding: 2rem 0;
    }

    #hotel-form .bg-white {
        padding: 1.5rem !important;
    }

    .room-config {
        padding: 1rem;
    }

    /* Sur mobile, empiler les colonnes verticalement */
    .room-travelers-row {
        flex-direction: column;
    }

    .col-adults,
    .col-children,
    .col-ages {
        width: 100%;
    }

    /* Les âges restent empilés verticalement (déjà le cas) */
    .ages-wrapper {
        gap: 0.75rem;
    }

    .room-config .form-label {
        font-size: 1rem;
    }

    .room-config h6 {
        font-size: 1.1rem;
    }
}

/* --------------------------------------------------------------------------
   11. ANIMATIONS ET MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */

/* Animation des icônes SVG */
#hotel-search svg {
    transition: transform 0.2s ease;
}

#hotel-search button:hover svg {
    transform: scale(1.1);
}

#hotel-search .btn-outline-danger:hover svg {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Indicateur de chargement pour autocomplete */
#hotel-search .spinner-border-sm {
    width: 1.2rem;
    height: 1.2rem;
    border-width: 2px;
}

/* --------------------------------------------------------------------------
   12. MESSAGES D'ERREUR ET VALIDATION
   -------------------------------------------------------------------------- */

#hotel-search .invalid-feedback {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    padding: 0.6rem 0.9rem;
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
    border-radius: 6px;
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#hotel-search .form-control.is-invalid,
#hotel-search .form-select.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}
