/* ======================================================
   GameTraq Premium Theme (2025)
   Vollständige, gesäuberte, vereinheitlichte Theme-Datei
   ====================================================== */

/* ---------- Root Variables ---------- */
:root {

    /* Primary UI */
    --bg: #f3f4f6;
    --bg-card: #ffffff;
    --bg-dark: #1f1f24;

    --surface: #ffffff;
    --surface-soft: #f9fafb;

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #e0ecff;

    /* Text */
    --text: #111827;
    --text-muted: #6b7280;
    --text-light: #d1d5db;

    /* Borders & Shadows */
    --border: #e5e7eb;
    --shadow: 0 4px 18px rgba(0,0,0,0.06);

    /* Status Colors */
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* UI Radius */
    --radius: 14px;
    --radius-sm: 8px;

    --transition: .2s ease;
}

/* ---------- Base Styles ---------- */
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, h4 {
    margin: 0;
}

/* ---------- Layout ---------- */
.layout {
    display: flex;
}

.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 260px; /* Platz für Sidebar */
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: var(--text-light);
    position: fixed;
    top: 0; bottom: 0; left: 0;
    padding: 1rem 0;
    overflow-y: auto;
    box-shadow: 2px 0 6px rgba(0,0,0,0.2);
}

.sidebar-header {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    padding: 1rem;
    color: var(--accent);
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li a {
    display: block;
    padding: .75rem 1.2rem;
    text-decoration: none;
    color: var(--text-light);
    border-left: 4px solid transparent;
    transition: var(--transition);
}

.nav-links li a:hover,
.nav-links li a.active {
    background: rgba(255,255,255,0.08);
    color: var(--accent);
    border-left-color: var(--accent);
}

.submenu-list {
    display: none;
    padding-left: 1.2rem;
}

.submenu-list.open {
    display: block;
}

.sidebar-footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.7rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
    background: var(--accent);
    color: white;
    padding: .6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
}

.btn:hover {
    background: var(--accent-hover);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent-light);
}

.btn.small {
    padding: .4rem .8rem;
    font-size: .88rem;
}

/* ---------- Badges ---------- */
.badge {
    padding: .3rem .6rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: var(--success); }
.badge-danger { background: #fee2e2; color: var(--danger); }

/* ======================================================
   GAME LIBRARY (games/index.php)
   ====================================================== */

.games-container {
    margin-top: 1.5rem;
}

.category-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1rem;
}

.category-filter-pill {
    padding: .45rem 1rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: .85rem;
    transition: var(--transition);
}

.category-filter-pill:hover,
.category-filter-pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.game-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
    gap: 1.6rem;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
}

.game-image-wrapper {
    height: 160px;
    overflow: hidden;
    background: #f4f4f4;
}

.game-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-body {
    padding: 1.2rem;
}

.game-body h2 {
    font-size: 1.35rem;
    margin-bottom: .3rem;
}

.game-body .desc {
    font-size: .95rem;
    color: var(--text-muted);
    margin-bottom: .7rem;
    min-height: 48px;
}

.player-range {
    font-size: .9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: .6rem;
}

.game-actions {
    display: flex;
    gap: .5rem;
}

.btn-card {
    flex: 1;
    text-align: center;
    padding: .55rem;
    border-radius: var(--radius-sm);
}

.btn-card.primary {
    background: var(--accent);
    color: white;
}

.btn-card.secondary {
    border: 1px solid var(--accent);
    color: var(--accent);
}

/* ======================================================
   DASHBOARD (active nights, KPIs, modals)
   ====================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px,1fr));
    gap: 1.2rem;
}

.kpi-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    text-align: center;
}

.kpi-icon {
    font-size: 1.7rem;
    margin-bottom: .3rem;
}

.kpi-value {
    font-weight: 700;
    font-size: 1.4rem;
}

.night-card {
    padding: 1.4rem;
    border-left: 6px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow);
}

.night-card.active { border-left-color: var(--success); }
.night-card.ended  { border-left-color: var(--danger); }

/* ======================================================
   MODAL
   ====================================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(4px);
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow);
}

/* ---------- Player selection ---------- */
.player-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(130px,1fr));
    gap: .7rem;
    margin-top: .8rem;
}

.player-tile {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: .8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.player-tile:hover {
    background: var(--accent-light);
}

.player-tile.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.avatar-circle {
    width: 46px;
    height: 46px;
    background: var(--border);
    border-radius: 50%;
    margin: 0 auto .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text);
}

/* ======================================================
   Responsive
   ====================================================== */
@media (max-width: 900px) {
    .main-content {
        margin-left: 0;
        padding: 1.3rem;
    }
}
.running-sessions-box {
    margin-top: .8rem;
    background: #f8faff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: .8rem;
}

.running-title {
    font-size: .85rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: .4rem;
}

.running-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #e5e7eb;
    padding: .6rem .8rem;
    border-radius: 8px;
    margin-bottom: .4rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.rs-info {
    font-size: .85rem;
    color: #374151;
}

.rs-time {
    color: #6b7280;
    font-size: .75rem;
}

.rs-btn {
    background: #3b82f6;
    color: #fff !important;
    padding: .4rem .7rem;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: .2s;
}

.rs-btn:hover {
    background: #2563eb;
}
