/**
 * Styles pour le formulaire de recherche moderne
 */

/* Container principal */
.search-box {
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px !important;
}

.search-form-modern {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* Wrapper des inputs - tous collés sur une ligne */
.search-inputs-wrapper {
    display: flex;
    align-items: stretch;
    background: white;
    border-radius: 50px;
    overflow: hidden; /* Gardé uniquement ici pour le border-radius des inputs */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Champs de recherche */
.search-field {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-right: 1px solid #e0e0e0;
    min-height: 65px;
}

.search-field:last-of-type {
    border-right: none;
}

.search-field-city {
    flex: 2;
    min-width: 250px;
}

.search-field-price {
    flex: 0.8;
}

/* Icônes */
.search-icon {
    color: #007bff;
    font-size: 1.1rem;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Inputs et selects modernes */
.form-control-modern {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    padding: 0;
    color: #333;
    font-weight: 500;
}

.form-control-modern::placeholder {
    color: #999;
    font-weight: 400;
}

.form-control-modern:focus {
    outline: none;
}

/* Select styling */
.form-control-modern option {
    padding: 10px;
}

/* Bouton prix toggle */
.price-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    padding: 0;
}

.price-toggle:hover {
    color: #007bff;
}

.price-toggle.active i {
    transform: rotate(180deg);
}

/* Bouton de recherche */
.btn-search-modern {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: white;
    padding: 0 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border-radius: 0 50px 50px 0;
    white-space: nowrap;
}

.btn-search-modern:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: scale(1.02);
}

.btn-search-modern i {
    font-size: 18px;
}

/* Panel de prix (déroulant) */
.price-panel {
    background: white;
    border-radius: 0 0 20px 20px;
    padding: 30px;
    margin-top: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Conteneur des villes sélectionnées */
.selected-cities-container {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.3s ease-out;
}

.selected-cities-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.selected-cities-label i {
    color: #007bff;
}

.selected-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Tag de ville individuel */
.city-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 25px;
    padding: 8px 15px 8px 18px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    animation: tagAppear 0.3s ease-out;
}

.city-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.city-tag-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.city-tag-name i {
    font-size: 12px;
    opacity: 0.9;
}

.city-tag-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.city-tag-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.city-tag-remove:active {
    transform: rotate(90deg) scale(0.9);
}

/* Animation pour l'apparition des tags */
@keyframes tagAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation pour la disparition des tags */
@keyframes tagDisappear {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.price-panel-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Inputs de prix */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.price-input-group {
    flex: 1;
    position: relative;
}

.price-input-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.price-input-group input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.price-input-group input:focus {
    border-color: #007bff;
    outline: none;
}

.price-input-group .currency {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 12px;
    color: #999;
    font-weight: 600;
}

.price-separator {
    color: #999;
    font-size: 20px;
    margin-top: 30px;
}

/* Slider de prix double */
.price-slider-container {
    margin: 30px 0;
}

.price-slider-wrapper {
    position: relative;
    height: 6px;
    margin: 15px 0;
}

.price-slider-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    z-index: 1;
}

.price-slider-range {
    position: absolute;
    height: 6px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 3px;
    z-index: 2;
}

.price-slider-input {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    top: 0;
    left: 0;
}

.price-slider-input:first-of-type {
    z-index: 4;
}

.price-slider-input:last-of-type {
    z-index: 5;
}

.price-slider-input::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: transparent;
}

.price-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #007bff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    margin-top: -7px;
}

.price-slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.4);
}

.price-slider-input::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.price-slider-input::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: transparent;
}

.price-slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #007bff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.price-slider-input::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.4);
}

.price-slider-input::-moz-range-thumb:active {
    transform: scale(1.1);
}

.price-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

/* Boutons presets de prix */
.price-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.preset-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.preset-btn:hover {
    border-color: #007bff;
    background: #f0f7ff;
    color: #007bff;
}

.preset-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Autocomplete pour les villes (style comme price-panel) */
.autocomplete-panel {
    background: white;
    border-radius: 0 0 20px 20px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
    max-height: 400px;
    overflow-y: auto;
}

/* Position relative pour le formulaire parent */
.search-form-modern {
    position: relative;
}

/* S'assurer que le parent n'a pas overflow hidden */
.search-box {
    overflow: visible !important;
}

.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item i {
    color: #007bff;
    font-size: 14px;
}

.autocomplete-item-text {
    flex: 1;
}

.autocomplete-item-text strong {
    display: block;
    color: #333;
    font-size: 15px;
}

.autocomplete-item-text small {
    color: #999;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1200px) {
    .search-inputs-wrapper {
        flex-wrap: wrap;
        border-radius: 20px;
    }

    .search-field {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        min-width: 100%;
    }

    .search-field:last-of-type {
        border-bottom: none;
    }

    .btn-search-modern {
        width: 100%;
        justify-content: center;
        border-radius: 0 0 20px 20px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .price-inputs {
        flex-direction: column;
        gap: 15px;
    }

    .price-separator {
        display: none;
    }

    .price-presets {
        gap: 8px;
    }

    .preset-btn {
        font-size: 13px;
        padding: 8px 15px;
    }

    .btn-search-modern .btn-text {
        display: inline;
    }
}

/* Style pour le champ de ville actif */
.search-field-city.active {
    box-shadow: 0 0 0 2px #007bff;
    border-radius: 50px 0 0 50px;
}

/* Loading spinner pour autocomplete */
.autocomplete-loading {
    padding: 20px;
    text-align: center;
    color: #999;
}

.autocomplete-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Highlight du texte recherché */
.autocomplete-item mark {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}
