/* ==========================================================================
   Phantom Force – Design System
   Tactical / Esport Dark Theme
   Palette: Schwarz, Anthrazit, Dunkelgrau, Lila
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Farben */
    --bg: #0a0a0d;
    --bg-elevated: #111114;
    --panel: #17171c;
    --panel-alt: #1d1d23;
    --border: #2a2a32;
    --border-bright: #3a3a45;

    --purple-deep: #4c1d95;
    --purple: #7c3aed;
    --purple-bright: #a78bfa;
    --purple-glow: rgba(139, 92, 246, 0.35);

    --text: #e8e8ee;
    --text-dim: #9a9aa8;
    --text-faint: #5f5f6b;

    --success: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;

    /* Typografie */
    --font-display: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Layout */
    --sidebar-w: 248px;
    --radius: 4px;
    --topbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    background-image:
        linear-gradient(180deg, rgba(124,58,237,0.05) 0%, transparent 300px),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px);
}

h1, h2, h3, h4, .display {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 .5em;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

a { color: var(--purple-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--font-mono); }

::selection { background: var(--purple); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-elevated); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 6px; }

:focus-visible {
    outline: 2px solid var(--purple-bright);
    outline-offset: 2px;
}

/* ==========================================================================
   HUD Panel – Signaturelement: taktische Eckklammern an jedem Panel/Card
   ========================================================================== */
.hud-panel {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.hud-panel::before,
.hud-panel::after,
.hud-panel > .hud-corner-tl,
.hud-panel > .hud-corner-br {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--purple-bright);
    opacity: .8;
    pointer-events: none;
}
.hud-panel::before { /* top-left */
    top: -1px; left: -1px;
    border-top: 2px solid var(--purple-bright);
    border-left: 2px solid var(--purple-bright);
}
.hud-panel::after { /* bottom-right */
    bottom: -1px; right: -1px;
    border-bottom: 2px solid var(--purple-bright);
    border-right: 2px solid var(--purple-bright);
}

.hud-panel--tight { padding: 14px 16px; }

/* ==========================================================================
   Layout
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 40;
    transition: transform .25s ease;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar__brand .mark {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--purple), var(--purple-deep));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 14px;
    box-shadow: 0 0 16px var(--purple-glow);
}
.sidebar__brand .name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .06em; color: #fff; text-transform: uppercase; }
.sidebar__brand .sub { display:block; font-size: .68rem; color: var(--text-faint); letter-spacing: .12em; font-family: var(--font-mono); }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar__section-label { font-family: var(--font-mono); font-size: .68rem; color: var(--text-faint); letter-spacing: .12em; text-transform: uppercase; padding: 14px 10px 6px; }

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: .92rem;
    font-weight: 500;
    margin-bottom: 2px;
    border-left: 2px solid transparent;
}
.nav-link:hover { background: var(--panel-alt); color: var(--text); text-decoration: none; }
.nav-link.active {
    background: var(--panel-alt);
    color: #fff;
    border-left: 2px solid var(--purple-bright);
}
.nav-link .icon { width: 18px; text-align: center; opacity: .9; }
.nav-link .badge {
    margin-left: auto;
    background: var(--purple);
    color: #fff;
    font-size: .68rem;
    font-family: var(--font-mono);
    padding: 1px 6px;
    border-radius: 10px;
}

.sidebar__footer { padding: 14px; border-top: 1px solid var(--border); }

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(10,10,13,.85);
    backdrop-filter: blur(6px);
    position: sticky; top: 0; z-index: 30;
}
.topbar__title { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .05em; font-size: 1.1rem; color: #fff; }
.topbar__right { display: flex; align-items: center; gap: 16px; }

.menu-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }

.content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ==========================================================================
   Buttons & Forms
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .88rem;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border-bright);
    background: var(--panel-alt);
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    text-decoration: none;
}
.btn:hover { border-color: var(--purple-bright); text-decoration: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--purple-deep));
    border-color: var(--purple);
    color: #fff;
}
.btn-primary:hover { box-shadow: 0 0 20px var(--purple-glow); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-danger:hover { background: rgba(248,113,113,.1); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
input, select, textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .92rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--purple-bright); outline: none; }
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 160px; }
.help-text { font-size: .78rem; color: var(--text-faint); margin-top: 4px; }

/* ==========================================================================
   Badges / Status
   ========================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 3px;
    border: 1px solid var(--border-bright);
    color: var(--text-dim);
}
.badge-success { color: var(--success); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.08); }
.badge-warn { color: var(--warn); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }
.badge-danger { color: var(--danger); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
.badge-purple { color: var(--purple-bright); border-color: rgba(167,139,250,.4); background: rgba(167,139,250,.08); }

.role-hex {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    font-size: .6rem; font-family: var(--font-mono); color: #000; font-weight: 700;
}

/* ==========================================================================
   Dashboard Grid
   ========================================================================== */
.grid { display: grid; gap: 18px; }
.grid-dashboard { grid-template-columns: repeat(12, 1fr); }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 1000px) {
    .col-4, .col-6, .col-8 { grid-column: span 12; }
}

.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-title h3 { margin: 0; }
.panel-title .more { font-size: .78rem; color: var(--text-dim); font-family: var(--font-mono); }

.stat-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; color: #fff; }
.stat-label { font-size: .75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-mono); }

.countdown {
    display: flex; gap: 14px;
}
.countdown .unit { text-align: center; }
.countdown .num { font-family: var(--font-mono); font-size: 1.8rem; color: var(--purple-bright); font-weight: 700; }
.countdown .lbl { font-size: .65rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; }

.list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item__meta { font-size: .78rem; color: var(--text-faint); font-family: var(--font-mono); }

.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--panel-alt);
    border: 1px solid var(--border-bright);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; color: var(--purple-bright);
    overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   Tables
   ========================================================================== */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
tr:hover td { background: var(--panel-alt); }

/* ==========================================================================
   Auth Pages
   ========================================================================== */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(124,58,237,.15), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(76,29,149,.18), transparent 45%),
        var(--bg);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box .sidebar__brand { justify-content: center; border: none; padding: 0 0 24px; }

/* ==========================================================================
   Calendar
   ========================================================================== */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-dow { text-align: center; font-family: var(--font-mono); font-size: .7rem; color: var(--text-faint); text-transform: uppercase; padding-bottom: 6px; }
.calendar-cell {
    min-height: 92px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    font-size: .78rem;
}
.calendar-cell.today { border-color: var(--purple-bright); box-shadow: 0 0 0 1px var(--purple-bright) inset; }
.calendar-cell.other-month { opacity: .35; }
.calendar-cell .daynum { font-family: var(--font-mono); color: var(--text-dim); margin-bottom: 4px; }
.calendar-event {
    display: block;
    font-size: .68rem;
    padding: 2px 5px;
    border-radius: 3px;
    margin-bottom: 3px;
    background: var(--panel-alt);
    border-left: 2px solid var(--purple-bright);
    color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calendar-event.type-training { border-left-color: var(--success); }
.calendar-event.type-szenario { border-left-color: var(--purple-bright); }
.calendar-event.type-turnier { border-left-color: var(--warn); }
.calendar-event.type-geburtstag { border-left-color: #ec4899; }

/* ==========================================================================
   Flash messages / alerts
   ========================================================================== */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; font-size: .88rem; }
.alert-success { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.35); color: var(--success); }
.alert-error { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.35); color: var(--danger); }
.alert-info { background: rgba(167,139,250,.08); border-color: rgba(167,139,250,.35); color: var(--purple-bright); }

/* ==========================================================================
   Utility
   ========================================================================== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-faint); }
.empty-state .icon { font-size: 2rem; margin-bottom: 10px; opacity: .5; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 880px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 16px; }
    .topbar { padding: 0 14px; }
}
