/* =========================================================
   Quad-Th Anmeldung – App UI CSS (FINAL / STABIL)
   - Kein Farbwechsel beim Scrollen
   - Header scrollt normal mit (nicht sticky)
   - Bilder in Terminbeschreibung responsiv
   ========================================================= */

:root{
  --bg:#070a12;
  --surface:#0b1220;

  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.65);
  --border:rgba(255,255,255,.14);

  --primary:#7c3aed;
  --primary2:#60a5fa;
  --ok:#22c55e;
  --warn:#f59e0b;
  --danger:#ef4444;

  --r:18px;
  --r2:22px;

  --shadow:0 14px 32px rgba(0,0,0,.45);

  /* ALT: 680/560 war zu eng für Desktop-Tabellen */
  --appw:1200px;
  --contentw:980px;
}

/* ================= BASE ================= */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{ color:var(--primary2); text-decoration:none; }
a:hover{ text-decoration:underline; }

/* ================= APP LAYOUT ================= */
.app{
  /* Mobile bleibt app-like, Desktop deutlich breiter */
  width:min(var(--appw), calc(100% - 36px));
  margin:14px auto 90px;
}

/* Ab sehr großen Screens noch etwas mehr Luft */
@media (min-width: 1400px){
  :root{
    --appw:1400px;
    --contentw:1120px;
  }
  .app{
    width:min(var(--appw), calc(100% - 44px));
  }
}

/* ================= APPBAR =================
   FIX: nicht sticky, damit Header beim Scrollen mitwandert
*/
.appbar{
  position: relative;           /* vorher: sticky */
  top:auto;
  z-index:auto;

  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r2);
  box-shadow:var(--shadow);
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
}
.brand-dot{
  width:34px;
  height:34px;
  border-radius:12px;
  background:linear-gradient(135deg,var(--primary),var(--primary2));
}

.nav{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

/* ================= BUTTONS ================= */
.btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:11px 14px;
  border-radius:16px;
  cursor:pointer;
  font-weight:700;
  min-height:44px;
}

.btn:hover{ background:rgba(255,255,255,.12); }

.btn-primary{
  background:linear-gradient(135deg,var(--primary),var(--primary2));
}

.btn-danger{
  background:rgba(239,68,68,.18);
  border-color:rgba(239,68,68,.4);
}

.btn-ghost{ background:transparent; }
.btn-block{ width:100%; }

.btn-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
}

/* ================= CARDS ================= */
.card{
  margin-top:12px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r2);
  box-shadow:var(--shadow);
}

.card-pad{ padding:16px; }

/* ================= TEXT ================= */
.title{
  font-size:clamp(20px,2.5vw,28px);
  font-weight:850;
  margin:0 0 8px;
}

.sub{ margin:0; color:var(--muted); }

.section{
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.8px;
  color:rgba(255,255,255,.55);
  margin-bottom:10px;
}

.center{
  /* ALT: 560px => zu eng auf Desktop.
     NEU: contentw deutlich breiter, bleibt aber zentriert */
  width:min(var(--contentw), 100%);
  margin:0 auto;
  text-align:center;
}

/* ================= CHIPS ================= */
.chips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
}

.chip{
  padding:9px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--border);
  font-size:13px;
  font-weight:700;
}

.chip-ok{ background:rgba(34,197,94,.18); }
.chip-warn{ background:rgba(245,158,11,.18); }
.chip-danger{ background:rgba(239,68,68,.18); }

/* ================= FORMS ================= */
.form{ display:grid; gap:12px; }

/* Label soll wie ein Block wirken und Luft zum Feld haben */
label{
  font-weight:800;
  display:block;
  line-height:1.25;
}

/* Wenn Inputs direkt im Label stehen: Abstand nach dem Label-Text */
label > input,
label > textarea,
label > select{
  margin-top:8px;        /* Abstand zwischen Labeltext und Feld */
}

/* Felder */
input,textarea,select{
  width:100%;
  padding:13px 14px;
  border-radius:16px;
  border:1px solid var(--border);
  background:#000;
  color:var(--text);
  font-size:15px;
}

/* Textarea */
textarea{ min-height:110px; resize:vertical; }

/* Optional: Platzhalter etwas dezenter */
::placeholder{ color: rgba(255,255,255,.45); }

/* Rows */
.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media(max-width:560px){
  .row{ grid-template-columns:1fr; }
}

/* ================= EVENT DESCRIPTION =================
   FIX: Bilder responsiv, dürfen Box nicht sprengen
*/
.event-desc{
  margin-top:12px;
  padding:14px;
  background:var(--surface);
  border-radius:18px;
  border:1px solid var(--border);
  text-align:left;

  /* wichtig bei langen URLs/HTML */
  overflow-wrap:anywhere;
  word-break:break-word;
}

.event-desc img{
  display:block;
  max-width:100%;
  height:auto;
  border-radius:14px;
}

.event-desc iframe,
.event-desc video{
  max-width:100%;
}

.event-desc a{
  text-decoration: underline;
}

/* Sicherheit: falls HTML inline width/height setzt */
.event-desc img[width],
.event-desc img[height]{
  width:100% !important;
  height:auto !important;
}

/* ================= TABLE ================= */
.table-wrap{
  overflow:auto;
  border-radius:var(--r2);
  border:1px solid var(--border);
}

/* Tabellen auf Desktop brauchen mehr Mindestbreite */
table{
  width:100%;
  min-width:1100px; /* ALT 760px: zu klein für viele Spalten */
  border-collapse:collapse;
}

th,td{
  padding:12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

th{
  text-transform:uppercase;
  font-size:12px;
  color:var(--muted);
}

/* Letzte Spalte (Aktionen/Buttons) nicht umbrechen */
th:last-child, td:last-child{
  white-space:nowrap;
}

/* ================= BOTTOM BAR ================= */
.bottombar{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  background:var(--surface);
  border-top:1px solid var(--border);
  padding:12px;
}

.bottombar-inner{
  width:min(var(--appw),calc(100% - 36px));
  margin:0 auto;
  display:flex;
  gap:10px;
}

.has-bottombar{ padding-bottom:120px; }

/* ================= TABS =================
   Hinweis: Wenn Tabs sticky bleiben sollen, ok.
   Wenn Tabs auch mitscrollen sollen: position:relative setzen.
*/
.tabs{
  position: sticky;
  top: 0;               /* da Appbar nicht sticky ist, kann top=0 */
  z-index:55;
  margin-top:12px;
}

.tabs-inner{
  display:flex;
  gap:10px;
  justify-content:center;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:999px;
  padding:10px;
}

.tabbtn{
  padding:10px 14px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  font-weight:800;
  cursor:pointer;
  color:#FFFFFF;
}

.tabbtn.active{
  background:linear-gradient(135deg,var(--primary),var(--primary2));
}

.tabpanel{ display:none; }
.tabpanel.active{ display:block; }

/* ================= PARTICIPANTS ================= */
.mobile-only{ display:none; }
.desktop-only{ display:block; }

@media(max-width:720px){
  :root{
    /* Mobile: wieder schmaler, app-like */
    --appw:680px;
    --contentw:560px;
  }

  .desktop-only{ display:none; }
  .mobile-only{ display:block; }

  table{
    /* Auf Mobile keine riesige Mindestbreite erzwingen */
    min-width:760px;
  }
}

.list{
  display:grid;
  gap:10px;
  margin-top:12px;
}

.item{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:18px;
  padding:12px;
}

.item-top{
  display:flex;
  justify-content:space-between;
  font-weight:800;
  gap:10px;
}

.kv{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}

@media(max-width:420px){
  .kv{ grid-template-columns:1fr; }
}

.k{
  background:#000;
  padding:10px;
  border-radius:14px;
  border:1px solid var(--border);
}

.note-box{
  margin-top:10px;
  padding:10px;
  background:#000;
  border-radius:14px;
  border:1px solid var(--border);
}
/* Appbar bleibt full width */
.appbar{
  width:100%;
}

/* Begrenzter Innenbereich – DAS ist der Fix */
.appbar-inner{
  max-width:1200px;       /* exakt wie vorher */
  margin:0 auto;
  padding:12px 16px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

/* Logo */
.brand-logo{
  flex:0 0 auto;
}

.brand-logo img{
  height:clamp(32px, 4vw, 46px);
  width:auto;
  max-width:100%;
  display:block;
}

/* Navigation */
.nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.nav-switch {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 16px;
}

.btn-small {
    padding: 4px 10px;
    font-size: 13px;
    line-height: 1.2;
    border-radius: 6px;
}

/* Switch-Container: wirklich mittig */
.nav-switch {
  width: 100%;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}

/* Kleine Buttons nur für diesen Switcher */
.nav-switch a.btn.btn-small {
  display: inline-flex !important;     /* wichtig: vertikale Zentrierung */
  align-items: center !important;
  justify-content: center !important;

  padding: 4px 10px !important;       /* reduziert Höhe */
  min-height: 0 !important;
  height: auto !important;

  line-height: 1.2 !important;        /* verhindert "Text oben" */
  font-size: 13px !important;

  vertical-align: middle !important;
}

/* Badge ggf. optisch leicht kompakter */
.nav-switch a.btn.btn-small .badge {
  margin-left: 6px;
  line-height: 1 !important;
}
