/* ─────────────────────────────────────────
   Typisch Westerwald – Quiz Design v1.6.2
───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Merriweather:wght@700;900&display=swap');

:root {
  --bg:           #1a1f2e;
  --bg-card:      #242938;
  --bg-card2:     #2d3347;
  --green:        #2e7d32;
  --green-bright: #4caf50;
  --green-dark:   #1b5e20;
  --green-dim:    #1e7c1e;
  --white:        #ffffff;
  --gray:         #b0b8cc;
  --red:          #e05555;
  --border:       #3a4060;
  --radius:       12px;
  --radius-sm:    6px;
}

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

body {
  background-color: var(--bg);
  color: var(--white);
  font-family: 'Lato', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navigation ── */
.navbar {
  background: #0f1219;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-wrap: wrap;
}

.navbar-logo-link { display: flex; align-items: center; }
.navbar-logo      { height: 46px; width: auto; }
.navbar-spacer    { flex: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav-links a {
  color: var(--gray);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.07);
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}

.nav-social a {
  color: var(--gray);
  font-size: 1rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
  padding: 0 !important;
}

.nav-social a:hover {
  color: var(--white) !important;
  background: rgba(255,255,255,0.1) !important;
}

/* Hamburger (Mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ── Hero Banner ── */
.hero-banner {
  position: relative;
  width: 100%;
  height: clamp(260px, 42vw, 480px);
  overflow: hidden;
}

.hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.25) 50%,
    rgba(26,31,46,0.92) 100%
  );
}

.hero-banner-text {
  position: absolute;
  bottom: 2.5rem;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 1rem;
}

.hero-headline {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 900;
  color: var(--white);
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.hero-subline {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  font-weight: 700;
}

/* ── Hero Content (unterhalb Banner) ── */
.hero-content {
  text-align: center;
  padding: 2rem 1rem 3rem;
  max-width: 600px;
  margin: 0 auto;
}

.hero-logo-main {
  max-width: 280px;
  width: 70%;
  margin-bottom: 2rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.btn-hint {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--gray);
}

/* ── Hauptinhalt ── */
main {
  flex: 1;
  padding: 1rem 1rem 2rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* ── Karten ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

/* ── Überschriften ── */
h1 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 2rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}
h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.4rem;
  color: var(--white);
  margin-bottom: 1rem;
}
h3 { font-size: 1.1rem; color: var(--green-bright); margin-bottom: 0.75rem; }

p { line-height: 1.7; color: var(--gray); }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: 'Lato', sans-serif;
}

.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(46,125,50,0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--green-bright);
  border: 2px solid var(--green-bright);
}
.btn-secondary:hover { background: var(--green-dim); color: var(--white); }

.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #c04040; }

.btn-sm     { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-block  { display: block; width: 100%; text-align: center; }

.start-btn { font-size: 1.15rem; padding: 0.9rem 2.5rem; }

/* ── Intro-Seite ── */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.hero .tagline { font-size: 1.05rem; color: var(--gray); margin-bottom: 2rem; }

/* ── Fortschrittsbalken ── */
.progress-bar-wrap {
  background: var(--bg-card2);
  border-radius: 999px;
  height: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
  text-align: right;
}

/* ── Fragebild ── */
.question-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  font-family: 'Merriweather', Georgia, serif;
}

/* ── Antworten ── */
.answers-grid { display: flex; flex-direction: column; gap: 0.75rem; }

.answer-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 1rem;
}

.answer-label:hover {
  border-color: var(--green);
  background: rgba(46,125,50,0.12);
}

.answer-label input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.answer-label input[type="radio"]:checked {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(46,125,50,0.25);
}

.answer-label:has(input:checked) {
  border-color: var(--green);
  background: rgba(46,125,50,0.12);
}

/* ── Ergebnis ── */
.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 5px solid var(--green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  background: rgba(46,125,50,0.1);
}

.score-number { font-size: 2.8rem; font-weight: 700; color: var(--green-bright); line-height: 1; }
.score-label  { font-size: 0.8rem; color: var(--gray); }

.result-item {
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--border);
}
.result-item.correct { border-left-color: var(--green); }
.result-item.wrong   { border-left-color: var(--red); }
.result-q     { font-weight: 700; margin-bottom: 0.4rem; color: var(--white); }
.result-answer { font-size: 0.9rem; color: var(--gray); }

/* ── v1.7.0 Result Cards ── */
.result-card {
  border-left: 4px solid var(--border);
}
.result-card.correct { border-left-color: var(--green); }
.result-card.wrong   { border-left-color: var(--red); }

.result-card-top {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.result-card-image {
  flex-shrink: 0;
  width: 220px;
}
.result-img {
  width: 100%;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.2s;
  border: 1px solid var(--border);
}
.result-img:hover {
  opacity: 0.85;
}

.result-card-content {
  flex: 1;
  min-width: 0;
}

/* Zusatzinfos */
.result-extra {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Accordion */
.result-accordion {
  margin-bottom: 0.75rem;
}
.result-accordion summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--green-bright);
  font-size: 0.9rem;
  padding: 0.4rem 0;
  list-style: none;
}
.result-accordion summary::-webkit-details-marker { display: none; }
.result-accordion summary::before {
  content: '▸ ';
  display: inline;
}
.result-accordion[open] summary::before {
  content: '▾ ';
}
.result-accordion-body {
  padding: 0.5rem 0 0.25rem;
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.6;
}

/* Externe Links */
.result-ext-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.result-ext-link {
  color: var(--green-bright);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.result-ext-link:hover {
  color: var(--white);
}
.result-ext-link i {
  font-size: 0.75rem;
  margin-right: 0.3rem;
}

/* Social-Media */
.result-social {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.result-social-label {
  font-size: 0.85rem;
  color: var(--gray);
}
.result-social-icons {
  display: flex;
  gap: 0.75rem;
}
.result-social-icons a {
  color: var(--gray);
  font-size: 1.3rem;
  transition: color 0.2s;
}
.result-social-icons a:hover {
  color: var(--white);
}
.result-social-icons a[title="Facebook"]:hover  { color: #1877F2; }
.result-social-icons a[title="Instagram"]:hover { color: #E4405F; }
.result-social-icons a[title="YouTube"]:hover   { color: #FF0000; }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.lightbox.active {
  display: flex;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Responsive: Bild über Frage auf kleinen Screens */
@media (max-width: 768px) {
  .result-card-top {
    flex-direction: column;
  }
  .result-card-image {
    width: 100%;
  }
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-left: 0.5rem;
}
.badge-correct { background: var(--green-dim); color: #d0ffd0; }
.badge-wrong   { background: #7a2020; color: #ffd0d0; }

/* ── Prize-Box ── */
.prize-box {
  background: linear-gradient(135deg, rgba(46,125,50,0.15), rgba(27,94,32,0.08));
  border: 1px solid var(--green-dim);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.prize-box p { color: var(--white); margin-bottom: 1rem; }

/* ── Formulare ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.9rem; color: var(--gray); margin-bottom: 0.4rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 1rem;
  font-family: 'Lato', sans-serif;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--green); }
.form-group select option { background: var(--bg-card2); }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--gray);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

/* ── Flash ── */
.flash-messages { margin-bottom: 1rem; }
.flash {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(46,125,50,0.15);
  border: 1px solid var(--green-dim);
  color: #c0ffc0;
  margin-bottom: 0.5rem;
}

/* ── Admin ── */
.admin-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-nav-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-nav a {
  color: var(--gray);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: all 0.15s;
}
.admin-nav a:hover, .admin-nav a.active {
  background: var(--green-dim);
  color: var(--white);
}
.admin-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.admin-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gray);
  border-radius: 2px;
}

.admin-main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 0.75rem;
  text-align: center;
  overflow: hidden;
}
.stat-number { font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 700; color: var(--green-bright); word-break: break-word; }
.stat-label  { font-size: 0.8rem; color: var(--gray); margin-top: 0.25rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg-card2);
  color: var(--gray);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--white);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,0.03); }

.status-badge { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.status-active   { background: var(--green-dim); color: #d0ffd0; }
.status-inactive { background: #3a3a3a; color: var(--gray); }

.toggle-btn { padding: 0.3rem 0.7rem; border-radius: var(--radius-sm); border: none; cursor: pointer; font-size: 0.8rem; font-weight: 700; text-decoration: none; display: inline-block; }
.toggle-activate   { background: var(--green-dim); color: #d0ffd0; }
.toggle-deactivate { background: #3a3a3a; color: var(--gray); }

/* ── Icon-Buttons ── */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s;
  text-decoration: none;
}

.icon-btn:hover {
  color: var(--white);
  border-color: var(--gray);
  background: rgba(255,255,255,0.07);
}

.icon-btn-danger:hover {
  color: var(--red);
  border-color: var(--red);
  background: rgba(224,85,85,0.1);
}

.icon-btn-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.login-wrap { max-width: 380px; margin: 6rem auto; padding: 1rem; }

/* ── Passwort-Toggle ── */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrapper input {
  flex: 1;
  padding-right: 2.75rem;
}
.password-toggle {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  padding: 0.4rem;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s;
}
.password-toggle:hover { color: var(--white); }

.stammdaten-form {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.answer-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.answer-row input[type="text"] {
  flex: 1;
  padding: 0.6rem 0.9rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.95rem;
  font-family: 'Lato', sans-serif;
}
.answer-row input[type="text"]:focus { outline: none; border-color: var(--green); }
.answer-row input[type="radio"] { width: 18px; height: 18px; accent-color: var(--green); flex-shrink: 0; }

.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filter-bar label { font-size: 0.8rem; color: var(--gray); display: block; margin-bottom: 0.25rem; }
.filter-bar input[type="date"] {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.9rem;
}

/* ── Modale Dialoge ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: modalIn 0.15s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.modal-message {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ── Bestenliste ── */
.bestenliste-highlight td {
  background: rgba(46,125,50,0.15) !important;
  border-left: 3px solid var(--green-bright);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}
.rank-gold   { background: #ffd700; color: #333; }
.rank-silver { background: #c0c0c0; color: #333; }
.rank-bronze { background: #cd7f32; color: #fff; }

/* ── Optionen-Card (Registrierung) ── */
.option-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: var(--border);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
footer a { color: var(--green-dim); text-decoration: none; }
footer a:hover { color: var(--green-bright); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0.75rem 0;
    gap: 0;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    width: 100%;
    padding: 0.6rem 0.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-social {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    padding-top: 0.5rem;
    width: 100%;
  }

  .hero-banner-text { bottom: 1.5rem; }
  .hero-headline    { font-size: 1.4rem; }

  .admin-nav {
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
  }
  .admin-nav-toggle { display: flex; }
  .admin-nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-top: 0.5rem;
  }
  .admin-nav-links.open { display: flex; }
  .admin-nav-links a {
    width: 100%;
    padding: 0.5rem 0.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
  }
}

@media (max-width: 600px) {
  main { padding: 1rem 0.75rem; }
  .card { padding: 1.25rem; }
  .score-circle { width: 110px; height: 110px; }
  .score-number { font-size: 2.2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 0.5rem 0.6rem; }
}
