/* SheepsGame Admin Panel - Dark Theme */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #232342;
    --bg-surface: #2a2a4a;
    --bg-surface-light: #3a3a5a;
    --accent: #00aeff;
    --accent-hover: #33bfff;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a8a;
    --success: #43b581;
    --warning: #faa61a;
    --error: #f04747;
    --border: #3a3a5a;
    --sidebar-width: 250px;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    background: var(--bg-surface);
    padding: 40px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    color: var(--accent);
    margin-bottom: 30px;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.sidebar-header h2 {
    color: var(--accent);
    font-size: 1.4em;
}

.admin-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    margin-top: 5px;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-menu li a:hover,
.nav-menu li.active a {
    color: var(--text-primary);
    background: var(--bg-surface);
    border-left: 3px solid var(--accent);
}

/* Weitere Verwaltung (Shop, Forum) - eigene Oberflaechen, hier nur verlinkt. */
.nav-section-title {
    padding: 16px 20px 6px;
    border-top: 1px solid var(--border);
    font-size: 0.75em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-menu.nav-menu-external {
    flex: 0 0 auto;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.85em;
    color: var(--text-muted);
}

.logout-link {
    display: block;
    margin-top: 8px;
    color: var(--error);
    text-decoration: none;
}

/* Seit 14.09. ein Formular-Knopf (Abmelden mit CSRF-Marke) - sieht aus wie
   der Link davor. */
.logout-form {
    margin: 0;
}
button.logout-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-align: left;
}
button.logout-link:hover {
    text-decoration: underline;
}

/* Language switch (sidebar and login page). */
.lang-switch {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
}
.lang-switch a:hover {
    text-decoration: underline;
}
.lang-switch a.active {
    color: var(--text-primary, inherit);
    font-weight: 600;
}
.lang-switch-login {
    justify-content: center;
    margin: -6px 0 16px;
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 1.8em;
}

/* Cards and Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius);
}

.stat-card .stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--accent);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 5px;
}

/* Tables */
.table-container {
    background: var(--bg-surface);
    border-radius: var(--radius);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-surface-light);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-primary);
}

tr:hover td {
    background: rgba(0, 174, 255, 0.05);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.95em;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-secondary {
    background: var(--bg-surface-light);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success { background: rgba(67, 181, 129, 0.2); color: var(--success); }
.alert-error { background: rgba(240, 71, 71, 0.2); color: var(--error); }
.alert-warning { background: rgba(250, 166, 26, 0.2); color: var(--warning); }

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.badge-online { background: rgba(67, 181, 129, 0.2); color: var(--success); }
.badge-offline { background: rgba(99, 107, 117, 0.2); color: var(--text-muted); }
.badge-admin { background: rgba(0, 174, 255, 0.2); color: var(--accent); }
.badge-owner { background: rgba(212, 160, 23, 0.2); color: #D4A017; }
.badge-active { background: rgba(67, 181, 129, 0.2); color: var(--success); }
.badge-inactive { background: rgba(240, 71, 71, 0.2); color: var(--error); }

/* Card */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 1.1em;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar .sidebar-header h2,
    .sidebar .sidebar-footer,
    .nav-menu li a span {
        display: none;
    }
    .content {
        margin-left: 60px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Zahl offener Vorgaenge in der Navigation. Klein und daneben, nicht als
   eigene Zeile: Sie soll auffallen, wenn man hinsieht, und nicht draengen. */
.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin-left: 6px;
    border-radius: 9px;
    background: var(--accent, #00aeff);
    color: #06121c;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
}

/* Rollenhinweis in der Seitenleiste. Ein Moderator sieht weniger Eintraege als
   ein Admin - ohne diesen Hinweis saehe das nach einem Fehler aus. */
.nav-role {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 9px;
    background: rgba(191, 131, 255, 0.18);
    color: #bf83ff;
    font-size: 0.7rem;
    font-weight: 700;
}
