/*
 * No BS SMP Admin Panel
 * Matches the visual identity of the public site (index.html):
 *   --accent #ff2d2d, --bg #1c1c1c, cards #2a2a2a, borders #3a3a3a
 */

:root {
    --accent: #ff2d2d;
    --accent-hover: #ff5c5c;
    --bg: #1c1c1c;
    --panel: #2a2a2a;
    --panel-2: #232323;
    --border: #3a3a3a;
    --text: #e0e0e0;
    --muted: #888;
    --ok: #4caf50;
    --warn: #ffb74d;
    --err: #f44336;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ---------- top nav ---------- */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(28, 28, 28, 0.85);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #2a2a2a;
    padding: 0.75rem 0;
}

.top-nav .brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.top-nav .brand-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 6px;
    box-shadow: 0 0 8px rgba(255, 45, 45, 0.6);
}

.top-nav .nav-links a {
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 4px 0;
}

.top-nav .nav-links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.top-nav .nav-links a:hover,
.top-nav .nav-links a.active { color: #fff; }
.top-nav .nav-links a:hover::after,
.top-nav .nav-links a.active::after { width: 100%; }
.top-nav .nav-links a.logout { color: var(--accent); }
.top-nav .nav-links a.logout:hover { color: var(--accent-hover); }

/* ---------- generic ---------- */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--accent-hover); }

.card {
    background-color: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 0.6rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
    border-color: rgba(255, 45, 45, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.card-title {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

hr { border-color: var(--border); }

/* ---------- buttons ---------- */
.btn-accent {
    background-color: var(--accent);
    border: none;
    color: #fff;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-accent:hover {
    background-color: #e02525;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 45, 45, 0.25);
}
.btn-accent:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-outline-accent {
    border: 2px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
    background: transparent;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
}
.btn-outline-accent:hover {
    background-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: #fff;
}

.btn-danger-soft {
    background: rgba(244, 67, 54, 0.12);
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: #ff8a80;
}
.btn-danger-soft:hover {
    background: rgba(244, 67, 54, 0.22);
    color: #fff;
}

/* ---------- forms ---------- */
.form-control, .form-select {
    background-color: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
}
.form-control:focus, .form-select:focus {
    background-color: var(--panel-2);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(255, 45, 45, 0.15);
}
.form-control::placeholder { color: #6c6c6c; }

/* ---------- status indicators ---------- */
.status-indicator {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}
.status-online  { background-color: var(--ok);  box-shadow: 0 0 8px rgba(76, 175, 80, 0.55); }
.status-offline { background-color: var(--err); box-shadow: 0 0 8px rgba(244, 67, 54, 0.55); }
.status-warn    { background-color: var(--warn); }

.badge-soft {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 0.75rem;
    border: 1px solid var(--border);
}
.badge-soft.ok   { color: var(--ok);  border-color: rgba(76, 175, 80, 0.4); }
.badge-soft.err  { color: var(--err); border-color: rgba(244, 67, 54, 0.4); }

/* ---------- stat tiles ---------- */
.stat-tile {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 1rem 1.25rem;
    height: 100%;
    transition: border-color 0.2s, transform 0.2s;
}
.stat-tile:hover { border-color: rgba(255, 45, 45, 0.3); }
.stat-tile .label {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.stat-tile .value {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.2;
}
.stat-tile .sub {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* ---------- player list ---------- */
.player-list {
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}
.player-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--border);
}
.player-list li:last-child { border-bottom: 0; }
.player-list .name {
    font-weight: 500;
    color: #fff;
}
.player-list .actions { display: flex; gap: 0.35rem; }

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 1rem 0;
    font-style: italic;
}

/* ---------- log viewer ---------- */
.log-viewer {
    background-color: #111;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: #d4d4d4;
    font-family: "JetBrains Mono", Consolas, Menlo, monospace;
    font-size: 0.83rem;
    padding: 0.85rem 1rem;
    height: 60vh;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}
.log-viewer .ts   { color: #6e6e6e; }
.log-viewer .info { color: #8ec5ff; }
.log-viewer .warn { color: #ffb74d; }
.log-viewer .err  { color: #ff6b6b; }
.log-viewer .ok   { color: #7ee787; }

/* ---------- login page ---------- */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg);
    position: relative;
    overflow: hidden;
}
.login-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}
.login-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 30%, rgba(255,45,45,0.08), transparent 60%);
    pointer-events: none;
}
.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.login-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.25rem;
}
.login-card .sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* ---------- toast / flash ---------- */
.flash {
    padding: 0.7rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: 0.92rem;
}
.flash.ok   { background: rgba(76, 175, 80, 0.10); color: #b8eebd; border-color: rgba(76,175,80,0.3); }
.flash.err  { background: rgba(244, 67, 54, 0.10); color: #ffb4ad; border-color: rgba(244,67,54,0.3); }
.flash.info { background: rgba(255, 255, 255, 0.05); color: #ccc;   border-color: var(--border); }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track    { background: var(--bg); }
::-webkit-scrollbar-thumb    { background: #3a3a3a; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- console field ---------- */
.console-prompt {
    background: #111;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.4rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.console-prompt .sigil { color: var(--accent); font-weight: 700; }
.console-prompt input {
    background: transparent;
    border: 0;
    outline: 0;
    flex: 1;
    color: var(--text);
    font-family: "JetBrains Mono", Consolas, monospace;
}
.console-output {
    margin-top: 0.6rem;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: #c9c9c9;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 0.82rem;
    padding: 0.65rem 0.85rem;
    max-height: 220px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- responsive tweaks ---------- */
@media (max-width: 575.98px) {
    .top-nav .nav-links { gap: 1rem !important; }
    .top-nav .nav-links a.logout::after { display: none; }
    .stat-tile .value { font-size: 1.15rem; }
}
