/**
 * ZiruLocationSelect — Design Premium Dark
 * (Twin visual do ZiruProfessionalSelect)
 */

 :root {
    --zl-primary: #007AFF;
    --zl-accent: #00E5FF;
    --zl-surface: #0a0a0a;
    --zl-border: rgba(255, 255, 255, 0.12);
    --zl-bg-dropdown: #0f172a;
}

.ziru-location-container {
    position: relative;
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
}

/* Campo Fechado */
.ziru-location-trigger {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    text-align: left;
}

.ziru-location-trigger i {
    font-size: 1.25rem;
    color: #007AFF !important; /* Azul ZIRU Vibrante */
    display: inline-block !important;
    opacity: 1 !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ziru-location-trigger .label-container {
    flex: 1;
    overflow: hidden;
}

.ziru-location-trigger .zp-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff; /* Branco puro para máxima legibilidade */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ziru-location-trigger .zp-placeholder {
    color: #94a3b8; /* Cinza claro azulado para contraste premium */
    font-weight: 500;
}

.ziru-location-trigger .zp-subtitle {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-top: 2px;
}

.ziru-location-trigger:hover i {
    transform: scale(1.1);
}

/* Dropdown */
.ziru-location-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 100%;
    min-width: 280px;
    background: var(--zl-bg-dropdown);
    border: 1px solid var(--zl-border);
    border-radius: 1.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 122, 255, 0.1);
    z-index: 100000;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

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

.ziru-location-dropdown.active {
    display: flex;
    animation: zlSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Busca Interna */
.ziru-location-search {
    padding: 1rem;
    border-bottom: 1px solid var(--zl-border);
    background: rgba(255,255,255,0.02);
}

.ziru-location-search input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--zl-border);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.ziru-location-search input:focus {
    border-color: var(--zl-primary);
    background: rgba(255,255,255,0.08);
}

/* Listagem */
.ziru-location-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem;
}

.ziru-location-list::-webkit-scrollbar {
    width: 6px;
}
.ziru-location-list::-webkit-scrollbar-track {
    background: transparent;
}
.ziru-location-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.ziru-location-item {
    padding: 0.875rem 1rem;
    border-radius: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.ziru-location-item:hover,
.ziru-location-item.focused {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.ziru-location-item.selected {
    background: rgba(0, 122, 255, 0.15);
}

.ziru-location-item i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 0.75rem;
    color: #64748b;
    font-size: 1.1rem;
}

.ziru-location-item.selected i {
    color: var(--zl-primary);
    background: rgba(0, 122, 255, 0.1);
}

.ziru-location-item .item-content {
    flex: 1;
}

.ziru-location-item .item-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #cbd5e1;
}

.ziru-location-item.selected .item-name {
    color: #fff;
}

.ziru-location-item .item-type {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.05em;
}

/* Status e Empty States */
.ziru-location-empty,
.ziru-location-error {
    padding: 2.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ziru-location-empty span,
.ziru-location-error span {
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ziru-location-error i {
    color: #ef4444;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.ziru-location-error span {
    color: #f87171;
}

/* Overlay para fechar ao clicar fora */
.ziru-location-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    display: none;
}

.ziru-location-overlay.active {
    display: block;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .ziru-location-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        border-radius: 2rem 2rem 0 0;
        max-height: 80vh;
        animation: zlSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    @keyframes zlSlideUp {
        from { opacity: 0; transform: translateY(100%); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .ziru-location-list {
        max-height: 60vh;
    }
    
    .ziru-location-overlay {
        background: rgba(0,0,0,0.8);
    }
}
