/* GLOBAL */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    background: #000;
    color: #ff3b3b;
    font-family: "Segoe UI", Arial, sans-serif;
    overflow: hidden;
}

/* SCREENS */
.screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: none;
    color: #ff3b3b;
}

.screen.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* CENTER WRAP */
.center-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* TITLES */
.title {
    font-size: 32px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.subtitle {
    font-size: 16px;
    opacity: 0.8;
    margin-bottom: 30px;
}

/* BUTTONS */
.primary-btn {
    padding: 12px 32px;
    border: none;
    background: #ff3b3b;
    color: #000;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.primary-btn:hover {
    background: #ff5c5c;
    box-shadow: 0 0 12px rgba(255, 59, 59, 0.7);
}

.primary-btn:active {
    transform: scale(0.97);
}

/* INPUTS */
input {
    display: block;
    margin: 10px auto;
    padding: 10px 14px;
    width: 260px;
    border: 1px solid #ff3b3b;
    background: rgba(0, 0, 0, 0.7);
    color: #ff3b3b;
    outline: none;
    text-align: center;
    letter-spacing: 1px;
}

input::placeholder {
    color: rgba(255, 59, 59, 0.5);
}

/* STATUS TEXT */
.status-text {
    margin-top: 12px;
    font-size: 14px;
    min-height: 18px;
}

/* LOCKOUT OVERLAY */
.lockout {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lockout-inner {
    text-align: center;
    border: 1px solid #ff3b3b;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 59, 59, 0.7);
}

.lockout-title {
    font-size: 20px;
    margin-bottom: 8px;
}

.lockout-sub {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 12px;
}

.lockout-timer {
    font-size: 16px;
}

/* HUD OVERLAYS */
.hud-scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    background-image: linear-gradient(
        rgba(255, 255, 255, 0.03) 1px,
        transparent 1px
    );
    background-size: 100% 3px;
    mix-blend-mode: soft-light;
    opacity: 0.4;
    z-index: 1;
}

.hud-noise {
    pointer-events: none;
    position: fixed;
    inset: 0;
    background-image: url("assets/images/noise.png");
    background-size: cover;
    opacity: 0.08;
    mix-blend-mode: screen;
    z-index: 1;
}

/* NEBULA LAYERS */
.nebula {
    position: fixed;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.5;
    z-index: 0;
}

.layer-back {
    background-image: radial-gradient(circle at 20% 20%, #ff0000 0, transparent 50%),
                      radial-gradient(circle at 80% 80%, #ff0040 0, transparent 55%);
    filter: blur(8px);
}

.layer-mid {
    background-image: radial-gradient(circle at 30% 70%, #ff0033 0, transparent 55%),
                      radial-gradient(circle at 70% 30%, #ff1a1a 0, transparent 60%);
    filter: blur(4px);
}

.layer-front {
    background-image: radial-gradient(circle at 50% 50%, rgba(255, 80, 80, 0.8) 0, transparent 50%);
    opacity: 0.4;
}

/* COCKPIT LAYOUT */
#cockpit-screen {
    display: flex;
    position: relative;
    z-index: 2;
}

/* SIDEBAR */
#sidebar {
    width: 260px;
    background: rgba(0, 0, 0, 0.9);
    border-right: 1px solid rgba(255, 59, 59, 0.4);
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 20px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.op-block {
    font-size: 12px;
}

.op-label {
    opacity: 0.7;
    text-transform: uppercase;
}

.op-name {
    font-size: 14px;
    margin-top: 2px;
}

.op-level {
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.8;
}

/* NAVIGATION */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.nav-section-label {
    font-size: 11px;
    opacity: 0.7;
    margin: 10px 0 6px;
    text-transform: uppercase;
}

.nav-item {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: transparent;
    border: 1px solid rgba(255, 59, 59, 0.3);
    color: #ff3b3b;
    font-size: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}

.nav-item:hover {
    background: rgba(255, 59, 59, 0.1);
    box-shadow: 0 0 8px rgba(255, 59, 59, 0.6);
}

.nav-item.active {
    background: rgba(255, 59, 59, 0.2);
    box-shadow: 0 0 10px rgba(255, 59, 59, 0.8);
}

.nav-item.locked {
    border-style: dashed;
    opacity: 0.8;
}

.lock-icon {
    float: right;
}

/* COCKPIT MAIN */
#cockpit-main {
    flex: 1;
    padding: 18px 24px;
    position: relative;
    color: #ffdfdf;
}

/* COCKPIT HEADER */
.cockpit-header {
    margin-bottom: 18px;
}

.cockpit-title {
    font-size: 18px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cockpit-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

/* MODULE PANELS */
.module-panel {
    display: none;
}

.module-panel.active {
    display: block;
}

.module-title {
    font-size: 18px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.module-text {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 16px;
}

/* MODULE GRID */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.module-card {
    border: 1px solid rgba(255, 59, 59, 0.5);
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 10px rgba(255, 59, 59, 0.4);
}

.module-label {
    font-size: 13px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.module-status {
    font-size: 11px;
    text-transform: uppercase;
}

.module-status.online {
    color: #00ff88;
}

.module-status.locked {
    color: #ff3b3b;
}

/* SETTINGS */
.settings-group {
    margin-top: 12px;
}

.settings-item {
    font-size: 13px;
}

/* WARNING OVERLAY */
.warning-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.warning-panel {
    text-align: center;
    border: 1px solid #ff3b3b;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 20px rgba(255, 59, 59, 0.8);
    animation: warning-pulse 0.4s ease-out;
}

.warning-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.warning-title {
    font-size: 18px;
    margin-bottom: 4px;
}

.warning-text {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 14px;
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
}

.modal-inner {
    width: 80%;
    max-width: 900px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #ff3b3b;
    box-shadow: 0 0 20px rgba(255, 59, 59, 0.8);
    padding: 16px 18px 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 16px;
    text-transform: uppercase;
}

.modal-close {
    background: transparent;
    border: none;
    color: #ff3b3b;
    font-size: 18px;
    cursor: pointer;
}

.modal-body {
    font-size: 13px;
}

.tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.tier-card {
    border: 1px solid rgba(255, 59, 59, 0.5);
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
}

.tier-name {
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.tier-tag {
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.tier-list {
    list-style: none;
    font-size: 11px;
}

.tier-list li {
    margin-bottom: 4px;
}

.full-width {
    width: 100%;
}

/* ANIMATIONS */
@keyframes warning-pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 rgba(255, 59, 59, 0.0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 59, 59, 0.8);
    }
}

.shake {
    animation: shake 0.2s linear;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* NVG MODE (GREEN OVERRIDE) */
body.nvg-mode {
    color: #00ff88;
}

body.nvg-mode #sidebar,
body.nvg-mode .modal-inner,
body.nvg-mode .warning-panel,
body.nvg-mode .lockout-inner,
body.nvg-mode .module-card {
    border-color: #00ff88;
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.7);
}

body.nvg-mode .nav-item,
body.nvg-mode input,
body.nvg-mode .primary-btn {
    border-color: #00ff88;
}

body.nvg-mode .primary-btn {
    background: #00ff88;
    color: #000;
}

body.nvg-mode .primary-btn:hover {
    background: #33ff9f;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.8);
}

body.nvg-mode .module-status.online {
    color: #00ff88;
}

body.nvg-mode .module-status.locked {
    color: #ff5555;
}