/* ============================================
   WIFI KI-Führerschein Interactive Live App
   Single CSS file — mobile-first
   ============================================ */

/* 1. Custom Properties (WIFI CI) */
:root {
  --wifi-green: #339900;
  --wifi-green-deep: #1F6B00;
  --wifi-green-bright: #12B76A;
  --anthracite: #101828;
  --graphite: #22262A;
  --grey-700: #475467;
  --grey-500: #878F97;
  --grey-300: #D0D5DD;
  --grey-200: #EAECEF;
  --grey-100: #F2F4F7;
  --paper: #FFFFFF;
  --ivory: #FBFCFF;
  --soft: #F9FAFB;
  --surface: #FFFFFF;
  --warn: #F08C00;
  --success: #12B76A;
  --green-glow: rgba(51,153,0,0.14);
  --green-subtle: rgba(51,153,0,0.06);
  /* Ampelfarben */
  --ampel-gruen: #22C55E;
  --ampel-gelb: #EAB308;
  --ampel-rot: #EF4444;
  --ampel-orange: #F97316;
}

/* 2. Reset + Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--soft);
  color: var(--anthracite);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 3. Mobile TN Styles */
.tn-page {
  width: 100%; min-height: 100dvh; padding: 1rem;
  max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column;
}
.tn-header {
  background: var(--wifi-green); color: var(--paper);
  padding: .75rem 1rem; border-radius: 0 0 12px 12px;
  font-weight: 700; margin: -1rem -1rem .75rem;
  width: calc(100% + 2rem);
  display: flex; justify-content: space-between; align-items: center;
}
a.tn-header { text-decoration: none; transition: background .15s; }
a.tn-header:hover { background: var(--wifi-green-deep, #1F6B00); }
a.tn-header .tn-back-arrow { font-size: .85rem; opacity: .85; font-weight: 500; letter-spacing: .02em; }
.tn-nick {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 500; opacity: .85;
}
.tn-nick button {
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  border-radius: 4px; padding: 2px 8px; font-size: .65rem;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.tn-nick button:hover { background: rgba(255,255,255,0.3); }
.tn-card {
  background: var(--paper); border-radius: 12px;
  padding: 1.25rem; margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.tn-btn {
  min-height: 48px; border-radius: 8px; font-weight: 600;
  cursor: pointer; border: none; font-size: 1rem;
  width: 100%; margin-bottom: 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.15s;
}
.tn-btn:active { opacity: 0.85; }
.tn-btn-primary { background: var(--wifi-green); color: var(--paper); }
.tn-btn-gruen  { background: var(--ampel-gruen); color: var(--paper); }
.tn-btn-gelb   { background: var(--ampel-gelb); color: var(--anthracite); }
.tn-btn-rot    { background: var(--ampel-rot); color: var(--paper); }
.tn-btn-grey   { background: var(--grey-200); color: var(--grey-700); }

/* Back-to-Deck Button — eigene polierte Variante für die "← Kartendeck" CTAs auf Challenge-Pages */
.tn-btn-deck {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.5rem; min-height: 0;
  background: linear-gradient(180deg, #FFFFFF, #F9FAFB);
  color: var(--anthracite);
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .9rem;
  letter-spacing: .01em;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 16px rgba(51,153,0,.08);
  transition: all .15s;
  cursor: pointer; width: auto; margin: 0;
}
.tn-btn-deck:hover {
  border-color: var(--wifi-green);
  color: var(--wifi-green-deep);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(16,24,40,.06), 0 10px 22px rgba(51,153,0,.18);
}
.tn-btn-deck:active { transform: scale(.98); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.tn-btn-deck-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--wifi-green); color: #fff;
  font-size: .8rem; font-weight: 900; line-height: 1;
}
.tn-btn-deck:hover .tn-btn-deck-ico { background: var(--wifi-green-deep); }
.tn-btn-deck-sub { font-size: .7rem; font-weight: 600; color: var(--grey-500); margin-left: .15rem; }

.tn-input {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--grey-300); border-radius: 8px;
  font-size: 1rem; background: var(--paper);
}
.tn-select {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--grey-300); border-radius: 8px;
  font-size: 1rem; background: var(--paper);
  appearance: auto;
}
.tn-progress {
  height: 6px; background: var(--grey-200);
  border-radius: 3px; overflow: hidden;
}
.tn-progress-bar {
  height: 100%; background: var(--wifi-green);
  border-radius: 3px; transition: width 0.3s;
}
.tn-badge {
  display: inline-block; padding: 4px 12px;
  border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.tn-badge-gruen { background: var(--ampel-gruen); color: var(--paper); }
.tn-badge-gelb  { background: var(--ampel-gelb); color: var(--anthracite); }
.tn-badge-rot   { background: var(--ampel-rot); color: var(--paper); }

.tn-waiting { text-align: center; color: var(--grey-500); animation: pulse 2s infinite; }
.tn-score { font-size: 3rem; font-weight: 800; text-align: center; }

.tn-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--grey-200); }
.tn-tab {
  flex: 1; padding: 10px; text-align: center;
  border-bottom: 2px solid transparent; cursor: pointer;
  background: none; border-top: none; border-left: none; border-right: none;
  font-size: 0.9rem; color: var(--grey-500);
}
.tn-tab.active { border-bottom-color: var(--wifi-green); color: var(--wifi-green); font-weight: 600; }

.tn-checklist { list-style: none; }
.tn-checklist li {
  padding: 12px 0; border-bottom: 1px solid var(--grey-100);
  display: flex; align-items: center; gap: 12px;
}
.tn-checkbox { width: 24px; height: 24px; accent-color: var(--wifi-green); }

/* 4. Ampel Components */
.ampel-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.ampel-dot-gruen { background: var(--ampel-gruen); }
.ampel-dot-gelb  { background: var(--ampel-gelb); }
.ampel-dot-rot   { background: var(--ampel-rot); }

.ampel-bar { height: 24px; border-radius: 4px; display: flex; overflow: hidden; }
.ampel-bar > div { transition: width 0.5s; }
.ampel-result { text-align: center; padding: 2rem; }

/* 5. Beamer / Trainer Dashboard */
.dashboard {
  width: 100vw; height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: var(--anthracite); color: var(--paper);
  font-family: 'Poppins', sans-serif; overflow: hidden;
}
.kpi-bar {
  display: flex; gap: 8px; padding: 6px 16px;
  align-items: stretch;
  background: linear-gradient(180deg, var(--graphite) 0%, rgba(34,38,42,0.95) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.kpi-card {
  flex: 1; background: rgba(255,255,255,0.05);
  border-radius: 8px; padding: 6px 12px; text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--wifi-green);
}
.kpi-value {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem; font-weight: 900; color: var(--wifi-green);
  line-height: 1.1; letter-spacing: -0.01em;
}
.kpi-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.6rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--grey-500); font-weight: 700;
  margin-top: 2px;
}
.tab-nav {
  display: flex; gap: 0;
  background: rgba(16,24,40,0.5);
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 12px;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 6px 14px; background: none; border: none;
  color: var(--grey-500); cursor: pointer; white-space: nowrap;
  font-family: 'Poppins', sans-serif;
  font-size: 0.68rem; font-weight: 600;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.02em;
  transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover { color: var(--grey-300); }
.tab-btn.active { color: var(--paper); border-bottom-color: var(--wifi-green); }
.tab-btn.station::before { content: '◉ '; color: var(--wifi-green); font-size: 0.6rem; }
.tab-btn.slide::before { content: '▸ '; opacity: 0.4; font-size: 0.6rem; }
/* tab-content styles moved to section 6 (slide content) */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

.feed {
  background: rgba(0,0,0,0.35); padding: 8px 20px;
  overflow-y: auto; font-size: 0.72rem; color: var(--grey-300);
  border-top: 1px solid rgba(255,255,255,0.06);
  max-height: 80px;
}
.feed-item {
  padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex; gap: 8px; align-items: baseline;
}
.feed-time { color: var(--grey-500); min-width: 45px; font-size: 0.65rem; font-weight: 500; }
.feed-nick { color: var(--wifi-green-bright); font-weight: 700; font-size: 0.7rem; }
.feed-action { color: var(--grey-500); font-size: 0.68rem; }

/* 6. Slide Content (dashboard) — LIGHT THEME */
.tab-content {
  background: var(--paper);
  overflow-y: auto; padding: 32px 40px;
  position: relative;
  min-height: 0; /* critical for CSS grid 1fr to work */
}
.tab-content::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 18% 28%, var(--green-subtle) 0%, transparent 55%),
              radial-gradient(circle at 82% 72%, rgba(48,76,90,0.05) 0%, transparent 55%);
  pointer-events: none;
}
.slide {
  max-width: 1000px; margin: 0 auto; color: var(--anthracite);
  display: flex; flex-direction: column;
  justify-content: center; position: relative; z-index: 1;
}
.slide h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 800;
  margin-bottom: 0.75rem; letter-spacing: -0.02em; line-height: 1.18;
  color: var(--anthracite);
}
.slide h2 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: 700;
  color: var(--anthracite); margin-bottom: 0.75rem;
}
.slide p {
  font-size: 1.05rem; line-height: 1.7; margin-bottom: 1rem;
  color: var(--grey-700);
}

/* Slide — brand (green gradient) variant */
.slide.pg-brand {
  background: linear-gradient(135deg, #1F6B00 0%, #339900 55%, #5BBA34 100%);
  border-radius: 18px; padding: 3rem 2.5rem; color: #fff;
  position: relative; overflow: hidden;
}
.slide.pg-brand::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 22% 78%, rgba(0,0,0,0.12) 0%, transparent 50%),
              radial-gradient(circle at 78% 22%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.slide.pg-brand h1, .slide.pg-brand h2 { color: #fff; }
.slide.pg-brand p { color: rgba(255,255,255,0.92); }
.slide.pg-brand .sn { color: #fff; opacity: 0.18; }
.slide.pg-brand .sl { color: rgba(255,255,255,0.85); }

/* Slide — light-alt variant */
.slide.pg-light-alt {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--soft) 100%);
  border-radius: 18px; padding: 2.5rem 2rem; position: relative; overflow: hidden;
}
.slide.pg-light-alt::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 72% 22%, rgba(48,76,90,0.07) 0%, transparent 55%),
              radial-gradient(circle at 28% 82%, var(--green-subtle) 0%, transparent 55%);
  pointer-events: none;
}

/* WIFI CI components for slides */
.slide .sn {
  font-family: 'Poppins', sans-serif; font-weight: 900;
  font-size: 4.2rem; color: var(--wifi-green); opacity: 0.18;
  line-height: 1; margin-bottom: -0.5rem; letter-spacing: -0.02em;
}
.slide .sl {
  font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--wifi-green-deep); margin-bottom: 0.25rem; font-weight: 800;
}
.slide .ml {
  width: 54px; height: 3px; background: var(--wifi-green);
  border-radius: 2px; margin: 1.5rem auto;
}
.slide .metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin: 1.5rem 0;
}
.slide .metric {
  background: var(--surface); border: 1px solid var(--grey-200);
  border-radius: 14px; padding: 1.25rem 1.5rem; text-align: center;
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.slide .metric::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--wifi-green);
}
.slide .metric:hover {
  transform: translateY(-2px); box-shadow: 0 10px 28px rgba(16,24,40,0.08);
}
.slide.pg-brand .metric {
  background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
}
.slide.pg-brand .metric::before { background: #fff; }
.slide .metric-val {
  font-family: 'Poppins', sans-serif; font-weight: 900;
  font-size: clamp(1.5rem, 3vw, 2rem); color: var(--wifi-green-deep); line-height: 1.1;
}
.slide.pg-brand .metric-val { color: #fff; }
.slide .metric-unit {
  font-family: 'Poppins', sans-serif; font-weight: 700;
  font-size: 0.68rem; color: var(--grey-300); letter-spacing: 0.06em;
  text-transform: uppercase; margin-top: 0.2rem;
}
.slide .metric-label {
  font-size: 0.8rem; color: var(--grey-500); margin-top: 0.45rem;
}
.slide.pg-brand .metric-label { color: rgba(255,255,255,0.9); }

/* Flow component */
.slide .flow {
  display: flex; align-items: stretch; gap: 0; margin: 1.5rem 0;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--grey-200);
}
.slide .flow-item {
  flex: 1; padding: 1.1rem 0.75rem; background: var(--surface);
  position: relative; text-align: center; transition: background 0.2s;
}
.slide .flow-item:hover { background: var(--green-subtle); }
.slide .flow-item:not(:last-child) { border-right: 1px solid var(--grey-200); }
.slide .flow-item:not(:last-child)::after {
  content: '\2192'; position: absolute; right: -0.6rem; top: 50%;
  transform: translateY(-50%); font-size: 0.75rem; color: #fff; z-index: 2;
  background: var(--wifi-green); width: 1.15rem; height: 1.15rem;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: bold; line-height: 1;
}
.slide .flow-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.slide .flow-label {
  font-family: 'Poppins', sans-serif; font-weight: 800;
  font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--wifi-green-deep);
}
.slide .flow-text {
  font-size: 0.75rem; color: var(--grey-500); line-height: 1.4; margin-top: 0.15rem;
}

/* Callout boxes */
.slide .note {
  background: var(--green-subtle); border-left: 3px solid var(--wifi-green);
  border-radius: 0 8px 8px 0; padding: 1rem 1.25rem; margin: 1.25rem 0;
  font-size: 0.92rem; color: var(--grey-700);
}
.slide .note strong { color: var(--wifi-green-deep); }
.slide .warn {
  background: rgba(240,140,0,0.08); border-left: 3px solid var(--warn);
  border-radius: 0 8px 8px 0; padding: 1rem 1.25rem; margin: 1.25rem 0;
  font-size: 0.92rem; color: var(--grey-700);
}
.slide .warn strong { color: #B36600; }

/* Quote */
.slide .quote {
  display: block; border-left: 3px solid var(--wifi-green);
  padding: 1.25rem 1.5rem 1.25rem 3rem; margin: 1.25rem 0;
  background: var(--green-glow); border-radius: 0 12px 12px 0; position: relative;
}
.slide .quote::before {
  content: '\201C'; position: absolute; top: 0.2rem; left: 0.7rem;
  font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 3rem;
  color: rgba(51,153,0,0.35); line-height: 1;
}

/* Bordered item cards (for DSGVO list etc.) */
.slide .item-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border-radius: 12px; padding: 1.15rem 1.25rem;
  border: 1px solid var(--grey-200); border-left: 4px solid var(--wifi-green);
  transition: transform 0.2s, box-shadow 0.2s;
}
.slide .item-card:hover {
  transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,40,0.06);
}
.slide .item-card .item-title {
  font-family: 'Poppins', sans-serif; font-weight: 800;
  font-size: 0.95rem; color: var(--anthracite);
}
.slide .item-card .item-desc {
  font-size: 0.85rem; color: var(--grey-500); margin-top: 2px; line-height: 1.5;
}

/* Pyramid (for risk classes) */
.slide .pyramid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.slide .pyramid-level {
  color: white; padding: 12px 24px; border-radius: 10px;
  font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 0.85rem;
  text-align: center; transition: transform 0.2s;
}
.slide .pyramid-level:hover { transform: scale(1.03); }

/* Instruction card */
.slide .instr-card {
  background: var(--surface); border: 1px solid var(--grey-200);
  border-radius: 16px; padding: 2.5rem; margin: 1.5rem auto; max-width: 640px;
  box-shadow: 0 4px 16px rgba(16,24,40,0.04);
}
.slide.pg-brand .instr-card {
  background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.2);
  backdrop-filter: blur(6px); color: #fff;
}
.slide .trainer-note {
  font-size: 0.88rem; color: var(--grey-500); font-style: italic; margin-top: 1.5rem;
}

/* 7. Station Board (dashboard) */
.board-grid {
  max-width: 1100px; margin: 0 auto;
}
.board-card {
  background: rgba(255,255,255,0.05); border-radius: 10px; padding: 16px;
  border: 1px solid rgba(255,255,255,0.06); margin-bottom: 8px;
}
.board-card h2, .board-grid h2 {
  font-family: 'Poppins', sans-serif; font-weight: 800;
  font-size: 1.1rem; margin-bottom: 1rem; color: var(--paper);
}
.board-card h3 { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 0.9rem; color: var(--wifi-green); margin-bottom: 0.5rem; }
.leaderboard { list-style: none; }
.leaderboard li {
  padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; justify-content: space-between; font-size: 0.85rem;
}
.leaderboard .rank { color: var(--wifi-green); font-weight: 800; }
.heatmap-row {
  display: flex; gap: 6px; margin-bottom: 6px;
  align-items: center;
}
.heatmap-cell {
  flex: 1; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem;
}

/* 8. PIN Overlay */
.pin-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, rgba(16,24,40,0.97) 0%, rgba(31,107,0,0.15) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.pin-box {
  background: rgba(34,38,42,0.9); border-radius: 20px;
  padding: 3rem; text-align: center; max-width: 340px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.pin-box h2 {
  font-family: 'Poppins', sans-serif; font-weight: 800;
  font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--paper);
}
.pin-box p { font-size: 0.85rem; color: var(--grey-500); margin-bottom: 1.5rem; }
.pin-input {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem; text-align: center; letter-spacing: 0.5em;
  width: 220px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); color: var(--paper);
  border-radius: 12px; padding: 14px;
  transition: border-color 0.2s;
}
.pin-input:focus { outline: none; border-color: var(--wifi-green); box-shadow: 0 0 0 3px rgba(51,153,0,0.2); }

/* 9. Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.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; }

.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.pulse { animation: pulse 2s infinite; }

/* 10. Responsive — beamer overrides */
@media (min-width: 1200px) {
  .tn-page { max-width: 480px; }
}
