/* ============================================
   YOCOLO CI - Système de Recherche Villes
   Styles Premium - Dropdown Autocomplétion
   ============================================ */

/* Container principal */
.ville-search-container {
    position: relative;
    margin-bottom: 22px;
    overflow: visible !important;
}

.ville-search-container .search-box {
    position: relative;
    margin-bottom: 0;
    overflow: visible !important;
}

.ville-search-container .search-box input {
    width: 100%;
    padding: 16px 18px 16px 50px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
}

.ville-search-container .search-box input:focus {
    outline: none;
    border-color: #1a7a3e;
    box-shadow: 0 0 0 4px rgba(26, 122, 62, 0.1);
}

.ville-search-container .search-box > i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    transition: color 0.3s ease;
    pointer-events: none;
}

.ville-search-container .search-box input:focus + i {
    color: #1a7a3e;
}

/* ============================================
   FIX CRITIQUE : city-selector a overflow:hidden
   dans index.css — on force visible ici
   ============================================ */
.city-selector {
    overflow: visible !important;
}

/* On remet overflow:hidden uniquement sur l'effet shine */
.selector-shine {
    overflow: hidden !important;
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
}

/* ============================================
   DROPDOWN DES VILLES
   ============================================ */
.ville-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.15),
        0 0 0 1px rgba(0,0,0,0.05);
    max-height: 600px; /* ✅ CORRIGÉ : 380px → 600px */
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.97);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    border: 1px solid rgba(26, 122, 62, 0.1);
}

.ville-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Scrollbar du dropdown */
.ville-dropdown::-webkit-scrollbar {
    width: 6px;
}

.ville-dropdown::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 16px 16px 0;
}

.ville-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1a7a3e, #2d9e5e);
    border-radius: 3px;
}

/* ============================================
   RÉGIONS DANS LE DROPDOWN
   ============================================ */
.dropdown-region {
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.dropdown-region:last-child {
    border-bottom: none;
}

.region-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: rgba(0,0,0,0.015);
}

.region-title i {
    font-size: 10px;
    color: #e67e22;
}

/* ============================================
   ITEM VILLE
   ============================================ */
.ville-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ville-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.ville-item:hover {
    background: rgba(26, 122, 62, 0.04);
    border-left-color: #1a7a3e;
    padding-left: 22px;
}

.ville-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(26,122,62,0.08), rgba(230,126,34,0.08));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a7a3e;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ville-item:hover .ville-icon {
    background: linear-gradient(135deg, #1a7a3e, #2d9e5e);
    color: white;
    transform: scale(1.08);
}

.ville-info {
    flex: 1;
    min-width: 0;
}

.ville-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ville-item:hover .ville-name {
    color: #1a7a3e;
}

.ville-meta {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-top: 1px;
}

.ville-arrow {
    color: #6b7280;
    font-size: 11px;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ville-item:hover .ville-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #1a7a3e;
}

/* ============================================
   ÉTAT VIDE (aucun résultat)
   ============================================ */
.dropdown-empty {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}

.dropdown-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.4;
    color: #1a7a3e;
}

.dropdown-empty p {
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   MESSAGE DE CONFIRMATION
   ============================================ */
.ville-message {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 10px;
    animation: messageSlideIn 0.35s ease;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ville-message.success {
    display: flex;
    background: linear-gradient(135deg, rgba(26,122,62,0.08), rgba(45,158,94,0.08));
    border: 1px solid rgba(26,122,62,0.15);
    color: #1a7a3e;
}

.ville-message.error {
    display: flex;
    background: linear-gradient(135deg, rgba(231,76,60,0.08), rgba(192,57,43,0.08));
    border: 1px solid rgba(231,76,60,0.15);
    color: #e74c3c;
}

.ville-message i {
    font-size: 16px;
    flex-shrink: 0;
}

/* ============================================
   SPINNER DE CHARGEMENT
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spinnerRotate 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .ville-dropdown {
        max-height: 500px; /* ✅ CORRIGÉ : 320px → 500px */
        border-radius: 12px;
    }
    
    .ville-item {
        padding: 10px 14px;
    }
    
    .ville-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .ville-name {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ville-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 80vh; /* ✅ CORRIGÉ : 65vh → 80vh */
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        z-index: 99999;
    }
    
    .ville-dropdown.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
}