/* =========================================================================
   ATHENA — UI PRO Pack 2026
   ----------------------------------------------------------------------
   Features:
     1) Command Palette (Cmd+K)
     2) Briefing IA matinal (card visual)
     3) Anomaly highlight (badge à esquerda)
     4) Voice alerts toggle
     5) Sticky Comparison Bar
     6) Picture-in-Picture
     7) Live Cursors (multi-operator)
   ========================================================================= */


/* ─── 1) Command Palette ─────────────────────────────────────────────────── */
.athena-cmd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 14, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    animation: cmdOverlayIn .15s ease-out;
}
.athena-cmd-overlay.open { display: flex; }
@keyframes cmdOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.athena-cmd-panel {
    width: min(640px, 92vw);
    background: linear-gradient(180deg, #0e0e16 0%, #06060d 100%);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px;
    box-shadow: 0 32px 80px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06);
    overflow: hidden;
    animation: cmdPanelIn .2s cubic-bezier(.16,1,.3,1);
}
@keyframes cmdPanelIn { from { transform: translateY(-10px); opacity: 0; } }

.athena-cmd-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.athena-cmd-input-wrap::before {
    content: '⌕';
    font-size: 18px;
    color: rgba(255,255,255,.5);
}
.athena-cmd-input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: #fff;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
}
.athena-cmd-input::placeholder { color: rgba(255,255,255,.35); }

.athena-cmd-kbd-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.5);
    padding: 3px 6px;
    border-radius: 4px;
}

.athena-cmd-list {
    max-height: 52vh;
    overflow-y: auto;
    padding: 8px 0;
}
.athena-cmd-section {
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(255,170,0,.7);
    font-weight: 700;
    padding: 8px 18px 4px;
    text-transform: uppercase;
}
.athena-cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background .12s;
    color: #fff;
    font-size: 14px;
}
.athena-cmd-item.active,
.athena-cmd-item:hover {
    background: rgba(255,102,0,.08);
}
.athena-cmd-item.active {
    box-shadow: inset 3px 0 0 #ff681f;
}
.athena-cmd-item-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.athena-cmd-item-label { flex: 1; }
.athena-cmd-item-shortcut {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(255,255,255,.4);
}
.athena-cmd-empty {
    padding: 24px 18px;
    text-align: center;
    color: rgba(255,255,255,.4);
    font-size: 13px;
}


/* ─── 2) Briefing IA matinal — card visual ───────────────────────────────── */
.athena-briefing {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 18px 22px;
    margin: 16px 0;
    background: linear-gradient(135deg, rgba(255,170,0,.08) 0%, rgba(255,102,0,.04) 100%);
    border: 1px solid rgba(255,170,0,.18);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}
.athena-briefing::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, #ffaa00 0%, transparent 100%);
}
.athena-briefing-icon {
    font-size: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(255,170,0,.4));
}
.athena-briefing-content { flex: 1; }
.athena-briefing-greeting {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.athena-briefing-time {
    font-size: 11px;
    color: rgba(255,170,0,.7);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.athena-briefing-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.athena-briefing-bullets li {
    font-size: 13px;
    color: rgba(255,255,255,.85);
    line-height: 1.4;
    padding-left: 22px;
    position: relative;
}
.athena-briefing-bullets li::before {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 14px;
}
.athena-briefing-bullets li.bullet-warn::before  { content: '⚠'; color: #ffaa00; }
.athena-briefing-bullets li.bullet-crit::before  { content: '🔴'; }
.athena-briefing-bullets li.bullet-tip::before   { content: '💡'; }
.athena-briefing-bullets li.bullet-ok::before    { content: '✅'; }
.athena-briefing-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.athena-briefing-btn {
    background: rgba(255,170,0,.15);
    border: 1px solid rgba(255,170,0,.3);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}
.athena-briefing-btn:hover {
    background: rgba(255,170,0,.25);
    border-color: rgba(255,170,0,.5);
}
.athena-briefing-btn.dismiss {
    background: transparent;
    border-color: rgba(255,255,255,.1);
    color: rgba(255,255,255,.55);
}


/* ─── 3) Anomaly highlight (badge à ESQUERDA do val) ─────────────────────── */
/* O badge fica FORA do flow normal — position absolute relativo ao val.
   right: 100% + margin-right empurra ele pra ESQUERDA do val sem ocupar
   espaco. Numeros continuam alinhados na coluna da direita. */
.mc-row-val,
.mc-vital-value {
    position: relative;
}
.athena-anomaly-badge {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0;
    white-space: nowrap;
    flex-shrink: 0;
    pointer-events: none;
}
.athena-anomaly-badge.up   { background: rgba(255,68,68,.2);  color: #ff7a7a; border: 1px solid rgba(255,68,68,.4); }
.athena-anomaly-badge.down { background: rgba(0,170,255,.2);  color: #6ad6ff; border: 1px solid rgba(0,170,255,.4); }


/* ─── 4) Voice Alerts toggle ─────────────────────────────────────────────── */
/* 2026-06: movido de bottom-left → bottom-right pra nao sobrepor a sidebar
   esquerda (botoes MAPA / COMPARAR / CONFIGURAÇÕES / SAIR DO SISTEMA).
   A tooltip ("Voz ATHENA: ligada/desligada") tambem migrou: agora aparece
   no lado esquerdo do botao (right: 52px) com slide-in da direita. */
.athena-voice-toggle {
    position: fixed;
    bottom: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(10,12,18,.85);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 9999;
    transition: all .2s;
    backdrop-filter: blur(8px);
}
.athena-voice-toggle:hover {
    background: rgba(20,24,36,.9);
    transform: scale(1.08);
}
.athena-voice-toggle.on {
    background: linear-gradient(135deg, #00ff88, #00aaff);
    color: #000;
    border-color: transparent;
    box-shadow: 0 0 16px rgba(0,255,136,.4);
}
.athena-voice-toggle-label {
    position: absolute;
    right: 52px;
    background: rgba(10,12,18,.95);
    border: 1px solid rgba(255,255,255,.12);
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(6px);
    transition: all .15s;
}
.athena-voice-toggle:hover .athena-voice-toggle-label {
    opacity: 1;
    transform: translateX(0);
}


/* ─── 5) Sticky Comparison Bar ───────────────────────────────────────────── */
.athena-cmp-bar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    display: none;
    z-index: 9990;
    background: linear-gradient(180deg, rgba(14,14,26,.98), rgba(6,6,16,.99));
    border: 1px solid rgba(255,102,0,.3);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 24px rgba(255,102,0,.15);
    padding: 14px 20px;
    backdrop-filter: blur(10px);
    transition: transform .35s cubic-bezier(.16,1,.3,1);
    max-width: calc(100vw - 32px);
}
.athena-cmp-bar.visible {
    display: flex;
    transform: translateX(-50%) translateY(0);
}
.athena-cmp-bar-trucks {
    display: flex;
    gap: 14px;
    align-items: center;
}
.athena-cmp-truck {
    min-width: 130px;
    padding: 8px 12px;
    background: rgba(255,255,255,.04);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    position: relative;
}
.athena-cmp-truck-id {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,170,0,.85);
    margin-bottom: 4px;
}
.athena-cmp-truck-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: rgba(255,255,255,.7);
    font-family: 'JetBrains Mono', monospace;
}
.athena-cmp-truck-row b { color: #fff; font-weight: 700; }
.athena-cmp-truck-remove {
    position: absolute;
    top: 2px;
    right: 4px;
    background: transparent;
    border: 0;
    color: rgba(255,255,255,.4);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
}
.athena-cmp-truck-remove:hover { color: #ff6666; }
.athena-cmp-bar-close {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.7);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 14px;
}
.athena-cmp-add-btn {
    background: rgba(255,102,0,.1);
    border: 1px dashed rgba(255,102,0,.4);
    color: #ff681f;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}


/* ─── 6) Picture-in-Picture ──────────────────────────────────────────────── */
/* Estilos aplicados DENTRO da janela PiP secundaria */
.athena-pip-doc body {
    margin: 0;
    background: #060810;
    color: #fff;
    font-family: 'Inter', sans-serif;
    padding: 12px;
    overflow: hidden;
}
.athena-pip-card {
    background: linear-gradient(180deg, #0e0e16 0%, #06060d 100%);
    border: 1px solid rgba(255,102,0,.3);
    border-radius: 10px;
    padding: 14px;
    height: calc(100vh - 24px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.athena-pip-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ff681f;
    margin-bottom: 6px;
}
.athena-pip-truck {
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 12px;
}
.athena-pip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.athena-pip-kpi {
    background: rgba(255,255,255,.04);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}
.athena-pip-kpi-val {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
}
.athena-pip-kpi-lbl {
    font-size: 8px;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,.5);
    margin-top: 2px;
}
.athena-pip-status {
    margin-top: auto;
    padding: 6px;
    border-radius: 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}
.athena-pip-status.ok    { background: rgba(0,255,136,.15); color: #00ff88; }
.athena-pip-status.warn  { background: rgba(255,170,0,.15); color: #ffaa00; }
.athena-pip-status.crit  { background: rgba(255,68,68,.18); color: #ff6666; }

/* Botão na página principal pra abrir PiP */
.athena-pip-open-btn {
    background: rgba(0,170,255,.1);
    border: 1px solid rgba(0,170,255,.3);
    color: #4ccfff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.athena-pip-open-btn:hover {
    background: rgba(0,170,255,.18);
}


/* ─── 7) Live Cursors (multi-operator) ───────────────────────────────────── */
.athena-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 99990;
    transform: translate(-2px, -2px);
    transition: transform .08s linear;
}
.athena-cursor-pointer {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
.athena-cursor-name {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--cursor-color, #ff681f);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 14px;
    margin-top: -4px;
    white-space: nowrap;
    letter-spacing: .5px;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════
   MODO CLARO 2026-06 — Command Palette + Comparison Bar.
   Injetados em document.body (fora do wrapper). Com light-theme no <body>
   (athenaApplyBodyTheme), estes overrides passam a alcanca-los.
   ═══════════════════════════════════════════════════════════════════ */
.light-theme .athena-cmd-overlay { background: rgba(20,24,34,.45); }
.light-theme .athena-cmd-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f4f6fa 100%);
    border-color: rgba(0,0,0,.12);
    box-shadow: 0 32px 80px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.6);
}
.light-theme .athena-cmd-input-wrap { border-bottom-color: rgba(0,0,0,.08); }
.light-theme .athena-cmd-input-wrap::before { color: rgba(0,0,0,.45); }
.light-theme .athena-cmd-input { color: #15151a; }
.light-theme .athena-cmd-input::placeholder { color: rgba(0,0,0,.4); }
.light-theme .athena-cmd-kbd-hint {
    background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.12); color: rgba(0,0,0,.5);
}
.light-theme .athena-cmd-item { color: #15151a; }
.light-theme .athena-cmd-item-shortcut { color: rgba(0,0,0,.45); }
.light-theme .athena-cmd-empty { color: rgba(0,0,0,.45); }

.light-theme .athena-cmp-bar {
    background: linear-gradient(180deg, #ffffff, #f4f6fa);
    border-color: rgba(255,102,0,.45);
    box-shadow: 0 24px 60px rgba(0,0,0,.20), 0 0 24px rgba(255,102,0,.10);
}
.light-theme .athena-cmp-truck { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.10); }
.light-theme .athena-cmp-truck-row { color: rgba(0,0,0,.65); }
.light-theme .athena-cmp-truck-row b { color: #15151a; }
.light-theme .athena-cmp-truck-remove { color: rgba(0,0,0,.4); }
.light-theme .athena-cmp-bar-close {
    background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.12); color: rgba(0,0,0,.65);
}


/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .athena-cmd-overlay, .athena-cmd-panel,
    .athena-cmp-bar, .athena-cursor {
        animation: none !important;
        transition: none !important;
    }
}
