/* =========================================
   HUD TÁTICO - STYLE.CSS DEFINITIVO V1.3
   ========================================= */

:root {
    --hud-color: #0f0; /* Verde tático clássico */
    --hud-bg: #051005;
    --hud-border: 2px solid var(--hud-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', Courier, monospace; /* Fonte de terminal */
}

body {
    background-color: #000;
    color: var(--hud-color);
    height: 100dvh; 
    overflow: hidden;
    text-transform: uppercase;
}

/* =========================================
   ESTRUTURA PRINCIPAL
   ========================================= */
.hud-container {
    display: flex;
    flex-direction: column;
    height: 100dvh; 
    padding: 20px;
    position: relative;
    background: radial-gradient(circle, var(--hud-bg) 0%, #000 100%);
}

.scanlines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,255,0,0.1) 50%, rgba(0,255,0,0.1));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

/* =========================================
   HEADER & TOPBAR
   ========================================= */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--hud-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-shadow: 0 0 5px var(--hud-color);
    position: relative;
    z-index: 60; 
    flex-shrink: 0; 
}

.blink-text {
    animation: blinker 1s linear infinite;
}

.menu-toggle {
    display: none; /* Invisível no Desktop */
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--hud-color);
    color: var(--hud-color);
    font-size: 1.8em;
    cursor: pointer;
    padding: 5px 15px;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
    transition: all 0.2s;
    border-radius: 3px;
}

.menu-toggle:hover {
    background: var(--hud-color);
    color: #000;
}

/* =========================================
   SUBTOPBAR (LETREIRO TÁTICO)
   ========================================= */
.hud-subtopbar {
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 0.85em;
    text-shadow: 0 0 5px var(--hud-color);
    overflow: hidden; 
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
}

.marquee-content {
    display: inline-block;
    padding-left: 100%; 
    animation: marquee 260s linear infinite; 
}

.marquee-content span {
    margin-right: 50px; 
    font-weight: bold;
}

/* =========================================
   CORPO E GAVETA (SIDEBAR/ASIDE)
   ========================================= */
.hud-body {
    display: flex;
    flex: 1;
    gap: 20px;
    position: relative;
    overflow: hidden; 
    min-height: 0; 
}

.hud-sidebar {
    width: 250px;
    border-right: var(--hud-border);
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    background: transparent;
    transition: left 0.3s ease-in-out;
    height: 100%; 
    flex-shrink: 0; 
}

/* Botão de Fechar Interno - Padrão Desktop: Morto e Enterrado */
.close-sidebar {
    display: none !important; 
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff0000;
    color: #ff0000;
    padding: 12px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 40px; /* RESPIRO TÁTICO no mobile */
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.2s;
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.2);
    flex-shrink: 0;
}

.close-sidebar:hover {
    background: #ff0000 !important;
    color: #000 !important;
    box-shadow: 0 0 15px #ff0000;
    text-shadow: none !important;
    padding-left: 16px !important; /* Efeito de empurrão */
    border-left: 2px solid #ff0000 !important;
}

/* A LOGO */
.sidebar-logo {
    width: 100%;
    max-width: 180px;
    margin: 20px auto 30px auto; /* 20px de respiro no topo */
    display: block;
    animation: pulseGlow 2.5s infinite alternate ease-in-out;
}

.hud-sidebar nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; 
    scrollbar-width: none; 
}
.hud-sidebar nav::-webkit-scrollbar { display: none; } 

.hud-sidebar ul {
    list-style: none;
}

.hud-sidebar li {
    margin-bottom: 15px;
}

.hud-sidebar a {
    color: var(--hud-color);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
    display: block;
    padding: 5px;
}

.hud-sidebar a:hover {
    text-shadow: 0 0 10px var(--hud-color);
    padding-left: 15px;
    background: rgba(0, 255, 0, 0.1);
    border-left: 2px solid var(--hud-color);
}

/* =========================================
   COMPONENTES TÁTICOS
   ========================================= */
.radar-box {
    width: 100%;
    max-width: 200px; 
    aspect-ratio: 1;
    border: var(--hud-border);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: repeating-radial-gradient(circle, transparent, transparent 20px, rgba(0,255,0,0.2) 21px);
    margin: auto auto 20px auto; 
    flex-shrink: 0; 
}

.radar {
    position: absolute;
    top: 50%; left: 50%;
    width: 50%; height: 50%;
    background: linear-gradient(45deg, rgba(0,255,0,0.8) 0%, transparent 50%);
    transform-origin: 0 0;
    animation: scan 2s linear infinite;
}

.btn-logout {
    display: block;
    width: 100%;
    padding: 12px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff0000;
    color: #ff0000 !important; 
    text-align: center;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.2s;
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.2);
    flex-shrink: 0;
    margin-bottom: 10px;
}

.btn-logout:hover {
    background: #ff0000 !important;
    color: #000 !important;
    box-shadow: 0 0 15px #ff0000;
    text-shadow: none !important;
    padding-left: 16px !important; /* Efeito de empurrão */
    border-left: 2px solid #ff0000 !important;
}

/* =========================================
   ÁREA PRINCIPAL (MAIN)
   ========================================= */
.hud-main {
    flex: 1;
    border: 1px solid rgba(0, 255, 0, 0.3);
    padding: 20px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.1);
    overflow-y: auto; 
    scrollbar-width: thin;
    scrollbar-color: var(--hud-color) transparent;
    min-height: 0; 
}
.hud-main::-webkit-scrollbar { width: 5px; }
.hud-main::-webkit-scrollbar-thumb { background-color: var(--hud-color); }

.target-box {
    border: var(--hud-border);
    padding: 20px;
    display: inline-block;
    background: rgba(0, 255, 0, 0.05);
    width: 100%;
    max-width: 400px;
}

.target-box h2 {
    margin-bottom: 10px;
    text-shadow: 0 0 5px var(--hud-color);
}

.progress-bar {
    width: 100%;
    height: 10px;
    border: 1px solid var(--hud-color);
    margin-top: 15px;
}

.progress-fill {
    height: 100%;
    background-color: var(--hud-color);
    width: 0%;
    animation: loadBar 3s ease-in-out infinite alternate;
}

/* =========================================
   FOOTER (ATUALIZADO)
   ========================================= */
.hud-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: var(--hud-border);
    padding-top: 10px;
    margin-top: 20px;
    font-size: 0.8em;
    flex-shrink: 0; 
    text-shadow: 0 0 5px var(--hud-color);
}

.footer-dev {
    flex: 1;
    text-align: left;
}

.footer-encript, .footer-signal {
    margin-left: 20px;
    font-weight: bold;
}

/* =========================================
   ANIMAÇÕES
   ========================================= */
@keyframes blinker { 50% { opacity: 0; } }
@keyframes scan { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes loadBar { 0% { width: 0%; } 100% { width: 100%; } }
@keyframes pulseGlow {
    0% { filter: drop-shadow(0 0 2px var(--hud-color)); }
    100% { filter: drop-shadow(0 0 25px var(--hud-color)); }
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* =========================================
   ESTAÇÃO DE COMANDO GLOBAL (GRID)
   ========================================= */
.command-header {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    padding-bottom: 10px;
}

.command-header h2 {
    font-size: 2em;
    text-shadow: 0 0 10px var(--hud-color);
    letter-spacing: 3px;
}

.command-header p {
    color: rgba(0, 255, 0, 0.7);
    font-size: 0.9em;
}

.battalion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    padding-bottom: 20px;
}

.battalion-card {
    border: 1px solid rgba(0, 255, 0, 0.3);
    background: rgba(0, 20, 0, 0.6);
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.2s;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.05);
}

.battalion-card:hover {
    border-color: var(--hud-color);
    background: rgba(0, 40, 0, 0.9);
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.2), 0 0 15px rgba(0, 255, 0, 0.2);
    transform: translateY(-3px); 
}

.battalion-card::before, .battalion-card::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 2px solid transparent;
    transition: all 0.3s;
    pointer-events: none;
}
.battalion-card::before {
    top: -1px; left: -1px;
    border-top-color: var(--hud-color);
    border-left-color: var(--hud-color);
}
.battalion-card::after {
    bottom: -1px; right: -1px;
    border-bottom-color: var(--hud-color);
    border-right-color: var(--hud-color);
}

.battalion-card:hover::before, .battalion-card:hover::after {
    width: 30px;
    height: 30px;
}

.bat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(0, 255, 0, 0.3);
    padding-bottom: 10px;
}

.bat-id {
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 0 5px var(--hud-color);
    letter-spacing: 2px;
}

.bat-status {
    font-size: 0.8em;
    padding: 3px 8px;
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid var(--hud-color);
    font-weight: bold;
}

.bat-status.offline {
    color: #ff0000;
    border-color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
    text-shadow: 0 0 5px red;
}

.bat-status.combat {
    color: #ffaa00;
    border-color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
    text-shadow: 0 0 5px #ffaa00;
    animation: blinker 1s linear infinite;
}

.bat-data p {
    font-size: 0.9em;
    margin-bottom: 5px;
    color: rgba(0, 255, 0, 0.8);
}

.bat-data span {
    color: #fff;
    font-weight: bold;
}

.btn-enter-bat {
    margin-top: auto; 
    padding: 10px;
    background: transparent;
    color: var(--hud-color);
    border: 1px solid var(--hud-color);
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.btn-enter-bat:hover {
    background: var(--hud-color);
    color: #000;
    box-shadow: 0 0 10px var(--hud-color);
}

/* =========================================
   RESPONSIVIDADE TÁTICA (MOBILE) - ÚNICO BLOCO
   ========================================= */
@media (max-width: 768px) {
    /* Mostra o botão do menu no header */
    .menu-toggle {
        display: block !important; 
        position: relative;
        z-index: 100;
    }

    /* Força a exibição do botão de fechar na gaveta */
    .close-sidebar {
        display: block !important; 
    }

    .hud-header {
        flex-wrap: wrap;
        align-items: center;
    }

    .sys-title {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 15px;
        font-size: 1.2em;
        border-top: 1px dashed rgba(0, 255, 0, 0.3);
        padding-top: 10px;
    }

    .sys-status, .sys-time {
        font-size: 0.9em;
    }

    /* Gaveta Retrátil */
    .hud-sidebar {
        position: fixed; 
        top: 0;
        left: -100%; 
        height: 100dvh;
        width: 280px;
        background: rgba(2, 10, 2, 0.98);
        border-right: 2px solid var(--hud-color);
        padding: 20px;
        z-index: 110; 
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.9);
    }

    .hud-sidebar.active {
        left: 0;
    }

    /* No celular, a logo não precisa de margem no topo porque o botão de fechar já ocupa o espaço */
    .sidebar-logo {
        margin-top: 0; 
    }

    .hud-main {
        padding: 10px;
    }

    .target-box {
        max-width: 100%;
    }

    /* Oculta elementos táticos secundários no mobile */
    .hide-mobile {
        display: none !important;
    }
    
    .hud-footer {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    
    .footer-dev {
        text-align: center;
    }
}