/* =========================================================
   ESTILOS GERAIS DA TELA
   ========================================================= */
body {
    background-color: #808080; /* Cor de fundo cinza padrão de telas de radar ATC (Sagitario/X-Muda) */
    margin: 0;                 /* Remove margens brancas padrão do navegador */
    overflow: hidden;          /* Trava a tela e esconde as barras de rolagem nativas (crucial para o pan/zoom do canvas não bugar) */
    color: white;
    font-family: monospace;    /* Fonte monoespaçada (tipo máquina de escrever) mantém os caracteres alinhados na etiqueta do avião */
    cursor: default;           /* Força a seta padrão, evitando que o rato vire o cursor de texto (I-beam) ao passar por cima de textos invisíveis */
}

canvas {
    display: block;            /* Remove o pequeno espaçamento em branco que o canvas cria na parte inferior por padrão */
}

/* =========================================================
   MENUS DE CONTEXTO (DROPDOWNS: NÍVEIS DE VOO, PROA E VELOCIDADE)
   ========================================================= */
#menuNivel, #menuVelocidade {
    position: absolute;        /* Permite que o JavaScript coloque o menu exatamente nas coordenadas do clique do rato (X, Y) */
    background-color: #2b2b2b;
    border: 1px solid #00ffff; /* Borda ciano para combinar com o tema do radar */
    color: white;
    font-family: monospace;
    font-size: 13px;
    max-height: 160px;         /* Limita a altura do menu. Se a lista passar disso, cria barra de rolagem */
    overflow-y: auto;          /* Ativa a rolagem vertical automaticamente se necessário */
    z-index: 100;              /* Força o menu a ficar por cima de TUDO no ecrã (canvas = 0, painel = 10) */
    box-shadow: 2px 2px 8px rgba(0,0,0,0.6); /* Cria uma leve sombra para dar efeito 3D flutuante */
    display: none;             /* Começa escondido */
    border-radius: 4px;        /* Arredonda levemente os cantos */
    min-width: 55px;
}

#menuProa {
    position: absolute;
    background-color: #2b2b2b;
    border: 1px solid #00ffff;
    color: white;
    font-family: monospace;
    font-size: 13px;
    z-index: 100;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.6);
    display: none;
    border-radius: 4px;
    min-width: 55px;
    overflow: hidden;
}

.menu-proa-lista {
    max-height: 140px;
    overflow-y: auto;
}

.menu-proa-footer {
    display: flex;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    background-color: #222222;
    padding: 3px 4px;
    gap: 4px;
    justify-content: center;
}

.btn-curva {
    flex: 1;
    background-color: #1a1a1a;
    color: #00ffff;
    border: 1px solid #444;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    padding: 3px 0;
    text-align: center;
    transition: all 0.15s ease;
}

.btn-curva:hover {
    background-color: #00ffff;
    color: #000;
    border-color: #00ffff;
}

.btn-curva.ativo {
    background-color: #00ffff;
    color: #000;
    border-color: #00ffff;
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.8);
}

/* Cada opção individual dentro dos menus */
.menu-item {
    padding: 6px 12px;
    cursor: pointer;           /* Muda o rato para a "mãozinha" para indicar que é clicável */
    text-align: center;
}

/* Efeito visual quando o rato passa por cima de uma opção de nível */
.menu-item:hover {
    background-color: #00ffff; /* Fica ciano */
    color: #000;               /* O texto fica preto para dar contraste com o ciano */
    font-weight: bold;
}

/* Estilização personalizada da barra de rolagem dos menus */
#menuNivel::-webkit-scrollbar,
#menuVelocidade::-webkit-scrollbar,
.menu-proa-lista::-webkit-scrollbar {
    width: 8px;
}

#menuNivel::-webkit-scrollbar-track,
#menuVelocidade::-webkit-scrollbar-track,
.menu-proa-lista::-webkit-scrollbar-track {
    background: #2b2b2b;
}

#menuNivel::-webkit-scrollbar-thumb,
#menuVelocidade::-webkit-scrollbar-thumb,
.menu-proa-lista::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

#menuNivel::-webkit-scrollbar-thumb:hover,
#menuVelocidade::-webkit-scrollbar-thumb:hover,
.menu-proa-lista::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* =========================================================
   PAINEL DE CONTROLO DE FLUXO E ESTEIRA (Canto Superior Esquerdo)
   ========================================================= */
.btn-topo-fluxo {
    position: absolute;
    top: 12px;
    left: 54px;
    background-color: rgba(43, 43, 43, 0.9);
    border: 1px solid #00ffff;
    color: #00ffff;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    padding: 0 12px;
    height: 34px;
    box-sizing: border-box;
    border-radius: 4px;
    cursor: pointer;
    z-index: 15;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    user-select: none;
}

.btn-topo-fluxo:hover {
    background-color: #00ffff;
    color: #000;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.btn-topo-fluxo.ativo {
    background-color: #00ffff;
    color: #000;
    font-weight: bold;
}

.icone-relogio {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

#painelFluxo {
    position: absolute;        /* Fica a flutuar por cima do canvas */
    top: 52px;                 /* Posicionado logo abaixo do botão de fluxo */
    left: 54px;                /* Alinhado com o botão de fluxo */
    background-color: rgba(28, 28, 28, 0.95); /* Fundo cinza escuro com 95% de opacidade como o vento */
    border: 1px solid #00ffff;
    padding: 12px 16px;
    border-radius: 6px;
    z-index: 20;               /* Fica acima do Canvas */
    box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-family: monospace;
    min-width: 320px;
    max-width: 480px;
    max-height: calc(100vh - 75px);
    overflow-y: auto;
}

#painelFluxo::-webkit-scrollbar { width: 6px; }
#painelFluxo::-webkit-scrollbar-track { background: #1c1c1c; }
#painelFluxo::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
#painelFluxo::-webkit-scrollbar-thumb:hover { background: #00ffff; }

.cabecalho-painel-fluxo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    gap: 10px;
}

.cabecalho-fluxo-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00ffff;
}

.cabecalho-fluxo-titulo h3 {
    margin: 0;
    font-size: 13px;
    color: #00ffff;
    letter-spacing: 0.5px;
}

.cabecalho-fluxo-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fechar-fluxo {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    font-family: monospace;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s ease;
}

.btn-fechar-fluxo:hover {
    color: #ff5555;
}

.btn-pause-fluxo {
    background-color: #003333;
    color: #00ffff;
    border: 1px solid #00ffff;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    line-height: 1;
}

.btn-pause-fluxo:hover {
    background-color: #006666;
    color: #ffffff;
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.6);
}

.btn-pause-fluxo.pausado {
    background-color: #4a2800;
    border-color: #ff9900;
    color: #ffaa00;
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
    animation: pulsarPausa 1.2s infinite alternate ease-in-out;
}

.btn-pause-fluxo.pausado:hover {
    background-color: #6b3a00;
    color: #ffffff;
}

@keyframes pulsarPausa {
    0% {
        box-shadow: 0 0 4px rgba(255, 170, 0, 0.4);
        border-color: #ff9900;
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 170, 0, 0.9);
        border-color: #ffcc00;
    }
}

.btn-adicionar-fluxo {
    background-color: #003333;
    color: #00ffff;
    border: 1px solid #00ffff;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-adicionar-fluxo:hover {
    background-color: #006666;
    color: #ffffff;
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.6);
}

/* Estrutura de cada esteira dinâmica */
.linha-esteira {
    margin-bottom: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 6px;
    border-radius: 3px;
    border: 1px solid rgba(100, 100, 100, 0.4);
}

.linha-esteira .chk-esteira-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.linha-esteira select.sel-fixo {
    background-color: #111;
    color: #ff9900;
    border: 1px solid #666;
    font-family: monospace;
    font-weight: bold;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 2px;
    max-width: 85px;
}

.linha-esteira select.sel-sep {
    background-color: #111;
    color: #00ffff;
    border: 1px solid #666;
    font-family: monospace;
    font-weight: bold;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 2px;
    max-width: 75px;
}

.btn-remover-esteira {
    background: transparent;
    color: #ff4444;
    border: 1px solid #662222;
    border-radius: 2px;
    font-family: monospace;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    padding: 1px 5px;
    line-height: 1;
}

.btn-remover-esteira:hover {
    background-color: #ff2222;
    color: #fff;
}

/* Estrutura de cada linha genérica de opção dentro do painel */
.linha-fluxo {
    margin-bottom: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.linha-fluxo select {
    background-color: #111;
    color: #00ffff;
    border: 1px solid #666;
    font-family: monospace;
    font-weight: bold;
    margin-left: 10px;
    padding: 2px;
}

.linha-fluxo label {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.linha-fluxo input[type="checkbox"],
.linha-esteira input[type="checkbox"] {
    margin-right: 4px;
    cursor: pointer;
}

/* =========================================================
   CONTROLE DE VELOCIDADE DA SIMULAÇÃO (Slider)
   ========================================================= */
.divisor-painel {
    height: 1px;
    background-color: rgba(0, 255, 255, 0.3);
    margin: 10px 0;
}

.secao-velocidade {
    display: flex;
    flex-direction: column;
}

#labelVelocidade {
    color: #00ffff;
    font-weight: bold;
    font-family: monospace;
    font-size: 13px;
    background-color: #111;
    border: 1px solid #666;
    padding: 2px 6px;
    min-width: 32px;
    text-align: center;
}

#sliderVelocidade {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #111;
    border: 1px solid #666;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin: 8px 0 4px 0;
}

#sliderVelocidade::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00ffff;
    border: 1px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.8);
    transition: transform 0.1s ease;
}

#sliderVelocidade::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: #ffffff;
}

#sliderVelocidade::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00ffff;
    border: 1px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.8);
}

#sliderVelocidade::-moz-range-thumb:hover {
    transform: scale(1.15);
    background: #ffffff;
}

.ticks-velocidade {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    padding: 0 2px;
    user-select: none;
}

/* =========================================================
   PAINEL DE CONTROLE DE VENTO ATC & INSTRUMENTO CIRCULAR
   ========================================================= */
.btn-topo-vento {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(43, 43, 43, 0.9);
    border: 1px solid #00ffff;
    color: #00ffff;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    padding: 7px 14px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 15;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
}

.btn-topo-vento:hover {
    background-color: #00ffff;
    color: #000;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.btn-topo-vento.ativo {
    background-color: #00ffff;
    color: #000;
    font-weight: bold;
}

.painel-vento-flutuante {
    position: absolute;
    top: 52px;
    right: 15px;
    width: 460px;
    max-height: calc(100vh - 75px);
    overflow-y: auto;
    background-color: rgba(28, 28, 28, 0.95);
    border: 1px solid #00ffff;
    border-radius: 6px;
    padding: 12px 16px;
    z-index: 20;
    box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-family: monospace;
}

.painel-vento-flutuante::-webkit-scrollbar { width: 6px; }
.painel-vento-flutuante::-webkit-scrollbar-track { background: #1c1c1c; }
.painel-vento-flutuante::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
.painel-vento-flutuante::-webkit-scrollbar-thumb:hover { background: #00ffff; }

.cabecalho-vento {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.cabecalho-vento h3 {
    margin: 0;
    font-size: 13px;
    color: #00ffff;
    letter-spacing: 1px;
}

.btn-fechar-vento {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    font-family: monospace;
    padding: 0 4px;
}

.btn-fechar-vento:hover {
    color: #ff5555;
}

.abas-vento {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.aba-btn {
    flex: 1;
    background-color: #1e1e1e;
    color: #888;
    border: 1px solid #444;
    padding: 6px;
    font-size: 11px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s ease;
    text-align: center;
}

.aba-btn:hover {
    color: #fff;
    border-color: #666;
}

.aba-btn.ativa {
    background-color: rgba(0, 255, 255, 0.15);
    color: #00ffff;
    border-color: #00ffff;
}

/* --- TABELA DE CAMADAS GLOBAIS --- */
.tabela-vento {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 10px;
}

.tabela-vento th {
    background-color: #1a1a1a;
    color: #00ffff;
    padding: 6px 4px;
    border: 1px solid #333;
    text-align: center;
    font-weight: bold;
}

.tabela-vento td {
    padding: 4px;
    border: 1px solid #333;
    text-align: center;
    background-color: rgba(20, 20, 20, 0.6);
}

.tabela-vento input[type="number"] {
    background-color: #111;
    border: 1px solid #555;
    color: #00ffff;
    font-family: monospace;
    font-size: 11px;
    width: 52px;
    padding: 2px 4px;
    text-align: center;
    border-radius: 2px;
}

.tabela-vento input[type="number"]:focus {
    border-color: #00ffff;
    outline: none;
}

.tabela-vento input[type="number"]:disabled {
    background-color: #141c1f;
    border-color: #243b44;
    color: #00ff88;
    cursor: not-allowed;
    opacity: 0.9;
    font-weight: bold;
}

.tabela-vento input[type="checkbox"] {
    cursor: pointer;
}

.btn-del-camada {
    background: transparent;
    border: 1px solid #555;
    color: #ff5555;
    font-size: 11px;
    cursor: pointer;
    padding: 1px 6px;
    border-radius: 2px;
}

.btn-del-camada:hover {
    background: #ff5555;
    color: #000;
}

.form-nova-camada {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    background-color: rgba(20, 20, 20, 0.7);
    padding: 8px;
    border: 1px dashed #444;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 11px;
}

.form-nova-camada label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-nova-camada input[type="number"] {
    background-color: #111;
    border: 1px solid #555;
    color: #00ffff;
    font-family: monospace;
    font-size: 11px;
    width: 48px;
    padding: 2px;
    text-align: center;
}

.btn-add-camada {
    background-color: #1a332a;
    border: 1px solid #00ff88;
    color: #00ff88;
    font-family: monospace;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    margin-left: auto;
}

.btn-add-camada:hover {
    background-color: #00ff88;
    color: #000;
}

/* --- SEÇÃO CABECEIRAS / AERÓDROMOS --- */
.selecao-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.pill-btn {
    flex: 1;
    background-color: #1e1e1e;
    color: #aaa;
    border: 1px solid #444;
    padding: 5px;
    font-size: 11px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    text-align: center;
}

.pill-btn:hover {
    color: #fff;
    border-color: #888;
}

.pill-btn.ativa {
    background-color: #00ffff;
    color: #000;
    border-color: #00ffff;
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.6);
}

.subpills {
    margin-bottom: 12px;
}

.subpills .pill-btn {
    font-size: 10px;
    padding: 4px;
}

.instrumento-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #141414;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

#canvasInstrumentoVento {
    display: block;
    border-radius: 50%;
    background: radial-gradient(circle, #1a1a1a 0%, #0d0d0d 100%);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.9);
}

.controles-cabeceira {
    width: 100%;
    margin-top: 8px;
    font-size: 11px;
}

.linha-controle-vento {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}

.linha-controle-vento label {
    min-width: 90px;
    color: #aaa;
}

.linha-controle-vento input[type="range"] {
    flex: 1;
    height: 4px;
    background: #222;
    border: 1px solid #444;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.linha-controle-vento input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
}

.linha-controle-vento input[type="number"] {
    background-color: #111;
    border: 1px solid #555;
    color: #00ffff;
    font-family: monospace;
    font-size: 11px;
    width: 52px;
    padding: 2px 4px;
    text-align: center;
    border-radius: 2px;
}

.linha-controle-vento input[type="number"]:disabled {
    background-color: #141c1f;
    border-color: #243b44;
    color: #00ff88;
    cursor: not-allowed;
    opacity: 0.9;
    font-weight: bold;
}

.linha-controle-vento input[type="range"]:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.badges-componentes {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
}

.badge-info {
    flex: 1;
    background-color: #1c1c1c;
    border: 1px solid #444;
    border-radius: 3px;
    padding: 4px 6px;
    text-align: center;
    font-size: 10px;
}

.badge-info .badge-rotulo {
    color: #777;
    display: block;
    margin-bottom: 2px;
}

.badge-info .badge-valor {
    color: #00ffff;
    font-weight: bold;
}

/* =========================================================
   PAINEL LATERAL RETRÁTIL: VÍDEO-MAPA E BRILHO (ATC CONSOLE)
   ========================================================= */

/* 1. Botão Hambúrguer (Trigger) */
.btn-hamburger-atc {
    position: fixed;
    top: 12px;
    left: 12px;
    width: 34px;
    height: 34px;
    background-color: rgba(30, 30, 30, 0.95);
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    user-select: none;
    outline: none;
    line-height: 1;
}

.btn-hamburger-atc:hover {
    background-color: #004d4d;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.btn-hamburger-atc.ativo {
    background-color: #00ffff;
    color: #000000;
    font-weight: bold;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.9);
}

/* 2. Container do Painel Vertical Suspenso (Drawer) */
.drawer-atc {
    position: fixed;
    top: 52px;
    left: 12px;
    width: 250px;
    max-height: calc(100vh - 75px);
    background-color: rgba(22, 26, 30, 0.96);
    border: 1px solid #00ffff;
    border-radius: 5px;
    box-shadow: 3px 5px 18px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 255, 255, 0.2);
    z-index: 1000;
    font-family: monospace;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
    box-sizing: border-box;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
    transform-origin: top left;
    user-select: none;
}

.drawer-atc.recolhido {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    visibility: hidden;
}

.drawer-atc.expandido {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

/* Barra de rolagem discreta do drawer */
.drawer-atc::-webkit-scrollbar {
    width: 6px;
}
.drawer-atc::-webkit-scrollbar-track {
    background: rgba(14, 17, 20, 0.9);
}
.drawer-atc::-webkit-scrollbar-thumb {
    background: #254452;
    border-radius: 3px;
}
.drawer-atc::-webkit-scrollbar-thumb:hover {
    background: #00ffff;
}

/* 3. Seções do Acordeão */
.drawer-secao {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
    border: 1px solid #233742;
    border-radius: 4px;
    background-color: rgba(16, 20, 24, 0.8);
    overflow: hidden;
}

.drawer-secao:last-child {
    margin-bottom: 0;
}

/* Cabeçalho da Seção (Vídeo mapa / Brilho) */
.drawer-secao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: linear-gradient(180deg, #182830 0%, #111b21 100%);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.drawer-secao-header:hover {
    background: #1e3540;
}

.drawer-secao-titulo {
    font-size: 12px;
    font-weight: bold;
    color: #00ffff;
    letter-spacing: 1px;
}

.drawer-secao-seta {
    font-size: 11px;
    color: #00ffff;
    transition: transform 0.2s ease;
}

.drawer-secao-conteudo {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #233742;
}

.drawer-secao-conteudo.recolhido {
    display: none;
}

/* 4. Sub-acordeão dos Aeródromos */
.drawer-aero-bloco {
    display: flex;
    flex-direction: column;
    border: 1px solid #1c2b33;
    border-radius: 3px;
    background-color: rgba(12, 16, 18, 0.7);
    margin-bottom: 4px;
}

.drawer-aero-bloco:last-child {
    margin-bottom: 0;
}

.drawer-aero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background-color: #142026;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    color: #79d2ec;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.drawer-aero-header:hover {
    background-color: #1c2f38;
    color: #ffffff;
}

.drawer-aero-titulo {
    letter-spacing: 0.5px;
}

.drawer-aero-seta {
    font-size: 10px;
    color: #79d2ec;
}

.drawer-aero-conteudo {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #1c2b33;
}

.drawer-aero-conteudo.recolhido {
    display: none;
}

.drawer-lista-pistas {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.drawer-bloco-pista {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Item de cabeceira com checkbox */
.drawer-item-pista {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 11px;
    color: #c0d0d8;
    padding: 2px 0;
    transition: color 0.15s ease;
}

.drawer-item-pista:hover {
    color: #00ffff;
}

.drawer-item-pista input[type="checkbox"] {
    accent-color: #00ffff;
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
}

.drawer-rotulo-pista {
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Sub-lista de Cartas e Procedimentos de cada Pista */
.drawer-lista-cartas {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 18px;
    margin-top: 2px;
    margin-bottom: 4px;
    border-left: 1px solid rgba(0, 255, 255, 0.15);
}

.drawer-lista-cartas.oculto {
    display: none;
}

.drawer-item-carta {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 10px;
    color: #8da4af;
    padding: 1px 0;
    transition: color 0.15s ease;
}

.drawer-item-carta:hover {
    color: #ffffff;
}

.drawer-item-carta input[type="checkbox"] {
    accent-color: #00e5ff;
    width: 12px;
    height: 12px;
    cursor: pointer;
    margin: 0;
}

.drawer-indicador-cor-carta {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.drawer-rotulo-carta {
    font-family: monospace;
    font-size: 10px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 5. Seção de Sliders de Brilho */
.drawer-slider-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.drawer-slider-row:last-child {
    margin-bottom: 0;
}

.drawer-slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.drawer-slider-nome {
    font-weight: bold;
    color: #00ffff;
    letter-spacing: 0.5px;
}

.drawer-slider-val {
    font-weight: bold;
    color: #00ff88;
    font-size: 11px;
}

.drawer-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #16242c;
    border: 1px solid #233e4a;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.drawer-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00ffff;
    border: 1px solid #ffffff;
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.8);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.drawer-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 1);
}

.drawer-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00ffff;
    border: 1px solid #ffffff;
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.8);
    cursor: pointer;
}

/* ============================================================================
 * FERRAMENTA DE INSPEÇÃO DE COORDENADAS ATC (TECLA C)
 * ============================================================================ */

/* Cursor crosshair 100% PRETO quando o modo de coordenadas estiver ativo */
body.modo-coordenadas-ativo,
body.modo-coordenadas-ativo #radarCanvas,
body.modo-coordenadas-ativo canvas {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25' viewBox='0 0 25 25'%3E%3Cline x1='12' y1='0' x2='12' y2='25' stroke='black' stroke-width='2'/%3E%3Cline x1='0' y1='12' x2='25' y2='12' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 12 12, crosshair !important;
}

.banner-coordenadas-atc {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 24, 34, 0.94);
    border: 1px solid #000000;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.8);
    color: #e0f7fa;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    padding: 8px 18px;
    border-radius: 6px;
    pointer-events: auto;
    letter-spacing: 0.5px;
    animation: fadeInBanner 0.2s ease;
}

@keyframes fadeInBanner {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.banner-coordenadas-atc strong {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid #000000;
}

.icone-mira {
    color: #000000;
    background: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    line-height: 1;
}

.btn-fechar-banner {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    border-radius: 4px;
    padding: 2px 7px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    margin-left: 6px;
    transition: all 0.15s ease;
}

.btn-fechar-banner:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
    color: #ffffff;
}

.card-coordenadas-atc {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 330px;
    max-width: calc(100vw - 48px);
    background: rgba(10, 18, 25, 0.95);
    border: 2px solid #000000;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    font-family: 'Consolas', 'Courier New', monospace;
    color: #d0f0fd;
    backdrop-filter: blur(5px);
    pointer-events: auto;
    overflow: hidden;
    animation: fadeInCard 0.2s ease;
}

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

.card-coordenadas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #111a22;
    border-bottom: 2px solid #000000;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #00ffff;
}

.card-coordenadas-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fechar-coord {
    background: transparent;
    border: none;
    color: #88c0d0;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.btn-fechar-coord:hover {
    color: #ff5555;
}

.card-coordenadas-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coord-grade-principal {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.coord-bloco {
    background: rgba(5, 12, 18, 0.75);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coord-label {
    font-size: 9px;
    color: #78a5b8;
    letter-spacing: 0.8px;
    font-weight: bold;
}

.coord-valor {
    font-size: 15px;
    font-weight: bold;
    color: #00ffff;
    letter-spacing: 0.8px;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.4);
}

.coord-info-extra {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    padding: 6px 10px;
    background: rgba(18, 28, 36, 0.6);
    border-radius: 4px;
    border: 1px dashed rgba(0, 255, 255, 0.25);
}

.coord-extra-linha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.coord-sublabel {
    color: #8da4b0;
    font-size: 10px;
}

.coord-subvalor {
    color: #e0f7fa;
    font-weight: 500;
    font-size: 11px;
}

.coord-codigo-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coord-codigo {
    font-size: 10px;
    background: #060b10;
    border: 1px solid #1a303d;
    color: #00ff88;
    padding: 6px 8px;
    border-radius: 3px;
    word-break: break-all;
    white-space: pre-wrap;
    font-family: monospace;
}

.coord-botoes-acao {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.btn-coord-acao {
    flex: 1;
    padding: 6px 10px;
    background: #0a2533;
    border: 1px solid #00ffff;
    color: #00ffff;
    font-family: monospace;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-coord-acao:hover {
    background: #00ffff;
    color: #000000;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.coord-feedback-msg {
    font-size: 11px;
    color: #00ff88;
    text-align: center;
    font-weight: bold;
    padding: 4px 0;
}

/* =========================================================
   CAMADA DE ANOTAÇÃO / CANETA DO INSTRUTOR ATC (TECLA P)
   ========================================================= */

#canvasAnotacoes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 50;
    pointer-events: none;
    user-select: none;
}

.btn-topo-anotacao {
    position: absolute;
    top: 15px;
    right: 160px;
    background-color: rgba(43, 43, 43, 0.9);
    border: 1px solid #ff9500;
    color: #ff9500;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    padding: 7px 14px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 15;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.btn-topo-anotacao:hover {
    background-color: #ff9500;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 149, 0, 0.8);
}

.btn-topo-anotacao.ativo {
    background-color: #ff9500;
    color: #000;
    font-weight: bold;
    box-shadow: 0 0 12px rgba(255, 149, 0, 0.9);
}

.painel-anotacao-flutuante {
    position: fixed;
    top: 60px;
    right: 15px;
    width: 255px;
    background-color: rgba(24, 24, 28, 0.96);
    border: 1px solid #ff9500;
    border-radius: 6px;
    color: #ffffff;
    font-family: monospace;
    font-size: 12px;
    z-index: 1100;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75);
    user-select: none;
    backdrop-filter: blur(4px);
    overflow: hidden;
}

.anotacao-cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: linear-gradient(180deg, #32251a 0%, #1e1814 100%);
    border-bottom: 1px solid rgba(255, 149, 0, 0.4);
    cursor: move;
}

.anotacao-titulo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    font-size: 12px;
    color: #ff9500;
    letter-spacing: 0.5px;
}

.anotacao-icone-titulo {
    font-size: 14px;
}

.anotacao-controles-janela {
    display: flex;
    gap: 4px;
}

.anotacao-btn-janela {
    background: #2a201a;
    border: 1px solid #554030;
    color: #ffcc80;
    font-family: monospace;
    font-size: 11px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.anotacao-btn-janela:hover {
    background: #ff9500;
    color: #000;
    border-color: #ff9500;
}

.anotacao-btn-janela.btn-fechar-janela:hover {
    background: #ff3b30;
    color: #fff;
    border-color: #ff3b30;
}

.anotacao-corpo {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.anotacao-secao {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.anotacao-subtitulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    font-weight: bold;
    color: #a0a0a8;
    letter-spacing: 0.5px;
}

/* Ferramentas principais (Caneta, Marcador, Borracha, Radar) */
.anotacao-barra-ferramentas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.btn-tool-atc {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    background-color: #1f1f24;
    border: 1px solid #3a3a42;
    border-radius: 4px;
    color: #d0d0d8;
    cursor: pointer;
    font-family: monospace;
    transition: all 0.15s ease;
}

.btn-tool-atc .tool-icon {
    font-size: 15px;
    line-height: 1;
}

.btn-tool-atc .tool-label {
    font-size: 9px;
    letter-spacing: 0.3px;
}

.btn-tool-atc:hover {
    background-color: #2e2e38;
    border-color: #ff9500;
    color: #ffffff;
}

.btn-tool-atc.ativo {
    background-color: #ff9500;
    border-color: #ff9500;
    color: #000000;
    font-weight: bold;
    box-shadow: 0 0 8px rgba(255, 149, 0, 0.6);
}

/* Ações de histórico (Desfazer / Refazer / Limpar) */
.anotacao-acoes-historico {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
}

.btn-acao-atc {
    background-color: #1f1f24;
    border: 1px solid #3a3a42;
    color: #c0c0cb;
    font-family: monospace;
    font-size: 10px;
    padding: 5px 2px;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.btn-acao-atc:hover:not(.desabilitado) {
    background-color: #353542;
    color: #ffffff;
    border-color: #888899;
}

.btn-acao-atc.desabilitado {
    opacity: 0.4;
    cursor: default;
    border-color: #292930;
}

.btn-acao-atc.btn-limpar-atc:hover:not(.desabilitado) {
    background-color: #8b1111;
    border-color: #ff3b30;
    color: #ffffff;
}

/* Confirmação de Limpar */
.anotacao-confirmacao-limpar {
    background-color: #3b1111;
    border: 1px solid #ff3b30;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    font-size: 11px;
    color: #ffdddd;
}

.confirmacao-limpar-botoes {
    display: flex;
    gap: 6px;
}

.btn-confirma-sim {
    flex: 1;
    background-color: #ff3b30;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    padding: 5px 0;
    font-family: monospace;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
}

.btn-confirma-nao {
    flex: 1;
    background-color: #2a2a30;
    color: #cccccc;
    border: 1px solid #444450;
    border-radius: 3px;
    padding: 5px 0;
    font-family: monospace;
    font-size: 10px;
    cursor: pointer;
}

/* Paleta de Cores */
.preview-cor-badge {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: inline-block;
}

.anotacao-paleta-cores {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: space-between;
}

.btn-cor-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.15s ease, border-color 0.15s ease;
    padding: 0;
}

.btn-cor-swatch:hover {
    transform: scale(1.15);
}

.btn-cor-swatch.selecionada {
    border-color: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.btn-color-picker-label {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1f1f24;
    border: 1px solid #3a3a42;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    box-sizing: border-box;
}

.btn-color-picker-label:hover {
    border-color: #ff9500;
    background-color: #2a2a33;
}

.input-color-escondido {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    left: 0;
    top: 0;
}

/* Espessura */
.anotacao-valor-espessura {
    color: #ff9500;
}

.anotacao-presets-espessura {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.btn-preset-espessura {
    background-color: #1f1f24;
    border: 1px solid #3a3a42;
    color: #c0c0cb;
    font-family: monospace;
    font-size: 9px;
    padding: 4px 1px;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.btn-preset-espessura:hover {
    border-color: #ff9500;
    color: #ffffff;
}

.btn-preset-espessura.ativo {
    background-color: #3b2a1a;
    border-color: #ff9500;
    color: #ff9500;
    font-weight: bold;
}

.anotacao-slider-container {
    display: flex;
    align-items: center;
    padding: 2px 0;
}

.slider-espessura-atc {
    width: 100%;
    accent-color: #ff9500;
    cursor: pointer;
}