/* ============================================================
   Wechseljahres-Kompass – Mitgliederbereich
   Design: Warm, feminin, gut lesbar (Zielgruppe 40–65 Jahre)
   ============================================================ */

/* ---- Custom Properties ------------------------------------ */
:root {
  --clr-primary:     #7B5EA7;   /* Lavendel-Lila */
  --clr-primary-dk:  #5E4285;
  --clr-primary-lt:  #EDE7F6;
  --clr-accent:      #C47E72;   /* Warmes Rosa */
  --clr-accent-lt:   #F9EDE9;
  --clr-success:     #4CAF82;
  --clr-error:       #C0392B;
  --clr-warning:     #E8943A;

  --clr-bg:          #FDF6F0;   /* Warmes Cremeweiß */
  --clr-surface:     #FFFFFF;
  --clr-border:      #E8D9D0;
  --clr-text:        #3D2B35;   /* Dunkles Pflaume */
  --clr-text-muted:  #7D6370;
  --clr-text-light:  #B09AA4;

  --radius-sm:  6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm:  0 1px 3px rgba(61,43,53,.08);
  --shadow-md:  0 4px 16px rgba(61,43,53,.10);
  --shadow-lg:  0 8px 32px rgba(61,43,53,.14);

  --font-sans: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --font-size-base: 17px;
  --line-height: 1.65;

  --nav-width: 260px;
  --header-height: 68px;
}

/* ---- Reset & Base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--font-size-base); scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: var(--line-height);
  min-height: 100vh;
}

a { color: var(--clr-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--clr-text);
}

/* ---- Google Fonts laden (Nunito) ------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

/* ============================================================
   LAYOUT
   ============================================================ */

/* Authentifizierungs-Layout (Login / Registrierung) */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--clr-primary-lt) 0%, var(--clr-accent-lt) 100%);
  padding: 2rem 1rem;
}

.auth-box {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo img { margin: 0 auto 0.75rem; max-height: 64px; }

.auth-logo h1 {
  font-size: 1.4rem;
  color: var(--clr-primary);
}

.auth-logo p {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  margin-top: 0.25rem;
}

/* Innen-Layout (eingeloggte Seiten) */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--nav-width);
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-logo {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--clr-border);
}

.sidebar-logo img { max-height: 48px; }
.sidebar-logo span {
  display: block;
  font-size: 0.78rem;
  color: var(--clr-text-muted);
  margin-top: 0.35rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--clr-text-light);
  padding: 1rem 1.5rem 0.4rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: var(--clr-text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0;
  transition: background .15s, color .15s;
}

.nav-link svg { flex-shrink: 0; opacity: .75; }

.nav-link:hover,
.nav-link.aktiv {
  background: var(--clr-primary-lt);
  color: var(--clr-primary);
  text-decoration: none;
}

.nav-link.aktiv svg { opacity: 1; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--clr-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-user-name { font-weight: 700; color: var(--clr-text); }
.sidebar-user-role { font-size: 0.78rem; color: var(--clr-text-muted); }

/* Hauptinhalt */
.main-content {
  flex: 1;
  margin-left: var(--nav-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-height);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 1.2rem; font-weight: 700; }

.topbar-actions { display: flex; align-items: center; gap: 1rem; }

.page-body {
  padding: 2rem;
  flex: 1;
}

/* ============================================================
   KOMPONENTEN
   ============================================================ */

/* Karten */
.card {
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-size: 1.05rem; font-weight: 700; }
.card-body  { padding: 1.5rem; }

/* Formulare */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--clr-text);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--clr-text);
  background: var(--clr-bg);
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(123,94,167,.15);
  background: #fff;
}

.form-control::placeholder { color: var(--clr-text-light); }

textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: 0.82rem;
  color: var(--clr-text-muted);
  margin-top: 0.35rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--clr-primary);
  color: #fff;
  border-color: var(--clr-primary);
}
.btn-primary:hover {
  background: var(--clr-primary-dk);
  border-color: var(--clr-primary-dk);
  text-decoration: none;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--clr-primary);
  border-color: var(--clr-primary);
}
.btn-outline:hover {
  background: var(--clr-primary-lt);
  text-decoration: none;
}

.btn-accent {
  background: var(--clr-accent);
  color: #fff;
  border-color: var(--clr-accent);
}
.btn-accent:hover {
  background: #b06c60;
  border-color: #b06c60;
  text-decoration: none;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--clr-text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--clr-bg); color: var(--clr-text); text-decoration: none; }

.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.05rem; }
.btn-full { width: 100%; }

.btn-danger { background: var(--clr-error); color: #fff; border-color: var(--clr-error); }
.btn-danger:hover { background: #a32421; border-color: #a32421; text-decoration: none; color: #fff; }

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert--success { background: #E8F5EE; color: #2D7A52; border-left: 4px solid var(--clr-success); }
.alert--error   { background: #FDECEA; color: var(--clr-error); border-left: 4px solid var(--clr-error); }
.alert--info    { background: var(--clr-primary-lt); color: var(--clr-primary-dk); border-left: 4px solid var(--clr-primary); }
.alert--warning { background: #FEF3E2; color: #7D4A0F; border-left: 4px solid var(--clr-warning); }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-primary { background: var(--clr-primary-lt); color: var(--clr-primary); }
.badge-success { background: #E8F5EE; color: #2D7A52; }
.badge-muted   { background: var(--clr-bg); color: var(--clr-text-muted); border: 1px solid var(--clr-border); }
.badge-accent  { background: var(--clr-accent-lt); color: var(--clr-accent); }

/* Fortschrittsbalken */
.progress-bar-wrap {
  height: 10px;
  background: var(--clr-border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  border-radius: 100px;
  transition: width .5s ease;
}

/* ============================================================
   VIDEO-BEREICH
   ============================================================ */

.module-grid {
  display: grid;
  gap: 1.5rem;
}

.module-card {
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.module-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--clr-primary-lt), var(--clr-accent-lt));
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.module-header:hover { filter: brightness(.97); }

.module-woche {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.module-titel { font-size: 1.05rem; font-weight: 700; margin-top: 0.15rem; }

.module-toggle-icon {
  width: 28px; height: 28px;
  background: var(--clr-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .2s;
}

.module-card.offen .module-toggle-icon { transform: rotate(180deg); }

.video-liste {
  display: none;
  padding: 0.5rem 0 0.75rem;
}

.module-card.offen .video-liste { display: block; }

.video-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  color: var(--clr-text);
  transition: background .12s;
  border-bottom: 1px solid var(--clr-bg);
}

.video-item:hover { background: var(--clr-primary-lt); text-decoration: none; }

.video-thumb {
  width: 80px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #e0d0e8;
}

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

.video-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.3);
  color: #fff;
}

.video-info { flex: 1; min-width: 0; }
.video-titel { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-meta  { font-size: 0.82rem; color: var(--clr-text-muted); margin-top: 0.15rem; }

.video-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--clr-text-light);
}

.video-check.gesehen {
  background: var(--clr-success);
  color: #fff;
}

/* Video-Player Seite */
.video-player-wrap {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-player-wrap iframe,
.video-player-wrap video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ============================================================
   DOWNLOADS
   ============================================================ */

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s;
  text-decoration: none;
  color: var(--clr-text);
}

.download-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--clr-primary);
  text-decoration: none;
}

.download-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.download-icon.pdf     { background: #FDECEA; color: var(--clr-error); }
.download-icon.word    { background: #E3F2FD; color: #1565C0; }
.download-icon.excel   { background: #E8F5EE; color: #2D7A52; }
.download-icon.default { background: var(--clr-primary-lt); color: var(--clr-primary); }

.download-name  { font-weight: 700; font-size: 0.95rem; }
.download-meta  { font-size: 0.8rem; color: var(--clr-text-muted); margin-top: 0.15rem; }

/* ============================================================
   DASHBOARD - STATS
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stat-label { font-size: 0.82rem; color: var(--clr-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--clr-primary); line-height: 1.1; margin-top: 0.25rem; }
.stat-sub   { font-size: 0.82rem; color: var(--clr-text-muted); margin-top: 0.25rem; }

/* Willkommens-Banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-accent) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.welcome-text h2 { color: #fff; font-size: 1.5rem; margin-bottom: 0.35rem; }
.welcome-text p  { color: rgba(255,255,255,.85); font-size: 0.95rem; }

.welcome-progress { text-align: right; min-width: 140px; }
.welcome-progress .percent { font-size: 2.5rem; font-weight: 800; }
.welcome-progress small    { font-size: 0.82rem; opacity: .85; display: block; }

/* ============================================================
   ADMIN
   ============================================================ */

.admin-table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--clr-bg);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  border-bottom: 2px solid var(--clr-border);
}

td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--clr-bg); }

/* Admin Topbar – rot markiert */
.admin-badge {
  background: var(--clr-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  letter-spacing: .05em;
}

/* ============================================================
   HAMBURGER / MOBILE
   ============================================================ */

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--clr-text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.offen {
    transform: translateX(0);
  }
  .sidebar-overlay.aktiv { display: block; }
  .hamburger-btn { display: flex; }
  .main-content { margin-left: 0; }
  .page-body { padding: 1.25rem; }
  .welcome-banner { flex-direction: column; text-align: center; }
  .welcome-progress { text-align: center; }
  .downloads-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem;  }
.mt-3 { margin-top: 1rem;   }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem;   }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem;  }
.mb-3 { margin-bottom: 1rem;   }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem;   }
.text-muted  { color: var(--clr-text-muted); }
.text-center { text-align: center; }
.d-flex      { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex-1 { flex: 1; }
.divider { border: none; border-top: 1px solid var(--clr-border); margin: 1.5rem 0; }
