﻿.search-post-wrapper {
    position: relative;
    z-index: 99;
}

.search-page-form {
    position: relative !important;
    z-index: 999999;
}

.search-post-wrapper,
.container,
.page-content-wrapper,
.offcanvas-wrapper,
.main-content {
    overflow: visible !important;
}

/* Cápsula do campo de busca: lupa à esquerda, input no centro, botões redondos dentro à direita */
.search-page-form .search-input-shell {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-height: 50px !important;
    background: #ffffff !important;
    border: 1px solid #e2e6ec !important;
    border-radius: 999px !important;
    padding: 4px 10px 4px 14px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
    gap: 8px !important;
    box-sizing: border-box !important;
}

/* Lupa fixa exclusivamente à esquerda */
.search-page-form .voice-left-lupa {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px !important;
    color: #e42f08 !important;
    font-size: 17px !important;
    pointer-events: none !important;
}

/* Campo de texto no centro */
.search-page-form .search-input-shell #searchInput.form-control {
    position: static !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 40px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 6px !important;
    margin: 0 !important;
    outline: none !important;
}

.search-page-form .search-input-shell #searchInput::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

/* Enquanto escuta, esconde o texto para exibir o espectro */
.search-page-form .search-input-shell.is-listening #searchInput.form-control {
    color: transparent !important;
}

.search-page-form .search-input-shell.is-listening #searchInput.form-control::placeholder {
    color: transparent !important;
}

/* Espectro compacto dentro do input à direita */
.search-page-form .voice-full-spectrum {
    position: static !important;
    display: none !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 2px !important;
    width: 76px !important;
    flex: 0 0 76px !important;
    height: 24px !important;
    pointer-events: none !important;
}

.search-page-form .voice-full-spectrum.is-active {
    display: flex !important;
}

.search-page-form .voice-full-bar {
    width: 3px;
    height: 5px;
    min-height: 4px;
    max-height: 20px;
    border-radius: 999px;
    background: #e42f08;
    transition: height 0.07s ease;
}

/* Grupo de botões redondos DENTRO do input à direita, lado a lado */
.search-page-form .voice-controls-cluster {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 5 !important;
}

/* Botões redondos um pouco maiores (38px) */
.search-page-form .voice-controls-cluster .voice-circle-btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    float: none !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    border: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-size: 18px !important;
    flex: 0 0 38px !important;
    box-shadow: none !important;
    transition: background-color 0.16s ease, transform 0.12s ease !important;
}

.search-page-form .voice-controls-cluster .voice-circle-btn i {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 18px !important;
}

.search-page-form .voice-controls-cluster .voice-btn-mic {
    background: #f1f3f5 !important;
    color: #e42f08 !important;
}

.search-page-form .voice-controls-cluster .voice-btn-mic:hover {
    background: #e2e6ea !important;
}

.search-page-form .voice-controls-cluster .voice-btn-mic.is-recording {
    background: #dc3545 !important;
    color: #ffffff !important;
}

/* Alternância limpa: microfone em repouso, quadrado branco SOMENTE durante gravação */
.search-page-form .voice-controls-cluster .voice-btn-mic #iconeMicCirculo {
    display: inline-block !important;
}

.search-page-form .voice-controls-cluster .voice-btn-mic.is-recording #iconeMicCirculo {
    display: none !important;
}

.search-page-form .voice-controls-cluster .voice-btn-mic .voice-square-marker {
    display: none !important;
    width: 12px !important;
    height: 12px !important;
    background: #ffffff !important;
    border-radius: 2px !important;
}

.search-page-form .voice-controls-cluster .voice-btn-mic.is-recording .voice-square-marker {
    display: block !important;
}

/* Botão de enviar vermelho com troca de cor no hover */
.search-page-form .voice-controls-cluster .voice-btn-send {
    display: none !important;
    background: #e42f08 !important;
    color: #ffffff !important;
}

.search-page-form .voice-controls-cluster .voice-btn-send.is-visible {
    display: inline-flex !important;
}

.search-page-form .voice-controls-cluster .voice-btn-send:hover {
    background: #b82204 !important;
    color: #ffffff !important;
}

/* Destaque em vermelho para o termo pesquisado */
.voice-highlight-term {
    color: #e42f08 !important;
    font-weight: 700;
}

/* Oculta botões antigos do tema */
.search-page-form .search-via-voice,
.search-page-form > form > #btnSubmitBusca,
.search-page-form > form > button[type="submit"] {
    display: none !important;
}

.voice-suggestions-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.voice-suggestions-label {
    font-size: 11px;
    color: #6c757d;
    font-weight: 600;
}

.voice-suggestion-chip {
    position: static !important;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #333;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.voice-suggestion-chip:hover {
    background: #e42f08;
    border-color: #e42f08;
    color: #fff;
}

.voice-results-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 999999;
    background: #ffffff;
    border: 1px solid #d8dee6;
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
    max-height: 360px;
    overflow-y: auto;
}

.voice-results-panel.is-open {
    display: block;
}

.voice-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #eceff3;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 2;
}

.voice-results-close {
    position: static !important;
    border: 0 !important;
    background: transparent !important;
    color: #666 !important;
    font-size: 15px !important;
    cursor: pointer;
    line-height: 1;
    width: auto !important;
    height: auto !important;
    padding: 0 4px !important;
}

.voice-results-panel .single-trending-post {
    cursor: pointer;
    margin-bottom: 0;
    border-bottom: 1px solid #f1f3f5;
    padding: 10px 14px;
    transition: background-color 0.15s ease;
}

.voice-results-panel .single-trending-post:last-child {
    border-bottom: 0;
}

.voice-results-panel .single-trending-post:hover {
    background-color: #fff8f6;
}

.voice-footer-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.voice-log-toggle,
.voice-log-link {
    position: static !important;
    border: 0 !important;
    background: transparent !important;
    color: #b0b7c0 !important;
    font-size: 11px !important;
    padding: 2px 4px !important;
    cursor: pointer;
    opacity: 0.75;
    text-decoration: none;
    width: auto !important;
    height: auto !important;
}

.voice-log-toggle:hover,
.voice-log-link:hover {
    opacity: 1;
    color: #6c757d !important;
}

.voice-log-drawer {
    display: none;
    margin-top: 6px;
    background: #14171c;
    color: #d7e0ea;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
    line-height: 1.4;
    max-height: 170px;
    overflow-y: auto;
}

.voice-log-drawer.is-open {
    display: block;
}

.voice-log-row {
    margin-bottom: 2px;
    word-break: break-word;
}

.voice-log-error {
    color: #ff6b6b;
    font-weight: 600;
}

@media (max-width: 767px) {
    .search-page-form .search-input-shell #searchInput.form-control {
        font-size: 16px !important;
    }

    .search-page-form .voice-full-spectrum {
        width: 52px !important;
        flex: 0 0 52px !important;
    }

    .search-page-form .voice-controls-cluster .voice-circle-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        flex: 0 0 34px !important;
        font-size: 16px !important;
    }

    .search-page-form .voice-controls-cluster .voice-circle-btn i {
        font-size: 16px !important;
    }
}