/* OpenStagePlanner – Mobile-first CSS */

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

:root {
  --clr-primary:   #1a6b3a;
  --clr-primary-d: #134d2b;
  --clr-accent:    #e8a020;
  --clr-bg:        #f5f7f5;
  --clr-surface:   #ffffff;
  --clr-border:    #d0d8d0;
  --clr-text:      #1a2a1a;
  --clr-muted:     #5a6a5a;
  --clr-danger:    #c0392b;
  --clr-success:   #27ae60;
  --radius:        8px;
  --shadow:        0 2px 8px rgba(0,0,0,.1);
  --max-w:         900px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--clr-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 1rem; }

header.site-header {
  background: var(--clr-primary);
  color: #fff;
  padding: .9rem 0;
  box-shadow: var(--shadow);
}
header.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.site-logo { font-size: 1.25rem; font-weight: 700; color: #fff; }
.site-logo:hover { text-decoration: none; opacity: .9; }
nav.site-nav a { color: rgba(255,255,255,.9); margin-left: 1rem; font-size: .95rem; }
nav.site-nav a:hover { color: #fff; }

main { flex: 1; padding: 2rem 0; }

footer.site-footer {
  background: var(--clr-primary-d);
  color: rgba(255,255,255,.75);
  text-align: center;
  padding: 1rem;
  font-size: .85rem;
}
footer.site-footer a { color: rgba(255,255,255,.9); }

/* ── Card / Panel ───────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card-title { font-size: 1.2rem; font-weight: 700; margin-bottom: .75rem; color: var(--clr-primary); }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .95rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Formulare ──────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
label .req { color: var(--clr-danger); margin-left: 2px; }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=date], input[type=time], input[type=number],
select, textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--clr-text);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(26,107,58,.15);
}
textarea { resize: vertical; min-height: 90px; }

/* Channel-Block im Anmeldeformular */
.channel-block {
  background: #f0f4f0;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: .75rem;
}
.channel-block .channel-header {
  font-weight: 700;
  color: var(--clr-primary);
  margin-bottom: .5rem;
}
.channel-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
@media (max-width: 480px) { .channel-row { grid-template-columns: 1fr; } }

/* Anzahl-Auswahl */
.channel-count-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.channel-count-row label { margin-bottom: 0; }
.channel-count-row select { width: auto; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-align: center;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn-primary   { background: var(--clr-primary); color: #fff; }
.btn-primary:hover { background: var(--clr-primary-d); text-decoration: none; }
.btn-accent    { background: var(--clr-accent); color: #1a2a1a; }
.btn-accent:hover { opacity: .88; text-decoration: none; }
.btn-danger    { background: var(--clr-danger); color: #fff; }
.btn-danger:hover { opacity: .88; text-decoration: none; }
.btn-secondary { background: var(--clr-border); color: var(--clr-text); }
.btn-secondary:hover { background: #c0c8c0; text-decoration: none; }
.btn-sm { padding: .35rem .75rem; font-size: .875rem; }
.btn + .btn { margin-left: .5rem; }

/* ── Tabellen ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
thead { background: var(--clr-primary); color: #fff; }
th { padding: .6rem .75rem; text-align: left; font-weight: 600; }
td { padding: .6rem .75rem; border-bottom: 1px solid var(--clr-border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f0f4f0; }
.table-actions { white-space: nowrap; }

/* ── Event-Karte (Startseite) ────────────────────────────── */
.event-list { display: grid; gap: 1rem; }
@media (min-width: 600px) { .event-list { grid-template-columns: 1fr 1fr; } }

.event-card {
  background: var(--clr-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  border-left: 4px solid var(--clr-primary);
  transition: box-shadow .15s;
}
.event-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.14); }
.event-card-date { font-size: .85rem; color: var(--clr-muted); }
.event-card-title { font-size: 1.1rem; font-weight: 700; }
.event-card-series { font-size: .85rem; color: var(--clr-muted); }
.event-card-location { font-size: .9rem; }
.event-card-badge {
  display: inline-block;
  font-size: .75rem;
  padding: .15rem .5rem;
  border-radius: 99px;
  font-weight: 600;
}
.badge-open   { background: #d4edda; color: #155724; }
.badge-closed { background: #f8d7da; color: #721c24; }

/* ── Admin-Layout ────────────────────────────────────────── */
.admin-wrapper { display: flex; min-height: calc(100vh - 120px); }

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--clr-primary-d);
  color: #fff;
  padding: 1.5rem 0;
}
.admin-sidebar .sidebar-section {
  padding: 0 1rem .5rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.5);
  margin-top: .75rem;
}
.admin-sidebar a {
  display: block;
  padding: .5rem 1.25rem;
  color: rgba(255,255,255,.85);
  font-size: .95rem;
  transition: background .1s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
}

.admin-content { flex: 1; padding: 1.5rem; min-width: 0; }
.admin-content h1 { font-size: 1.5rem; margin-bottom: 1.25rem; color: var(--clr-primary); }

/* Mobile: Sidebar wird zum Top-Bar */
@media (max-width: 700px) {
  .admin-wrapper { flex-direction: column; }
  .admin-sidebar { width: 100%; padding: .5rem 0; display: flex; flex-wrap: wrap; }
  .admin-sidebar .sidebar-section { display: none; }
  .admin-sidebar a { padding: .45rem .75rem; font-size: .85rem; }
  .admin-content { padding: 1rem; }
}

/* ── Page-Inhalt (Impressum etc.) ────────────────────────── */
.page-content h2 { margin: 1.25rem 0 .5rem; }
.page-content p  { margin-bottom: .75rem; }
.page-content ul, .page-content ol { margin: .5rem 0 .75rem 1.5rem; }

/* ── Kanal-Übersicht (Admin) ─────────────────────────────── */
.reg-block {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.reg-block-header {
  background: var(--clr-primary);
  color: #fff;
  padding: .75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.reg-block-header .reg-name { font-weight: 700; }
.reg-block-header .reg-meta { font-size: .85rem; opacity: .85; }

/* ── Hilfklassen ─────────────────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted  { color: var(--clr-muted); font-size: .9rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.d-flex      { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.spacer      { flex: 1; }
