﻿/**
 * ============================================================
 * ROSCOE IMÓVEIS - COMPONENTE BUSCA POR VOZ (CSS)
 * ============================================================
 * Identidade visual: Vinho (#820000), Dourado Champanhe (#ebdfaf)
 */

/* 1. Botão Flutuante */
#roscoe-voice-btn {
    position: fixed;
    right: 30px;
    bottom: 82px; /* logo acima do whatsapp (20px + 50px + 12px) */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #820000;
    border: 2px solid #ebdfaf;
    color: #ebdfaf;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(130, 0, 0, 0.4);
    z-index: 99998;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.25s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

#roscoe-voice-btn:hover,
#roscoe-voice-btn:focus-visible {
    transform: translateY(-2px) scale(1.07);
    background: #960000;
    box-shadow: 0 6px 20px rgba(130, 0, 0, 0.6), 0 0 12px rgba(235, 223, 175, 0.4);
    color: #ffffff;
    border-color: #ffffff;
}

#roscoe-voice-btn:active {
    transform: scale(0.96);
}

#roscoe-voice-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

#roscoe-voice-btn:hover svg {
    transform: scale(1.08);
}

/* Anel de pulso sutil em repouso */
.roscoe-voice-btn-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(235, 223, 175, 0.45);
    animation: roscoeVoiceSubtlePulse 3s infinite ease-out;
    pointer-events: none;
}

@keyframes roscoeVoiceSubtlePulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.22);
        opacity: 0;
    }
    100% {
        transform: scale(1.22);
        opacity: 0;
    }
}

/* Tooltip lateral */
.roscoe-voice-tooltip {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: rgba(30, 5, 5, 0.95);
    color: #ebdfaf;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(235, 223, 175, 0.3);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-family: inherit;
}

.roscoe-voice-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border-width: 5px 0 5px 5px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(30, 5, 5, 0.95);
}

#roscoe-voice-btn:hover .roscoe-voice-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* 2. Modal Overlay */
#roscoe-voice-modal {
    position: fixed;
    inset: 0;
    background: rgba(14, 3, 3, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

#roscoe-voice-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Card */
.roscoe-voice-card {
    position: relative;
    background: linear-gradient(160deg, #240707 0%, #140202 100%);
    border: 1px solid rgba(235, 223, 175, 0.35);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    padding: 36px 30px 28px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(130, 0, 0, 0.3);
    transform: scale(0.92) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#roscoe-voice-modal.is-open .roscoe-voice-card {
    transform: scale(1) translateY(0);
}

/* Botão Fechar */
.roscoe-voice-close-btn {
    position: absolute;
    top: 16px;
    right: 18px;
    background: transparent;
    border: none;
    color: rgba(235, 223, 175, 0.7);
    font-size: 26px;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.roscoe-voice-close-btn:hover {
    color: #ffffff;
    background: rgba(235, 223, 175, 0.15);
}

/* Header */
.roscoe-voice-brand {
    display: inline-block;
    color: #ebdfaf;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.roscoe-voice-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.roscoe-voice-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    margin: 0 0 26px 0;
    line-height: 1.4;
}

/* Microfone Central Animado */
.roscoe-voice-mic-wrapper {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roscoe-voice-mic-action {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #820000;
    border: 3px solid #ebdfaf;
    color: #ebdfaf;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(130, 0, 0, 0.5);
    transition: all 0.25s ease;
    z-index: 2;
    padding: 0;
}

.roscoe-voice-mic-action svg {
    width: 36px;
    height: 36px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.roscoe-voice-mic-action:hover {
    transform: scale(1.05);
    background: #9b0000;
}

/* Ondas Acústicas (Radar / Sound Waves) */
.roscoe-voice-wave {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #ebdfaf;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.is-listening .roscoe-voice-wave-1 {
    animation: roscoeAcousticWave 1.8s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

.is-listening .roscoe-voice-wave-2 {
    animation: roscoeAcousticWave 1.8s infinite cubic-bezier(0, 0.2, 0.8, 1) 0.6s;
}

.is-listening .roscoe-voice-wave-3 {
    animation: roscoeAcousticWave 1.8s infinite cubic-bezier(0, 0.2, 0.8, 1) 1.2s;
}

@keyframes roscoeAcousticWave {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.85);
        opacity: 0;
    }
}

/* Indicador de Status */
.roscoe-voice-status {
    color: #ebdfaf;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    min-height: 22px;
    margin-bottom: 14px;
    transition: color 0.2s ease;
}

.is-processing .roscoe-voice-status {
    color: #ffde59;
}

/* Caixa de Transcrição da Fala */
.roscoe-voice-transcript-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(235, 223, 175, 0.25);
    border-radius: 12px;
    padding: 16px;
    min-height: 58px;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roscoe-voice-transcript {
    color: #ffffff;
    font-size: 16px;
    font-style: italic;
    line-height: 1.4;
    word-break: break-word;
}

.roscoe-voice-transcript.is-placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-style: normal;
    font-size: 14px;
}

/* Sugestões e Frases de Exemplo */
.roscoe-voice-suggestions-label {
    color: rgba(235, 223, 175, 0.8);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    text-align: left;
}

.roscoe-voice-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.roscoe-voice-chip {
    background: rgba(235, 223, 175, 0.08);
    border: 1px solid rgba(235, 223, 175, 0.3);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.roscoe-voice-chip:hover {
    background: #ebdfaf;
    color: #820000;
    border-color: #ebdfaf;
    transform: translateY(-1px);
}

/* Fallback de Digitação */
.roscoe-voice-fallback-form {
    display: none;
    margin-top: 15px;
}

.roscoe-voice-fallback-form.is-active {
    display: flex;
    gap: 8px;
}

.roscoe-voice-fallback-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(235, 223, 175, 0.4);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.roscoe-voice-fallback-input:focus {
    border-color: #ebdfaf;
    box-shadow: 0 0 8px rgba(235, 223, 175, 0.3);
}

.roscoe-voice-fallback-btn {
    background: #820000;
    color: #ebdfaf;
    border: 1px solid #ebdfaf;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.roscoe-voice-fallback-btn:hover {
    background: #9b0000;
    color: #ffffff;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    #roscoe-voice-btn {
        right: 30px;
        bottom: 78px;
        width: 48px;
        height: 48px;
    }
    .roscoe-voice-tooltip {
        display: none !important;
    }
    .roscoe-voice-card {
        padding: 28px 18px 22px;
        border-radius: 16px;
    }
    .roscoe-voice-title {
        font-size: 19px;
    }
    .roscoe-voice-subtitle {
        font-size: 12px;
        margin-bottom: 18px;
    }
    .roscoe-voice-mic-wrapper {
        width: 80px;
        height: 80px;
        margin-bottom: 16px;
    }
    .roscoe-voice-mic-action {
        width: 68px;
        height: 68px;
    }
    .roscoe-voice-mic-action svg {
        width: 30px;
        height: 30px;
    }
    .roscoe-voice-chip {
        font-size: 11px;
        padding: 5px 10px;
    }
}
