/* ============================================
   KI-SCHULUNG ONLINE — Design System
   MAMMAM-AI © 2026
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #06060f;
  --bg-secondary: #0d0d1f;
  --bg-tertiary: #141430;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-hover: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f0f8;
  --text-secondary: #8888aa;
  --text-muted: #555570;
  --accent: #7c6cf0;
  --accent-light: #a89afe;
  --accent-dark: #5a4cd0;
  --gold: #f0c040;
  --gold-dark: #d4a020;
  --green: #34d399;
  --red: #f87171;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(124, 108, 240, 0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(124, 108, 240, 0.15);
  --shadow-gold: 0 0 30px rgba(240, 192, 64, 0.15);
  --gradient-hero: linear-gradient(160deg, #06060f 0%, #1a1040 50%, #0d0d1f 100%);
  --gradient-accent: linear-gradient(135deg, #7c6cf0, #a89afe);
  --gradient-gold: linear-gradient(135deg, #f0c040, #f0932b);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

img { max-width: 100%; display: block; }

/* ── Utility ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-accent { color: var(--accent-light); }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 108, 240, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 108, 240, 0.5);
  color: #fff;
}
.btn-gold {
  background: var(--gradient-gold);
  color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(240, 192, 64, 0.3);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(240, 192, 64, 0.5);
  color: #1a1a2e;
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-glass-hover); color: var(--text-primary); }
.btn-sm { padding: 10px 20px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: 0.9; color: #fff; }
.btn-success { background: var(--green); color: #0a0a1a; }

/* ── Navigation ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 0;
  background: rgba(6, 6, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-brand {
  font-size: 20px; font-weight: 800; color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
}
.nav-brand span { font-size: 24px; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a { padding: 8px 16px; border-radius: var(--radius-xs); font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.nav-links a:hover { color: var(--text-primary); background: var(--bg-glass); }

/* ── Language Switcher ── */
.lang-switcher {
  display: flex; gap: 2px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px; margin-right: 4px;
}
.lang-btn {
  padding: 4px 8px;
  border: none; border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.lang-btn:hover { color: var(--text-primary); background: var(--bg-glass-hover); }
.lang-btn.active {
  background: var(--accent-gradient);
  background: var(--gradient-accent);
  color: #fff;
}

/* ── Hero Section ── */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  background: var(--gradient-hero);
  padding-top: 80px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -50%; right: -30%;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(124, 108, 240, 0.08) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
}
.hero::after {
  content: '';
  position: absolute; bottom: -30%; left: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(240, 192, 64, 0.05) 0%, transparent 70%);
  animation: float 25s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 50px;
  background: var(--bg-glass);
  border: 1px solid var(--border-accent);
  font-size: 13px; color: var(--accent-light);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 900; line-height: 1.1;
  margin-bottom: 20px;
}
.hero h1 .gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.subtitle {
  font-size: 18px; color: var(--text-secondary);
  max-width: 540px; margin-bottom: 32px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ── Section ── */
.section { padding: 100px 0; }
.section-title {
  font-size: 36px; font-weight: 800; margin-bottom: 12px;
}
.section-subtitle {
  font-size: 16px; color: var(--text-secondary); max-width: 500px; margin: 0 auto 48px;
}

/* ── Course Cards ── */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.course-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-accent);
  opacity: 0; transition: opacity var(--transition);
}
.course-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.course-card:hover::before { opacity: 1; }
.course-card.featured { border-color: var(--gold-dark); }
.course-card.featured::before { background: var(--gradient-gold); opacity: 1; }
.course-level {
  display: inline-block; padding: 4px 12px;
  border-radius: 50px; font-size: 12px; font-weight: 700;
  background: var(--bg-glass); color: var(--accent-light);
  margin-bottom: 16px;
}
.course-card.featured .course-level { background: rgba(240,192,64,0.15); color: var(--gold); }
.course-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.course-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }
.course-meta { display: flex; gap: 16px; margin-bottom: 24px; }
.course-meta span {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.course-topics { list-style: none; margin-bottom: 24px; }
.course-topics li {
  padding: 6px 0; font-size: 14px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.course-topics li::before { content: '✓'; color: var(--green); font-weight: 700; }
.course-price {
  display: flex; align-items: baseline; gap: 4px;
  margin-bottom: 20px;
}
.course-price .amount { font-size: 40px; font-weight: 900; color: var(--text-primary); }
.course-price .currency { font-size: 18px; color: var(--text-secondary); }
.course-price .period { font-size: 13px; color: var(--text-muted); }

/* ── Steps ── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.step {
  text-align: center; padding: 32px 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all var(--transition);
}
.step:hover { border-color: var(--border-accent); }
.step-number {
  width: 48px; height: 48px; margin: 0 auto 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-accent); font-weight: 800; font-size: 18px;
}
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: 13px; color: var(--text-secondary); }

/* ── Auth Page ── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-hero); padding: 24px;
}
.auth-box {
  width: 100%; max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px; box-shadow: var(--shadow-md);
}
.auth-box h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.auth-box .subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 32px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 32px; background: var(--bg-card); border-radius: var(--radius-sm); padding: 4px; }
.auth-tab {
  flex: 1; padding: 10px; text-align: center;
  border: none; background: transparent;
  color: var(--text-secondary); font-family: var(--font);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-xs); transition: all var(--transition);
}
.auth-tab.active { background: var(--accent); color: #fff; }

/* ── Form ── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%; padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font); font-size: 15px;
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text-muted); }
.form-error {
  display: none; padding: 10px 16px; margin-bottom: 16px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-xs);
  color: var(--red); font-size: 13px;
}
.form-error.show { display: block; }
.form-success {
  display: none; padding: 10px 16px; margin-bottom: 16px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: var(--radius-xs);
  color: var(--green); font-size: 13px;
}
.form-success.show { display: block; }

/* ── Dashboard ── */
.dash-page {
  min-height: 100vh; background: var(--bg-primary);
  padding-top: 80px;
}
.dash-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.dash-header h1 { font-size: 28px; font-weight: 800; }
.dash-header p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; transition: all var(--transition);
}
.dash-card:hover { border-color: var(--border-accent); }
.dash-card.locked { opacity: 0.5; }
.dash-card-video {
  aspect-ratio: 16/9; background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.dash-card-video iframe {
  width: 100%; height: 100%; border: none;
}
.lock-overlay {
  position: absolute; inset: 0;
  background: rgba(6, 6, 15, 0.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
}
.lock-overlay .lock-icon { font-size: 48px; }
.lock-overlay p { font-size: 14px; color: var(--text-secondary); }
.dash-card-body { padding: 20px; }
.dash-card-body h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.dash-card-body p { font-size: 13px; color: var(--text-secondary); }

/* ── Admin ── */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 40px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
}
.stat-card .stat-value { font-size: 32px; font-weight: 800; }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 24px;
}
.admin-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

.user-table { width: 100%; border-collapse: collapse; }
.user-table th, .user-table td {
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.user-table th { color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.user-table tr:hover td { background: var(--bg-glass); }
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 50px; font-size: 11px; font-weight: 600;
}
.badge-level { background: rgba(124, 108, 240, 0.15); color: var(--accent-light); }
.badge-active { background: rgba(52, 211, 153, 0.15); color: var(--green); }

.add-user-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }

/* ── Materials Download ── */
.dash-card-materials {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
}
.dash-card-materials h4 {
  font-size: 14px; font-weight: 700;
  margin-bottom: 12px; color: var(--text-secondary);
}
.material-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
  font-size: 13px; color: var(--text-primary);
  transition: all var(--transition);
  text-decoration: none;
}
.material-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-accent);
  color: var(--text-primary);
}
.material-action {
  margin-left: auto;
  color: var(--accent-light);
  font-weight: 600; font-size: 12px;
  white-space: nowrap;
}

/* ── Footer ── */
.footer {
  padding: 40px 0; border-top: 1px solid var(--border);
  text-align: center;
}
.footer p { font-size: 13px; color: var(--text-muted); }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-top: 12px; }
.footer-links a { font-size: 13px; color: var(--text-secondary); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .hero-actions { flex-direction: column; }
  .courses-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .add-user-form { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
  .user-table { font-size: 12px; }
  .user-table th, .user-table td { padding: 8px; }
}

/* ── Loading ── */
.loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Checkbox for levels ── */
.level-checks { display: flex; gap: 12px; }
.level-check { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.level-check input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--accent);
}
