body {
    background: #060606;
    color: #ffffff;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}

.glass {
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.glass-panel {
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.6) 0%, rgba(10, 10, 10, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.neon-text {
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-content.active.flex {
    display: flex !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInSimple {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nav-link.active .nav-indicator {
    height: 100%;
    background: #10B981;
}

.nav-link.active {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #222;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #333;
}

textarea:focus,
select:focus,
input:focus {
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.5) !important;
}

/* HUD Corners effect */
.hud-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover .hud-corner.tl {
    width: 24px;
    height: 24px;
}

.group:hover .hud-corner.br {
    width: 24px;
    height: 24px;
}

/* ========== GRUMMAN RS EPIC LOGO ========== */
.gr-logo-container {
    position: relative;
    overflow: hidden;
}

.gr-logo-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(16, 185, 129, 0.03) 2px,
            rgba(16, 185, 129, 0.03) 4px);
    pointer-events: none;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(100px); }
}

.gr-logo-text {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    line-height: 1;
    color: white;
    text-shadow:
        0 0 20px rgba(16, 185, 129, 0.5),
        0 0 60px rgba(16, 185, 129, 0.2),
        0 0 100px rgba(16, 185, 129, 0.1);
    animation: logoBreath 4s ease-in-out infinite;
}

@keyframes logoBreath {
    0%, 100% { text-shadow: 0 0 20px rgba(16, 185, 129, 0.5), 0 0 60px rgba(16, 185, 129, 0.2); }
    50% { text-shadow: 0 0 30px rgba(16, 185, 129, 0.7), 0 0 80px rgba(16, 185, 129, 0.3), 0 0 120px rgba(16, 185, 129, 0.15); }
}

/* Tactical HUD Trigger */
.tactical-trigger {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: not-allowed;
    opacity: 0.3;
    filter: grayscale(1);
    pointer-events: none;
}

.tactical-trigger.armed {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(0, 0, 0, 0.8) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    cursor: pointer;
    opacity: 1;
    filter: grayscale(0);
    pointer-events: auto;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.05);
}

.tactical-trigger .scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
    animation: tacticalScan 3s linear infinite;
}

@keyframes tacticalScan {
    0% { top: 0; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* RADARES Y CHIPS */
.radar-item {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.network-item {
    opacity: 0.7;
    filter: grayscale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.network-item:hover, .network-item.active {
    opacity: 1 !important;
    filter: grayscale(0) !important;
    transform: scale(1.1) translateY(-5px);
    border-color: currentColor;
    background: rgba(255,255,255,0.05);
}

.radar-item.active {
    color: var(--net-color);
    border-color: var(--net-color);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.02);
}

/* TERMINAL V3 */
#terminal-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 1 !important;
    transition: all 0.4s ease;
    filter: saturate(1.2) !important;
    text-shadow: 0 0 5px rgba(255,255,255,0.05);
}

.mission-block {
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.015);
    padding: 8px 12px;
    animation: missionSlideIn 0.3s ease-out;
}

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

.mission-block.active { border-left-color: #D4AF37; }
.mission-block.complete { border-left-color: #10B981; }
.mission-block.error { border-left-color: #EF4444; }

.solo-log {
    font-size: 10px;
    line-height: 1.5;
    padding: 2px 0;
    text-align: center;
}

/* DNA CONSOLIDADO */
#dna-consolidated-panel {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* DNA Bars Glow */
#dna-bar-formalism { box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); background: linear-gradient(90deg, #10b981, #34d399); }
#dna-bar-disruption { box-shadow: 0 0 15px rgba(212, 175, 55, 0.6); background: linear-gradient(90deg, #d4af37, #f1c40f); }
#dna-bar-humanism { box-shadow: 0 0 15px rgba(236, 72, 153, 0.6); background: linear-gradient(90deg, #ec4899, #f472b6); }

/* COMPORTAMIENTO BASE DE CONTROLES (PC) */
#deploy-container {
    position: sticky !important;
    bottom: 0 !important;
    padding: 1rem 0 !important;
    background: linear-gradient(180deg, transparent 0%, rgba(5, 5, 5, 0.9) 100%) !important;
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 50;
    margin-top: auto;
}

/* MOBILE STABILIZATION */
@media (max-width: 1024px) {
    /* IMPORTANTE: Quitar transform del padre para permitir position: fixed real */
    .tab-content.active {
        animation: fadeInSimple 0.3s ease-out forwards !important;
        transform: none !important;
    }

    #main-content {
        padding: 1rem 0.75rem 8rem 0.75rem !important; /* Más padding abajo para el scroll */
    }
    
    #tab-dashboard > div {
        gap: 0.75rem !important;
    }

    #dna-consolidated-panel {
        max-height: none !important;
        overflow-y: visible !important;
    }

    #terminal-content {
        max-height: none !important;
        margin-top: 2rem !important;
        opacity: 1 !important; /* Brillo total */
        overflow-y: visible !important;
    }

    #input-topic {
        height: 90px !important;
        font-size: 13px !important;
    }

    /* EL BOTON: FIXED 10PX ARRIBA DEL MENÚ (80px + safe area) */
    #deploy-container {
        position: fixed !important;
        bottom: calc(90px + env(safe-area-inset-bottom, 16px)) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        backdrop-filter: none !important;
        transform: none !important;
        z-index: 99 !important; /* Por encima de todo */
        pointer-events: none;
    }

    .radar-item {
        width: 3.5rem !important;
        height: 3.5rem !important;
    }

    /* Ajustar botón en móvil */
    #btn-deploy {
        max-width: 280px !important;
        padding-top: 14px !important;
        padding-bottom: 14px !important;
        margin: 0 auto !important;
        pointer-events: auto; /* Habilitar clics */
        box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 15px rgba(212,175,55,0.2) !important;
    }

    /* ARSENAL UNIFICADO: DISEÑO DE TARJETAS (MOVIL & PC) */
    #arsenal-table thead {
        display: none !important;
    }

    #arsenal-table, 
    #arsenal-table-body, 
    #arsenal-table-body tr, 
    #arsenal-table-body td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Ajuste de Misiones (Grupos) */
    #arsenal-table-body tr.group {
        background: rgba(0, 0, 0, 0.6) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        margin-top: 1rem;
    }
    
    /* Ajuste de Posts (Suministros) */
    #arsenal-table-body tr.border-b {
        background: rgba(16, 185, 129, 0.02) !important;
        border-bottom: 2px solid rgba(0,0,0,0.8) !important;
        margin-bottom: 2px;
    }

    .post-data-container .truncate {
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden;
        line-height: 1.4;
    }

    /* CONTENEDOR DE ACCIONES: RESPONSIVO */
    .post-actions-container {
        display: flex !important;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-bottom: 10px;
        width: 100%;
    }

    /* Ajuste de botones para PC */
    @media (min-width: 1025px) {
        .post-actions-container {
            justify-content: flex-end !important;
        }
        .post-actions-container button {
            min-width: 110px;
            height: 38px;
        }
    }

    /* Ajuste de botones para Móvil */
    @media (max-width: 1024px) {
        .post-actions-container {
            justify-content: space-between !important;
        }
        .post-actions-container button {
            flex: 1;
            min-width: 60px;
            height: 45px;
        }
    }

    #arsenal-table-body tr.hidden {
        display: none !important;
    }
}

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
