/* Estilos para el buscador de calles expandible */
.street-search-expandable {
    position: fixed;
    top: 80px; /* Debajo del header */
    left: 20px;
    z-index: 500;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    overflow: visible;
    width: 40px; /* Mismo tamaño que los iconos del header */
    height: 40px; /* Mismo tamaño que los iconos del header */
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.street-search-expandable:hover,
.street-search-expandable.expanded {
    width: 260px; /* Reducir ancho por la derecha */
    background-color: rgba(0, 0, 0, 0.7); /* Más transparente cuando se expande */
}

.search-icon {
    width: 40px; /* Mismo tamaño que los iconos del header */
    height: 40px; /* Mismo tamaño que los iconos del header */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 6px;
    box-sizing: border-box;
}

.search-icon img {
    filter: invert(1); /* Hacer el icono blanco */
    width: 28px;
    height: 28px;
}

.search-expanded-content {
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: -2px; /* Acercar aún más el texto al icono */
    margin-right: 6px;
    white-space: nowrap;
    flex: 1;
    overflow: hidden;
}

.street-search-expandable:hover .search-expanded-content,
.street-search-expandable.expanded .search-expanded-content {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1) 0.2s, transform 0.1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

#street-search-input {
    background: transparent;
    border: none; /* Quitar todos los bordes */
    outline: none;
    color: var(--color-white);
    font-family: var(--font-family-body);
    font-size: 14px;
    padding: 8px 8px; /* Reducir padding horizontal para más espacio */
    flex: 1;
    border-radius: 4px;
    min-width: 180px; /* Ajustar min-width al nuevo ancho */
}

#street-search-input:focus {
    outline: none; /* Asegurar que no aparezca borde en focus */
}

#street-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#street-search-clear {
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-left: 4px; /* Reducir margen para que más texto sea visible */
}

#street-search-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    transform: scale(1.05);
}

.search-results {
    position: absolute;
    top: 48px; /* Reducir margen superior - más cerca del buscador */
    left: 0;
    width: 260px; /* Mismo ancho que el buscador expandido */
    background: rgba(0, 0, 0, 0.7); /* Misma transparencia que el buscador expandido */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    animation: fadeIn 0.2s ease-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    z-index: 1001;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.search-result-item {
    padding: 12px 16px;
    color: var(--color-white);
    font-family: var(--font-family-body);
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-main {
    font-weight: 500;
    color: var(--color-white);
}

.search-result-secondary {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.search-loading {
    position: absolute;
    top: 48px; /* Reducir margen superior - más cerca del buscador */
    left: 0;
    width: 260px; /* Mismo ancho que el buscador expandido */
    background: rgba(0, 0, 0, 0.7); /* Misma transparencia que el buscador expandido */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-white);
    font-family: var(--font-family-body);
    font-size: 14px;
    animation: fadeIn 0.2s ease-out;
    z-index: 1001;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--color-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .street-search-expandable {
        left: 10px;
        top: 70px;
    }
    
    .street-search-expandable:hover,
    .street-search-expandable.expanded {
        width: calc(100vw - 20px); /* Casi todo el ancho en móviles */
        max-width: 250px; /* Ajustar también el máximo en móviles */
    }
    
    #street-search-input {
        font-size: 16px; /* Evitar zoom en iOS */
        min-width: 160px; /* Más estrecho en móviles */
        padding: 6px 10px;
    }
    
    .search-results,
    .search-loading {
        width: 250px; /* Ancho fijo en móviles para consistencia */
        max-height: 250px;
    }
    
    .search-result-item {
        padding: 10px 14px;
    }
} 