@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Share+Tech+Mono&display=swap');

:root {
    --neon-green: #00ff9d;
    --neon-blue: #00d4ff;
    --bg-dark: #050a0f;
    --glass: rgba(0, 255, 157, 0.05);
    --glass-border: rgba(0, 255, 157, 0.2);
    --font-main: 'Share Tech Mono', monospace;
    --font-display: 'Orbitron', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--neon-green);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Overlay de Scanline */
.scanline {
    width: 100%;
    height: 100px;
    z-index: 10;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 255, 157, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.1;
    position: absolute;
    bottom: 100%;
    animation: scanline 6s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% { bottom: 100%; }
    100% { bottom: -100px; }
}

.hud-container {
    width: 95vw;
    height: 90vh;
    background: rgba(4, 10, 18, 0.6);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 0 50px rgba(0, 255, 157, 0.05);
    z-index: 1; /* Contexto de empilhamento */
    overflow: hidden;
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Forçar para trás de tudo dentro do container */
    pointer-events: none; /* Garante que cliques passem através dele */
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
    position: relative;
    z-index: 5; /* Garante que fique à frente das partículas */
}

.system-status {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 2px;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--neon-green);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--neon-green);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.brand {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 5px;
    text-shadow: 0 0 15px var(--neon-green);
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    z-index: 5; /* Garante que o chat fique à frente */
}

/* Partículas Legadas Removidas */

/* Estado de Fala do Jarvis */
.talking #jarvis-core {
    background: radial-gradient(circle, #ff00ff 0%, transparent 70%);
    animation: corePulse 0.5s infinite ease-in-out;
}

.talking #jarvis-core::after {
    box-shadow: 
        0 0 20px #ff00ff,
        40px -60px 10px rgba(255, 0, 255, 0.5),
        -80px 20px 16px rgba(0, 212, 255, 0.5);
    animation: rotateDots 2s infinite linear;
}

.welcome-msg {
    color: var(--neon-blue);
    margin-bottom: 30px;
    border-left: 2px solid var(--neon-blue);
    padding-left: 15px;
}

.jarvis-response {
    background: rgba(0, 212, 255, 0.05);
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid var(--neon-blue);
    max-width: 80%;
    line-height: 1.6;
}

.user-query {
    align-self: flex-end;
    background: rgba(0, 255, 157, 0.05);
    padding: 15px;
    border-radius: 4px;
    border-right: 3px solid var(--neon-green);
    max-width: 80%;
    text-align: right;
}

footer {
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    position: relative;
    z-index: 10; /* Garante que o input seja clicável */
}

/* === PAINEL DE CONTROLES DE VOZ === */
.voice-controls-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.3);
    flex-wrap: wrap;
    position: relative;
    z-index: 10; /* Garante que os botões (MIC/VOZ) funcionem */
}

.voice-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 1px;
}

.voice-selector-wrapper label {
    color: var(--neon-blue);
    white-space: nowrap;
}

#voice-select {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--neon-blue);
    color: var(--neon-green);
    font-family: var(--font-main);
    font-size: 11px;
    padding: 4px 8px;
    outline: none;
    cursor: pointer;
    max-width: 220px;
    border-radius: 2px;
}

#voice-select option {
    background: #050a0f;
    color: var(--neon-green);
}

/* Slider de Velocidade */
#voice-speed {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: var(--glass-border);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

#voice-speed::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--neon-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-blue);
}

#speed-value {
    font-size: 10px;
    color: var(--neon-blue);
    min-width: 30px;
}

/* Toggle Groups */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--neon-green);
    white-space: nowrap;
    min-width: 70px;
}

/* Toggle Switch Neon */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    flex: unset;
    border: none;
    padding: 0;
}

.slider-toggle {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-radius: 22px;
    transition: 0.3s;
}

.slider-toggle::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: rgba(0, 255, 157, 0.4);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .slider-toggle {
    background: rgba(0, 255, 157, 0.15);
    border-color: var(--neon-green);
    box-shadow: 0 0 8px rgba(0, 255, 157, 0.4);
}

.toggle-switch input:checked + .slider-toggle::before {
    transform: translateX(22px);
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
}

/* Mic OFF → label fica apagado */
.toggle-label.mic-off {
    color: rgba(0, 255, 157, 0.35);
}

/* Botão de Microfone */
.mic-btn {
    background: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    font-size: 16px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-btn:hover {
    background: rgba(0,255,157,0.1);
    box-shadow: 0 0 14px var(--neon-green);
}

.mic-btn.listening {
    background: rgba(255, 0, 80, 0.2);
    border-color: #ff0050;
    color: #ff0050;
    box-shadow: 0 0 18px #ff0050;
    animation: micPulse 0.8s infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 10px #ff0050; }
    50% { box-shadow: 0 0 28px #ff0050; }
}



.input-area {
    display: flex;
    gap: 15px;
}

input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 15px;
    color: var(--neon-green);
    font-family: var(--font-main);
    outline: none;
}

button {
    background: var(--neon-green);
    color: var(--bg-dark);
    border: none;
    padding: 0 30px;
    font-family: var(--font-display);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background: var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue);
}

/* Cantos Decorativos */
.corner-top-left, .corner-bottom-right {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid var(--neon-green);
}

.corner-top-left {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.corner-bottom-right {
    bottom: -2px;
    right: -2px;
    border-top: none;
    border-left: none;
}

/* ── CARD DE CONFIRMAÇÃO DE LANÇAMENTO ── */
.confirm-card {
    border: 1px solid #ffaa00;
    background: rgba(255, 170, 0, 0.06);
    border-radius: 4px;
    padding: 16px 20px;
    margin: 8px 0;
    animation: fadeInCard 0.3s ease;
    z-index: 10;
    position: relative;
}

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

.confirm-title {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 3px;
    color: #ffaa00;
    text-shadow: 0 0 10px #ffaa00;
    margin-bottom: 10px;
}

.confirm-resumo {
    color: var(--neon-green);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 10px;
}

.confirm-aviso {
    font-size: 11px;
    color: rgba(255, 170, 0, 0.7);
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.confirm-btns {
    display: flex;
    gap: 12px;
}

.btn-confirmar {
    background: rgba(0, 255, 157, 0.15);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    font-family: var(--font-display);
    font-size: 11px;
    padding: 8px 20px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s;
    border-radius: 2px;
}

.btn-confirmar:hover {
    background: rgba(0, 255, 157, 0.3);
    box-shadow: 0 0 16px rgba(0, 255, 157, 0.4);
}

.btn-cancelar {
    background: rgba(255, 50, 50, 0.1);
    border: 1px solid rgba(255, 50, 50, 0.5);
    color: rgba(255, 100, 100, 0.9);
    font-family: var(--font-display);
    font-size: 11px;
    padding: 8px 20px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s;
    border-radius: 2px;
}

.btn-cancelar:hover {
    background: rgba(255, 50, 50, 0.2);
    box-shadow: 0 0 12px rgba(255, 50, 50, 0.3);
}

