/* =========================================================
   SEARCH-FLOATING.CSS - Estilos da Busca Flutuante
   Projeto: MPPE Caatinga Resiste 2026
========================================================= */

/* Container principal (já existe no header, mas precisamos definir pointer-events) */
.header-main-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Container da busca */
.search-container-standalone {
    position: absolute;
    top: 20px;
    left: 185px;
    pointer-events: auto;
    z-index: 1001;
}

/* Botão flutuante */
#search-floating-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #0d5d2e;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1002;
}

#search-floating-btn:hover {
    background: #0a4a24;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

#search-floating-btn i {
    transition: transform 0.3s ease;
}

#search-floating-btn.active i {
    transform: rotate(90deg);
}

/* Caixa expandida */
#search-box-expanded {
    position: absolute;
    top: 60px;
    left: 0;
    width: 380px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid rgba(13, 93, 46, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1001;
}

#search-box-expanded.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Inner da caixa */
.search-box-inner {
    display: flex;
    background: white;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    border-bottom: 1px solid #e0e0e0;
}

#search-input-header {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 14px;
    outline: none;
    background: transparent;
}

#search-btn-header {
    background: #0d5d2e;
    border: none;
    color: white;
    padding: 0 20px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 16px;
    min-width: 50px;
}

#search-btn-header:hover {
    background: #0a4a24;
}

#search-btn-header:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* Dropdown de resultados */
#search-results-header {
    max-height: 350px;
    overflow-y: auto;
    background: white;
    border-radius: 0 0 12px 12px;
    display: none;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f5f5f5;
}

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

/* Botões dentro dos resultados */
.btn-mapa-alerta, .btn-dashboard-alerta {
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}

.btn-mapa-alerta {
    background: #0d5d2e;
    color: white;
}

.btn-dashboard-alerta {
    background: #337ab7;
    color: white;
}

.btn-mapa-alerta:hover, .btn-dashboard-alerta:hover {
    opacity: 0.8;
}

/* Overlay */
#search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
    display: none;
}

#search-overlay.active {
    display: block;
}

/* Loader */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Ajustes responsivos para a busca */
@media (max-width: 768px) {
    .search-container-standalone {
        top: 10px;
        left: 25px;
    }
    
    #search-box-expanded {
        width: 320px;
    }
}

@media (max-width: 480px) {
    .search-container-standalone {
        left: 20px;
    }
    
    #search-box-expanded {
        width: 290px;
        left: -5px;
    }
}