/* --- MIDNIGHT CRIMSON TEMPLATE --- */
:root {
    /* Backgrounds */
    --bg-base: #000000;           /* Pure black for main background */
    --bg-surface: #090909;        /* Slightly elevated for panels */
    --bg-surface-alt: #050505;    /* For input fields and terminal */

    /* Borders & Lines */
    --border-subtle: #1a1a1a;
    --border-glow: 0 0 20px rgba(255, 51, 51, 0.1);

    /* Accents */
    --accent-primary: #6464cc;    /* Sharper, more vibrant red */
    --accent-dim: #404088;        /* Deeper crimson for gradients/shadows */
    --status-online: #00e639;     /* Slightly deeper neon green */

    /* Typography */
    --text-main: #e0e0e0;
    --text-heading: #ffffff;
    --text-muted: #888888;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Cantarell', 'Liberation Sans', sans-serif;
    margin: 0;
    display: flex;
    /* --- THE FIX --- */
    flex-direction: column; /* Stack logo above dashboard */
    /* --- */
    justify-content: top; /* Centers vertically along the column */
    align-items: center;     /* Centers horizontally along the column */
    min-height: 100vh;
    padding: 50px;
}

.center-logo {
    width: 300px;
    height: 300px;
    object-fit: contain; /* Prevents stretching if logo isn't perfectly square */
    margin-bottom: 50px; /* Space between logo and dashboard grid */
    animation: diagonalReveal 1s ease-out forwards;

    /* Optional visual polish: adds a subtle red glow to the logo image */
    /*filter: drop-shadow(0 0 10px rgba(255, 51, 51, 0.3));*/
}

@keyframes diagonalReveal {
    0% {
        /* Compresses the visible mask to a single invisible dot in the bottom-left */
        clip-path: polygon(0 100%, 0 100%, 0 100%, 0 100%);
        opacity: 0;
    }
    100% {
        /* Expands the mask to perfectly frame the full square image */
        clip-path: polygon(0 100%, 0 0, 100% 0, 100% 100%);
        opacity: 1;
    }
}

/* LAYOUT LOCK */
.dashboard {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    width: 95%;
    max-width: 1400px;
    min-width: 0;
}

.dashboard > * { min-width: 0; }

/* PANELS */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 25px;
    border-radius: 6px;
    position: relative;
    box-shadow: var(--border-glow);
    transform: translateZ(0);
}

.panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent-primary), var(--accent-dim));
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    display: block; /* Explicitly defines the element shape for the rendering engine */
    z-index: 1;
}

/* TYPOGRAPHY */
h2 { font-size: 1.8rem; margin: 0 0 5px 0; color: var(--text-heading); letter-spacing: -1px; }
h3 { color: var(--accent-primary); text-transform: uppercase; letter-spacing: 2px; font-size: 1.1rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; margin: 20px 0 15px 0; }

/* HARDWARE SPECS */
.spec-item { font-size: 0.9rem; margin-bottom: 10px; display: flex; }
.spec-label { width: 65px; color: var(--accent-primary); font-weight: bold; text-transform: uppercase; }
.spec-value { margin-left: 15px; color: var(--text-main); border-left: 1px solid var(--border-subtle); padding-left: 12px; flex: 1; }

/* TELEMETRY BOX */
.live-monitor-box { background: var(--bg-base); border: 1px solid var(--border-subtle); padding: 15px; margin-top: 20px; border-radius: 4px; }
.telemetry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.telemetry-item { border-left: 2px solid var(--accent-dim); padding-left: 12px; }
.tel-label { color: var(--text-heading); display: block; text-transform: uppercase; font-size: 0.7rem; font-weight: bold; margin-bottom: 3px; }
.tel-value { color: var(--text-muted); font-weight: bold; font-size: 1.3rem; }
.tel-sub { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }

.footer-stats { border-top: 1px solid var(--border-subtle); padding-top: 12px; font-size: 0.8rem; color: var(--text-heading); line-height: 1.6; }
.highlight { color: var(--text-muted); font-weight: bold; }

/* STATUS INDICATORS */
.status-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.pulse { width: 14px; height: 14px; background: #333; border-radius: 50%; }
.pulse.online { background: var(--status-online); box-shadow: 0 0 12px var(--status-online); animation: pulse-animation 2s infinite; }
@keyframes pulse-animation { 0% { transform: scale(0.95); opacity: 1; } 70% { transform: scale(1.1); opacity: 0.7; } 100% { transform: scale(0.95); opacity: 1; } }

/* MC DATA CARDS */
.data-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 15px; }
.data-card { background: var(--bg-base); border: 1px solid var(--border-subtle); padding: 15px; border-left: 3px solid var(--accent-dim); border-radius: 4px; }
.data-card i { color: var(--accent-primary); font-size: 1.2rem; margin-bottom: 8px; display: block; }
.data-card .label { font-size: 0.75rem; color: var(--text-heading); text-transform: uppercase; font-weight: bold; }
.data-card .value { font-size: 1.3rem; color: var(--text-muted); font-weight: bold; margin-top: 5px; }

/* TERMINAL LOG */
#terminal-log {
    padding: 15px; font-size: 0.85rem; color: var(--text-muted); height: 350px;
    overflow-y: auto; overflow-x: hidden; background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle); white-space: pre-wrap;
    word-wrap: break-word; word-break: break-all; margin-top: 15px;
    scrollbar-width: thin; scrollbar-color: var(--accent-dim) var(--bg-base);
    border-radius: 4px;
}

/* BUTTONS & LINKS */
.back-btn, .ctrl-btn {
    display: block; border: 1px solid var(--accent-dim); color: var(--accent-primary);
    padding: 10px; text-align: center; text-decoration: none;
    font-weight: bold; font-size: 0.8rem; margin-top: 10px;
    transition: all 0.2s ease; background: transparent; cursor: pointer;
    font-family: 'Consolas', monospace; width: 100%; border-radius: 4px;
}
.back-btn:hover, .ctrl-btn:hover { background: var(--accent-primary); color: var(--bg-base); border-color: var(--accent-primary); }
#btn-stop { border-color: var(--accent-dim); color: var(--accent-dim); }
#btn-stop:hover { background: var(--accent-dim); color: var(--text-heading); }

/* PASSKEY INPUT */
.pass-input {
    width: 100%; background: var(--bg-surface-alt); border: 1px solid var(--border-subtle);
    color: var(--accent-primary); padding: 12px; font-family: 'Consolas', monospace;
    margin-bottom: 10px; text-align: center; outline: none; font-size: 0.9rem;
    transition: all 0.3s ease; border-radius: 4px;
}
.pass-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 10px rgba(255, 51, 51, 0.15); }
.pass-input::placeholder { color: #444; }

/* INDEX SPECIFIC NAVIGATION */
.skill-tag {
    border: 1px solid var(--border-subtle);
    padding: 12px;
    text-align: center;
    font-size: 0.85rem;
    background: var(--bg-base);
    color: var(--text-main);
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.skill-tag:hover { border-color: var(--accent-primary); background: rgba(255, 51, 51, 0.05); color: var(--accent-primary); }

.nav-btn {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    color: var(--accent-primary);
    padding: 25px;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.nav-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-base);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.2);
}
