/* Estilos para Busca Global Avançada */

.header-search {
    position: relative;
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.header-search input {
    width: 100%;
    padding: 10px 90px 10px 40px; /* Espaço para ícones */
    border: 1px solid #dee2e6;
    border-radius: 50px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.3s ease;
    height: 40px;
    box-sizing: border-box;
}

.header-search input:focus {
    background: white;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
    outline: none;
}

.header-search #searchIcon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    z-index: 1;
}

/* Botões de Voz e IA */
.btn-voice-search,
.btn-ai-search {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 14px;
    z-index: 1;
}

.btn-voice-search {
    right: 48px;
}

.btn-ai-search {
    right: 12px;
    border-left: 1px solid #e9ecef;
    padding-left: 8px;
    border-radius: 0;
    width: 35px;
}

.btn-voice-search:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.btn-ai-search:hover {
    color: #6366f1;
}

.btn-ai-search.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.btn-voice-search.recording {
    color: #dc3545;
    animation: pulse 1s infinite;
}

.btn-ai-search.active {
    color: #6366f1;
    background: #e0e2ff;
}

@keyframes pulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
    100% { transform: translateY(-50%) scale(1); }
}

/* Painel de Busca */
.search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 500px;
    overflow-y: auto;
}

/* Seções de Sugestões */
.search-suggestions {
    padding: 15px;
}

.suggestions-section {
    margin-bottom: 20px;
}

.suggestions-section h6 {
    color: #6c757d;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.suggestions-section h6 i {
    font-size: 14px;
}

/* Items de Sugestão, Histórico e Favoritos */
.suggestion-item,
.history-item,
.favorite-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.suggestion-item:hover,
.history-item:hover,
.favorite-item:hover {
    background: #f8f9fa;
}

.suggestion-item i,
.history-item i,
.favorite-item i {
    color: #6c757d;
    font-size: 14px;
}

.favorite-item {
    justify-content: space-between;
}

.favorite-item small {
    color: #adb5bd;
    font-size: 11px;
}

/* Resultados da Busca */
.search-results {
    padding: 15px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.results-header span {
    color: #6c757d;
    font-size: 14px;
}

.results-header button {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #6c757d;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.results-header button:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

/* Filtros Inteligentes */
.smart-filters {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
}

.filter-badge {
    display: inline-block;
    padding: 4px 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-badge:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

/* Items de Resultado */
.search-result-item {
    display: flex;
    align-items: start;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.search-result-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.result-icon {
    width: 40px;
    height: 40px;
    background: #e0e2ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.result-icon i {
    color: #6366f1;
    font-size: 18px;
}

.result-content {
    flex: 1;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #212529;
}

.result-description {
    font-size: 12px;
    color: #6c757d;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-type {
    display: inline-block;
    font-size: 11px;
    color: #6366f1;
    background: #e0e2ff;
    padding: 2px 8px;
    border-radius: 10px;
}

.result-actions {
    display: flex;
    align-items: center;
}

.result-actions button {
    background: transparent;
    border: none;
    color: #6c757d;
    padding: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.result-actions button:hover {
    background: #e9ecef;
    color: #495057;
}

/* Estados de Loading e Erro */
.search-loading,
.search-error,
.no-results {
    text-align: center;
    padding: 30px;
}

.search-loading p,
.search-error p,
.no-results p {
    margin: 10px 0 5px;
    color: #6c757d;
}

.search-error i,
.no-results i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 10px;
}

.no-results small {
    color: #adb5bd;
    font-size: 12px;
}

/* Responsividade */
@media (max-width: 768px) {
    .header-search {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .search-panel {
        left: 10px;
        right: 10px;
    }
    
    .btn-voice-search,
    .btn-ai-search {
        display: none;
    }
}