/**
 * MetSul - City Search Component Styles
 * 
 * Estilos do componente de busca de cidades reutilizável.
 * Suporta temas dark e light.
 *
 * @package MetSul
 * @since 1.2.0
 */

/* ========================================
   Container Principal
   ======================================== */
.ms-city-search {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    z-index: 100;
}

.ms-city-search__wrapper {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    overflow: visible;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========================================
   Input de Busca
   ======================================== */
.ms-city-search__input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #fff;
    outline: none;
    min-width: 0;
}

.ms-city-search__input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.ms-city-search__input:focus {
    outline: none;
}

/* ========================================
   Botão de Geolocalização
   ======================================== */
.ms-city-search__geo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.ms-city-search__geo:hover {
    color: #fff;
    transform: scale(1.1);
}

/* ========================================
   Botão de Limpar Localização
   ======================================== */
.ms-city-search__clear {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.ms-city-search__clear.show {
    display: flex;
}

.ms-city-search__clear:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

/* ========================================
   Botão de Busca
   ======================================== */
.ms-city-search__button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: #FF9800;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 0 8px 8px 0;
}

.ms-city-search__button:hover {
    background: #F57C00;
}

.ms-city-search__button svg {
    flex-shrink: 0;
}

/* ========================================
   Dropdown de Sugestões
   ======================================== */
.ms-city-search__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    max-height: 350px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}

.ms-city-search__dropdown.is-open {
    display: block;
}

/* ========================================
   Itens do Dropdown
   ======================================== */
.ms-city-search__item {
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s, color 0.15s;
    font-size: 15px;
    color: #333;
    text-align: left;
}

.ms-city-search__item:last-child {
    border-bottom: none;
}

.ms-city-search__item:hover,
.ms-city-search__item.is-highlighted {
    background: linear-gradient(90deg, rgba(0, 102, 191, 0.1), transparent);
    color: #0066BF;
}

.ms-city-search__item strong {
    color: #0066BF;
    font-weight: 600;
}

.ms-city-search__empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* ========================================
   Tema Light
   ======================================== */
.ms-city-search--light .ms-city-search__wrapper {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ms-city-search--light .ms-city-search__input {
    color: #333;
}

.ms-city-search--light .ms-city-search__input::placeholder {
    color: #999;
}

.ms-city-search--light .ms-city-search__geo {
    color: #666;
}

.ms-city-search--light .ms-city-search__geo:hover {
    color: #0066BF;
}

.ms-city-search--light .ms-city-search__clear {
    color: #999;
}

.ms-city-search--light .ms-city-search__clear:hover {
    color: #e74c3c;
}

/* ========================================
   Responsivo
   ======================================== */
@media (max-width: 768px) {
    .ms-city-search {
        max-width: 100%;
    }

    .ms-city-search__input {
        padding: 14px 16px;
        font-size: 15px;
    }

    .ms-city-search__button {
        padding: 14px 16px;
    }

    .ms-city-search__button span {
        display: none;
    }

    .ms-city-search__geo {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .ms-city-search__input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .ms-city-search__button {
        padding: 12px 14px;
    }
}