/**
 * 2025 Appartement Vendre
 * CSS complet pour le module de recherche immobiliere
 */

/* === STYLES DESKTOP === */
.immobilier-search-box h2 {
    text-align: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    color: #333;
}

.immobilier-search-inputs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: flex-end;
}

.immobilier-search-item {
    flex: 1;
    margin-bottom: 0.9375rem;
    min-width: 0;
}

.immobilier-search-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
    font-size: 1rem;
    clear: both;
    width: 100%;
	text-align: left;
}

.immobilier-search-submit {
    flex: 0 0 auto;
    margin-bottom: 0.9375rem;
    border-radius: 0.625rem;
}

/* BOUTON PRINCIPAL - Couleur primaire #00807b */
.immobilier-search-submit button {
    height: 2.8125rem;
    padding: 0 1.875rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background-color: #00807b; /* Couleur primaire */
    transition: all 0.3s ease;
}

.immobilier-search-submit button:hover,
.immobilier-search-submit button:focus,
.immobilier-search-submit button:active {
    background-color: #006b67 !important; /* Version plus foncée de la couleur primaire */
    color: #ffffff;
    text-decoration: none !important;
}

.immobilier-search-submit button i {
    margin-right: 0.5rem;
}

/* Champs de formulaire avec taille minimum 1rem */
.immobilier-search-item .form-control,
.immobilier-search-item select,
.immobilier-search-item input {
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    border: 0.0625rem solid #ddd;
    width: 100%;
}

/* === DOUBLE CURSEUR - Couleurs personnalisées === */
.dual-slider-container {
    position: relative;
    height: 2.5rem;
    padding: 0.5rem 0.625rem;
    clear: both;
}

.slider-track {
    position: absolute;
    width: calc(100% - 1.25rem);
    height: 0.375rem;
    background: #e0e0e0;
    border-radius: 0.1875rem;
    top: 50%;
    left: 0.625rem;
    transform: translateY(-50%);
    z-index: 1;
}

/* Barre colorée - Dégradé avec les nouvelles couleurs */
.slider-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #00807b 0%, #00807b 60%, #d14300 100%);
    border-radius: 0.1875rem;
    z-index: 2;
}

/* Curseurs avec gestion du z-index dynamique */
.slider-thumb {
    position: absolute;
    width: 100%;
    height: 2.5rem;
    background: transparent;
    outline: none;
    cursor: pointer;
    top: 0;
    left: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-thumb::-webkit-slider-thumb {
    pointer-events: all;
}

.slider-thumb::-moz-range-thumb {
    pointer-events: all;
}

.slider-thumb-min {
    z-index: 3;
}

.slider-thumb-max {
    z-index: 4;
}

.slider-thumb-min.active {
    z-index: 5 !important;
}

.slider-thumb-max.active {
    z-index: 5 !important;
}

/* Styles WebKit (Chrome, Safari, Edge) */
.slider-thumb::-webkit-slider-track {
    background: transparent;
    height: 0.375rem;
    border: none;
}

.slider-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #00807b; /* Couleur primaire par défaut */
    cursor: pointer;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 128, 123, 0.3); /* Ombre avec couleur primaire */
    border: 0.125rem solid #fff;
    transition: all 0.3s ease;
    position: relative;
}

.slider-thumb::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 128, 123, 0.4);
}

.slider-thumb::-webkit-slider-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 0.375rem 1rem rgba(0, 128, 123, 0.5);
}

/* Styles Mozilla (Firefox) */
.slider-thumb::-moz-range-track {
    background: transparent;
    height: 0.375rem;
    border: none;
}

.slider-thumb::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #00807b; /* Couleur primaire */
    cursor: pointer;
    border: 0.125rem solid #fff;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 128, 123, 0.3);
    transition: all 0.3s ease;
}

.slider-thumb::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 128, 123, 0.4);
}

.slider-thumb::-moz-range-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 0.375rem 1rem rgba(0, 128, 123, 0.5);
}

/* Différenciation visuelle min/max avec tes couleurs */
.slider-thumb-min::-webkit-slider-thumb {
    background: #00807b; /* Primaire pour minimum */
}

.slider-thumb-max::-webkit-slider-thumb {
    background: #d14300; /* Secondaire pour maximum */
}

.slider-thumb-min::-moz-range-thumb {
    background: #00807b;
}

.slider-thumb-max::-moz-range-thumb {
    background: #d14300;
}

/* États actifs avec couleurs plus vives */
.slider-thumb-min.active::-webkit-slider-thumb,
.slider-thumb-min:focus::-webkit-slider-thumb {
    background: #006b67; /* Version plus foncée du primaire */
    box-shadow: 0 0.25rem 0.75rem rgba(0, 107, 103, 0.5);
}

.slider-thumb-max.active::-webkit-slider-thumb,
.slider-thumb-max:focus::-webkit-slider-thumb {
    background: #b8380a; /* Version plus foncée du secondaire */
    box-shadow: 0 0.25rem 0.75rem rgba(184, 56, 10, 0.5);
}

.slider-thumb-min.active::-moz-range-thumb,
.slider-thumb-min:focus::-moz-range-thumb {
    background: #006b67;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 107, 103, 0.5);
}

.slider-thumb-max.active::-moz-range-thumb,
.slider-thumb-max:focus::-moz-range-thumb {
    background: #b8380a;
    box-shadow: 0 0.25rem 0.75rem rgba(184, 56, 10, 0.5);
}

/* Affichage des prix avec tes couleurs */
.price-display-container {
    margin-top: 1rem;
}

.price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: #00807b; /* Couleur primaire */
}

.price-min-display {
    color: #00807b; /* Couleur primaire pour le min */
    transition: color 0.3s ease;
    font-size: 1rem;
}

.price-max-display {
    color: #d14300; /* Couleur secondaire pour le max */
    transition: color 0.3s ease;
    font-size: 1rem;
}

.price-min-display.active {
    color: #006b67; /* Version plus foncée du primaire */
    font-weight: 700;
}

.price-max-display.active {
    color: #b8380a; /* Version plus foncée du secondaire */
    font-weight: 700;
}

.price-separator {
    color: #999;
    font-weight: normal;
    font-size: 1rem;
}

/* Masquer les anciens inputs prix */
.price-inputs {
    display: none !important;
}

/* === STYLES POUR LA RECHERCHE DE LOCALITÉ === */
.location-search-wrapper {
    position: relative;
}

.location-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 0.0625rem solid #ddd;
    border-radius: 0 0 0.25rem 0.25rem;
    max-height: 15.625rem;
    overflow-y: auto;
    display: none;
    box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
}

.location-item {
    padding: 0.5rem 0.9375rem;
    cursor: pointer;
    border-bottom: 0.0625rem solid #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.2s ease;
    font-size: 1rem;
}

.location-item:hover {
    background-color: rgba(0, 128, 123, 0.1); /* Couleur primaire avec transparence */
    color: #00807b; /* Couleur primaire */
}

/* Styles pour les différents niveaux hiérarchiques */
.location-item.level-1 { padding-left: 1.5625rem; }
.location-item.level-2 { padding-left: 2.1875rem; }
.location-item.level-3 { padding-left: 2.8125rem; }
.location-item.level-4 { padding-left: 3.4375rem; }
.location-item.level-5 { padding-left: 4.0625rem; }

.location-no-result {
    padding: 0.625rem 0.9375rem;
    font-style: italic;
    color: #999;
    font-size: 1rem;
}

.loading-results {
    padding: 0.625rem 0.9375rem;
    text-align: center;
    color: #666;
    font-size: 1rem;
}

.error-message {
    color: #d14300; /* Couleur secondaire pour les erreurs */
    font-size: 1rem;
    margin-top: 0.3125rem;
}

/* === VERSION TABLETTE === */
@media (max-width: 991px) and (min-width: 768px) {
    .immobilier-search-inputs {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .immobilier-search-item {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 200px;
    }
    
    .immobilier-search-submit {
        flex: 0 0 auto;
        width: auto;
    }
}

/* === VERSION MOBILE === */
@media (max-width: 767px) {
    .immobilier-search-fullwidth {
        padding: 0.5rem 0;
    }
    
    .immobilier-search-fullwidth .immobilier-search-box {
        padding: 0.75rem 0.625rem;
        border-radius: 0.375rem;
        margin: 0 0.3125rem;
    }
    
    .immobilier-search-fullwidth .search-page-title {
        font-size: 1.125rem;
        margin-top: 0;
        margin-bottom: 0.625rem;
        font-weight: 600;
        display: block;
    }
    
    .immobilier-search-fullwidth .search-main-title {
        font-size: 1.125rem;
		margin-top: 0;
        margin-bottom: 0.625rem;
        font-weight: 600;
        display: block;
    }
    
    .immobilier-search-inputs {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        margin-bottom: 0;
    }
    
    .immobilier-search-item {
        flex: none;
        width: 100%;
        margin-bottom: 0;
        min-width: 0;
    }
    
    /* Masquer labels pour Type et Localité */
    .immobilier-search-item:nth-child(1) label,
    .immobilier-search-item:nth-child(2) label {
        display: none;
    }
    
    /* Label Budget visible */
    .immobilier-search-item:nth-child(3) label {
        font-size: 1rem;
        margin-bottom: 0.25rem;
        color: #666;
        font-weight: 500;
        display: block;
    }
    
    .immobilier-search-item .form-control,
    .immobilier-search-item select,
    .immobilier-search-item input {
        height: 2.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
        border-radius: 0.25rem;
        border: 0.0625rem solid #ddd;
    }
    
    /* Ajustements mobile pour le double curseur */
    .dual-slider-container {
        position: relative;
        height: 2.5rem;
        padding: 0.5rem 0.75rem;
        clear: both;
        box-sizing: border-box;
    }
    
    .slider-track {
        position: absolute;
        width: calc(100% - 2.5rem);
        height: 0.25rem;
        background: #e0e0e0;
        border-radius: 0.125rem;
        top: 50%;
        left: 1rem;
        transform: translateY(-50%);
        z-index: 1;
        box-sizing: border-box;
    }
    
    .slider-range {
        position: absolute;
        height: 100%;
        background: linear-gradient(90deg, #00807b 0%, #00807b 60%, #d14300 100%);
        border-radius: 0.125rem;
        z-index: 2;
    }
    
    .slider-thumb {
        position: absolute;
        width: 100%;
        height: 2.5rem;
        background: transparent;
        outline: none;
        cursor: pointer;
        top: 0;
        left: 0;
        pointer-events: none;
        -webkit-appearance: none;
        appearance: none;
        box-sizing: border-box;
    }
    
    .slider-thumb::-webkit-slider-track {
        background: transparent;
        height: 0.25rem;
        border: none;
    }
    
    .slider-thumb::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 1rem;
        height: 1rem;
        border-radius: 50%;
        background: #00807b; /* Couleur primaire */
        cursor: pointer;
        border: 0.0625rem solid #fff;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 128, 123, 0.3);
        transition: all 0.3s ease;
        pointer-events: all;
    }
    
    .slider-thumb::-moz-range-track {
        background: transparent;
        height: 0.25rem;
        border: none;
    }
    
    .slider-thumb::-moz-range-thumb {
        width: 1rem;
        height: 1rem;
        border-radius: 50%;
        background: #00807b;
        cursor: pointer;
        border: 0.0625rem solid #fff;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 128, 123, 0.3);
        transition: all 0.3s ease;
        pointer-events: all;
    }
    
    /* Différenciation mobile min/max */
    .slider-thumb-min::-webkit-slider-thumb {
        background: #00807b; /* Primaire */
    }
    
    .slider-thumb-max::-webkit-slider-thumb {
        background: #d14300; /* Secondaire */
    }
    
    .slider-thumb-min::-moz-range-thumb {
        background: #00807b;
    }
    
    .slider-thumb-max::-moz-range-thumb {
        background: #d14300;
    }
    
    .price-display {
        font-size: 1rem;
        margin-top: 0.5rem;
    }
    
    .price-display-container {
        margin-top: 0.75rem;
    }
    
    /* Bouton mobile avec couleur primaire */
    .immobilier-search-submit {
        flex: none;
        margin-bottom: 0;
        width: auto;
        align-self: center;
    }
    
    .immobilier-search-submit button {
        height: 2.5rem;
        padding: 0 1.5rem;
        font-size: 1rem;
        border-radius: 0.25rem;
        min-width: 8rem;
        background-color: #00807b; /* Couleur primaire */
        width: auto;
    }
    
    .immobilier-search-submit button i {
        margin-right: 0.5rem;
        font-size: 1rem;
    }
    
    .location-results-dropdown {
        max-height: 12rem;
        font-size: 1rem;
    }
    
    .location-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .location-item.level-1 { padding-left: 1.25rem; }
    .location-item.level-2 { padding-left: 1.75rem; }
    .location-item.level-3 { padding-left: 2.25rem; }
    .location-item.level-4 { padding-left: 2.75rem; }
    .location-item.level-5 { padding-left: 3.25rem; }
}

/* === DROPDOWN MOBILE === */
.mobile-search-toggle {
    display: none;
    background: #00807b; /* Couleur primaire */
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.search-page-title i {
    display: none;
}

.mobile-search-toggle:hover {
    background: #006b67; /* Version plus foncée du primaire */
}

.mobile-search-toggle i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.mobile-search-content {
    display: block;
}

@media (max-width: 767px) {
    .immobilier-search-fullwidth:not(.search-home) .search-page-title.mobile-search-toggle {
        background: #00807b; /* Couleur primaire */
        color: white;
        border: none;
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        margin-bottom: 0.5rem;
        margin-top: 0;
    }
    
    .immobilier-search-fullwidth:not(.search-home) .search-page-title.mobile-search-toggle:hover {
        background: #006b67; /* Version plus foncée du primaire */
    }
    
    .immobilier-search-fullwidth:not(.search-home) .search-page-title i {
        display: inline-block;
        transition: transform 0.3s ease;
    }
    
    .immobilier-search-fullwidth:not(.search-home) .mobile-search-content {
        display: none;
    }
}