/* ================================================================
   TECHPRO GAME PANEL — Tokens de diseño
   Paleta: gunmetal casi negro + dorado señal + acentos online/offline
   Tipografía: Orbitron (display/marca) + Rajdhani (UI) + Share Tech Mono (consola)
   Firma visual: paneles HUD con esquinas cortadas (clip-path) + orbe de estado con radar ping
   ================================================================ */

:root {
    --bg-void:      #0a0b0f;
    --bg-panel:     #12151c;
    --bg-panel-2:   #171b24;
    --border-dim:   #2a2f3a;

    --gold:         #f2b705;
    --gold-dim:     #a67c00;
    --gold-soft:    rgba(242, 183, 5, 0.12);

    --online:       #2ecc71;
    --offline:      #e74c3c;
    --restart:      #4aa8ff;

    --text:         #e7e9ee;
    --text-muted:   #8b90a0;

    --cut: 14px; /* tamaño del corte de esquina HUD */
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-void);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
}

body {
    background-image:
        radial-gradient(circle at 15% 10%, rgba(242,183,5,0.06), transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(74,168,255,0.05), transparent 40%);
    min-height: 100vh;
}

/* Textura de scanlines sutil, sensación de HUD de juego */
.scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.015) 0px,
        rgba(255,255,255,0.015) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }
code { background: var(--bg-panel-2); padding: 2px 6px; border-radius: 3px; color: var(--gold); }

/* ================= MARCA ================= */
.brand {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 1.8rem;
    color: var(--text);
    margin: 0;
}
.brand span { color: var(--gold); }
.brand.small { font-size: 1.15rem; letter-spacing: 1.5px; }

/* ================= PANEL HUD (firma visual) ================= */
.hud-panel {
    position: relative;
    background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
    border: 1px solid var(--border-dim);
    padding: 24px 26px;
    clip-path: polygon(
        var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)),
        calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)
    );
}
.hud-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: var(--cut); height: var(--cut);
    border-top: 2px solid var(--gold);
    border-left: 2px solid var(--gold);
    opacity: 0.9;
}
.hud-panel::after {
    content: "";
    position: absolute;
    bottom: 0; right: 0;
    width: var(--cut); height: var(--cut);
    border-bottom: 2px solid var(--gold);
    border-right: 2px solid var(--gold);
    opacity: 0.9;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 10px;
}
.panel-head h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0;
}
.server-name { color: var(--text-muted); font-weight: 600; }

/* ================= LOGIN / INSTALL ================= */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.auth-card {
    width: min(420px, 90vw);
    text-align: center;
}
.auth-sub { color: var(--text-muted); margin-top: 4px; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.auth-form label { font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; }
.auth-form input {
    background: var(--bg-void);
    border: 1px solid var(--border-dim);
    color: var(--text);
    padding: 10px 12px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    outline: none;
}
.auth-form input:focus { border-color: var(--gold); }
.install-warning { color: var(--offline); font-size: 0.85rem; margin-top: 16px; }

.alert { padding: 10px 12px; margin-bottom: 12px; font-size: 0.9rem; }
.alert-error { background: rgba(231,76,60,0.12); border: 1px solid var(--offline); color: #ff9c92; }
.alert-success { background: rgba(46,204,113,0.12); border: 1px solid var(--online); color: #9df5bd; }

/* ================= BOTONES ================= */
.btn {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 12px 20px;
    border: 1px solid var(--gold);
    background: transparent;
    color: var(--gold);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.btn:hover { background: var(--gold-soft); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-gold { width: 100%; margin-top: 20px; background: var(--gold); color: #14161c; }
.btn-gold:hover { background: #ffc93d; }
.btn-outline { border-color: var(--border-dim); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }

.btn-on { border-color: var(--online); color: var(--online); }
.btn-on:hover { background: rgba(46,204,113,0.12); }
.btn-off { border-color: var(--offline); color: var(--offline); }
.btn-off:hover { background: rgba(231,76,60,0.12); }
.btn-restart { border-color: var(--restart); color: var(--restart); }
.btn-restart:hover { background: rgba(74,168,255,0.12); }

/* ================= TOPBAR ================= */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border-dim);
    background: rgba(18,21,28,0.8);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(6px);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-chip { color: var(--text-muted); font-weight: 600; }

/* ================= DASHBOARD GRID ================= */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    padding: 28px;
    max-width: 1280px;
    margin: 0 auto;
}
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

@media (max-width: 900px) {
    .dash-grid { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: span 1; }
}

/* ================= ESTADO / ORBE ================= */
.status-row { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.orb-wrap { display: flex; align-items: center; gap: 14px; }

.orb-status {
    width: 22px; height: 22px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}
.orb-online { background: var(--online); box-shadow: 0 0 12px var(--online); }
.orb-offline { background: var(--offline); box-shadow: 0 0 12px var(--offline); }
.orb-static { background: var(--gold); box-shadow: 0 0 12px var(--gold); margin: 0 auto 14px; }

.orb-online::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid var(--online);
    animation: ping 1.8s ease-out infinite;
}
@keyframes ping {
    0%   { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(2.2); opacity: 0; }
}

.status-label { font-size: 1.15rem; font-weight: 700; }

.metrics { display: flex; gap: 32px; flex-wrap: wrap; }
.metric { display: flex; flex-direction: column; }
.metric-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.metric-value { font-family: 'Share Tech Mono', monospace; font-size: 1.2rem; color: var(--gold); }

/* ================= CONTROLES ================= */
.controls-stack { display: flex; flex-direction: column; gap: 12px; }
.action-feedback { margin-top: 14px; font-size: 0.85rem; color: var(--text-muted); min-height: 1.2em; }

/* ================= CONSOLA ================= */
.console-controls { display: flex; align-items: center; gap: 14px; }
.autoupdate-toggle { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

.console-box {
    background: #05060a;
    border: 1px solid var(--border-dim);
    color: #9df5bd;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 16px;
    height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ================= FORMULARIO DE CONFIGURACIÓN ================= */
.config-note {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 20px;
    line-height: 1.5;
}
.config-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 32px;
}
@media (max-width: 700px) {
    .config-form { grid-template-columns: 1fr; }
}
.config-field { display: flex; flex-direction: column; gap: 6px; }
.config-field label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.config-field input[type="text"],
.config-field input[type="number"],
.config-field select {
    background: var(--bg-void);
    border: 1px solid var(--border-dim);
    color: var(--text);
    padding: 10px 12px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    outline: none;
}
.config-field input:focus,
.config-field select:focus { border-color: var(--gold); }
.field-help { font-size: 0.78rem; color: var(--text-muted); margin: 0; }
.config-submit { grid-column: 1 / -1; margin-top: 10px; }

/* Switch on/off para booleanos */
.switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
    position: absolute; inset: 0;
    background: var(--bg-void);
    border: 1px solid var(--border-dim);
    cursor: pointer;
    transition: 0.15s;
}
.switch-track::before {
    content: "";
    position: absolute;
    height: 18px; width: 18px;
    left: 4px; top: 50%;
    transform: translateY(-50%);
    background: var(--text-muted);
    transition: 0.15s;
}
.switch input:checked + .switch-track { border-color: var(--online); }
.switch input:checked + .switch-track::before {
    background: var(--online);
    transform: translate(24px, -50%);
}

/* ================= PRÓXIMAMENTE ================= */
.upcoming-list {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.upcoming-list li {
    background: var(--bg-panel-2);
    border: 1px dashed var(--border-dim);
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
@media (max-width: 700px) {
    .upcoming-list { grid-template-columns: 1fr 1fr; }
}
