/**
 * ============================================================================
 * sgiT Education Platform - Dark Theme CSS
 * ============================================================================
 * 
 * Zentrales Dark Theme für alle Seiten der Plattform
 * Einheitliches CI mit Markenfarben #1A3503 und #43D240
 * 
 * @version 1.0
 * @date 10.12.2025
 * ============================================================================
 */

/* ============================================
   CSS VARIABLEN (Root)
   ============================================ */
:root {
    /* Primärfarben */
    --primary: #1A3503;
    --primary-light: #2d5a06;
    --primary-dark: #0d1a02;
    
    /* Akzentfarben */
    --accent: #43D240;
    --accent-hover: #35B035;
    --accent-glow: rgba(67, 210, 64, 0.3);
    
    /* Spezialfarben */
    --orange: #E86F2C;
    --bitcoin: #F7931A;
    --danger: #e74c3c;
    --warning: #ffc107;
    --success: #28a745;
    --info: #17a2b8;
    
    /* Hintergrund */
    --bg-dark: #0d1a02;
    --bg-gradient: linear-gradient(135deg, #0d1a02 0%, #1A3503 100%);
    
    /* Cards & Container */
    --card: rgba(0, 0, 0, 0.3);
    --card-hover: rgba(0, 0, 0, 0.4);
    --card-solid: #0f2204;
    
    /* Text */
    --text: #ffffff;
    --text-muted: #aaaaaa;
    --text-dark: #000000;
    
    /* Borders */
    --border: rgba(67, 210, 64, 0.3);
    --border-hover: rgba(67, 210, 64, 0.6);
    
    /* Schatten */
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(67, 210, 64, 0.2);
}

/* ============================================
   RESET & BASIS
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}


/* ============================================
   HEADER
   ============================================ */
.header, .gen-header, .dark-header {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 1px solid var(--border);
}

.header-brand, .gen-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo, .gen-logo {
    width: 42px;
    height: 42px;
    background: rgba(67, 210, 64, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--accent);
}

.header h1, .gen-brand h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.header h1 small, .gen-brand h1 small {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 8px;
    font-weight: normal;
}

.header-nav, .gen-header-nav {
    display: flex;
    gap: 8px;
}

.header-nav a, .gen-header-nav a {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.header-nav a:hover, .gen-header-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-nav a.active, .nav-stats {
    background: var(--accent);
    color: #000;
}

/* ============================================
   NAVIGATION TABS
   ============================================ */
.nav-tabs, .gen-tabs {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border);
    padding: 0 25px;
    display: flex;
    gap: 5px;
    overflow-x: auto;
}

.nav-tab, .gen-tab {
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover, .gen-tab:hover {
    color: #fff;
    background: rgba(67, 210, 64, 0.1);
}

.nav-tab.active, .gen-tab.active {
    color: #000;
    background: var(--accent);
    border-bottom-color: var(--accent);
}


/* ============================================
   CONTAINER
   ============================================ */
.container, .gen-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px;
}

/* ============================================
   CARDS
   ============================================ */
.card, .gen-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.card:hover, .gen-card:hover {
    border-color: var(--accent);
}

.card-header, .gen-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title, .gen-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn, .gen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary, .gen-btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover, .gen-btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary, .gen-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--border);
}

.btn-secondary:hover, .gen-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.btn-danger:hover, .gen-btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

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

.btn-orange, .gen-btn-orange {
    background: var(--orange);
    color: white;
}


/* ============================================
   FORMS
   ============================================ */
.form-input, .gen-input, 
.form-select, .gen-select,
input[type="text"], input[type="email"], 
input[type="password"], input[type="number"],
textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

.form-input:focus, .gen-input:focus,
.form-select:focus, .gen-select:focus,
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(67, 210, 64, 0.1);
}

.form-input::placeholder, .gen-input::placeholder,
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

.form-label, .gen-label, label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group, .gen-form-group {
    margin-bottom: 15px;
}

/* ============================================
   BADGES
   ============================================ */
.badge, .gen-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.badge-success, .gen-badge-success {
    background: rgba(40, 167, 69, 0.3);
    color: #6cff6c;
}

.badge-warning, .gen-badge-warning {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.badge-danger, .gen-badge-danger {
    background: rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
}

.badge-info, .gen-badge-info {
    background: rgba(23, 162, 184, 0.3);
    color: #17a2b8;
}

.badge-primary, .gen-badge-primary {
    background: var(--accent);
    color: #000;
}

/* ============================================
   ALERTS
   ============================================ */
.alert, .gen-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.alert-success, .gen-alert-success {
    background: rgba(40, 167, 69, 0.2);
    color: #6cff6c;
    border: 1px solid rgba(40, 167, 69, 0.4);
}

.alert-warning, .gen-alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.alert-danger, .gen-alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(220, 53, 69, 0.4);
}

.alert-info, .gen-alert-info {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.4);
}


/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

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

th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: rgba(67, 210, 64, 0.05);
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress, .gen-progress {
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar, .gen-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ============================================
   GRID SYSTEM
   ============================================ */
.grid, .gen-grid {
    display: grid;
    gap: 20px;
}

.grid-2, .gen-grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3, .gen-grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4, .gen-grid-4 { grid-template-columns: repeat(4, 1fr); }

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

/* ============================================
   FOOTER
   ============================================ */
.footer, .gen-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer a, .gen-footer a {
    color: var(--accent);
    text-decoration: none;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: #6cff6c; }
.text-warning { color: #ffc107; }
.text-danger { color: #ff6b6b; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ============================================
   SCROLLBAR (Dark)
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}


/* ============================================
   STATS CARDS
   ============================================ */
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.stat-card.success .stat-value { color: #6cff6c; }
.stat-card.warning .stat-value { color: #ffc107; }
.stat-card.danger .stat-value { color: #ff6b6b; }
.stat-card.info .stat-value { color: #17a2b8; }
.stat-card.bitcoin .stat-value { color: var(--bitcoin); }

/* ============================================
   MODULE CARDS
   ============================================ */
.module-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.module-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.module-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.module-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

.module-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   QUIZ ELEMENTS
   ============================================ */
.quiz-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.quiz-question {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 25px;
    line-height: 1.5;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

.quiz-option:hover {
    border-color: var(--accent);
    background: rgba(67, 210, 64, 0.1);
}

.quiz-option.selected {
    border-color: var(--accent);
    background: rgba(67, 210, 64, 0.2);
}

.quiz-option.correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.2);
}

.quiz-option.incorrect {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.2);
}

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.leaderboard-item:hover {
    border-color: var(--accent);
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: var(--border);
    color: #fff;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #000;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: #fff;
}

.leaderboard-name {
    flex: 1;
    font-weight: 600;
    color: #fff;
}

.leaderboard-score {
    font-weight: bold;
    color: var(--accent);
}

.leaderboard-sats {
    color: var(--bitcoin);
    font-weight: 600;
}


/* ============================================
   MODAL / DIALOG
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal {
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

/* ============================================
   LOADING / SPINNER
   ============================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.loading-text {
    color: var(--accent);
    font-size: 1rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--accent-glow); }
    50% { box-shadow: 0 0 20px var(--accent-glow); }
}

.animate-fade { animation: fadeIn 0.3s ease; }
.animate-slide { animation: slideUp 0.3s ease; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-glow { animation: glow 2s infinite; }

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .container, .gen-container {
        padding: 15px;
    }
    
    .header, .gen-header {
        padding: 10px 15px;
    }
    
    .header h1, .gen-brand h1 {
        font-size: 1rem;
    }
    
    .header-nav, .gen-header-nav {
        width: 100%;
        justify-content: center;
    }
    
    .nav-tabs, .gen-tabs {
        padding: 0 10px;
    }
    
    .nav-tab, .gen-tab {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .card, .gen-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .quiz-question {
        font-size: 1.1rem;
    }
    
    .module-card {
        padding: 15px;
    }
    
    .module-icon {
        font-size: 2rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .header, .gen-header,
    .nav-tabs, .gen-tabs,
    .footer, .gen-footer,
    .btn, .gen-btn {
        display: none;
    }
    
    .card, .gen-card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

