/* ============================================================
   MindGate – lokales Stylesheet (ersetzt das Tailwind-CDN)
   DSGVO: keine externen Requests, alles liegt im eigenen Ordner.
   Dark-Mode über die Klasse "dark" auf <html>.
   ============================================================ */

/* ---------- Farb- & Design-Token ---------- */
:root {
  --bg: #f1f5f9;
  --bg-blur: rgba(241, 245, 249, .82);
  --surface: #ffffff;
  --surface-2: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --border: #e2e8f0;
  --brand: #7C6CFF;
  --brand-dark: #6455e0;
  --green: #10b981;
  --red: #f43f5e;
  --amber-bg: #fffbeb;
  --amber-border: rgba(252, 211, 77, .5);
  --amber-text: #92400e;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .05);
  --radius: 16px;
  --radius-lg: 24px;
}
html.dark {
  --bg: #020617;
  --bg-blur: rgba(2, 6, 23, .82);
  --surface: #0f172a;
  --surface-2: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #475569;
  --border: #1e293b;
  --amber-bg: rgba(245, 158, 11, .08);
  --amber-border: rgba(245, 158, 11, .3);
  --amber-text: #fcd34d;
  --shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

/* ---------- Basis ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  /* Sichere System-Schriften statt Google Fonts (DSGVO / LG München I) */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  transition: background .25s, color .25s;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img, svg { display: block; }
code {
  background: var(--surface-2);
  padding: 0 5px;
  border-radius: 5px;
  font-size: .9em;
}

/* Mobile-First: zentrierte Spalte, auf Desktop mittig */
.container {
  max-width: 42rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg-blur);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.topbar-row { display: flex; align-items: center; gap: 12px; }
.logo-m {
  width: 36px; height: 36px; border-radius: 12px;
  background: #000; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 16px; }
.grow { flex: 1; }
.nav-link {
  display: none; padding: 6px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: color .15s;
}
.nav-link:hover { color: var(--brand); }
@media (min-width: 640px) { .nav-link { display: inline-block; } }

.icon-btn {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--surface); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: transform .15s;
}
.icon-btn:hover { transform: scale(1.06); }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 24px;
  border-radius: 18px; font-weight: 600; font-size: 15px;
  transition: transform .1s, background .15s, color .15s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 10px 24px rgba(124, 108, 255, .35);
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-mini {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 12px;
  background: var(--surface-2); color: var(--text);
  font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s;
}
.btn-mini:hover { background: var(--brand); color: #fff; }
@media (min-width: 640px) { .btn { width: auto; } }

/* ---------- Karten & Abschnitte ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.section-pad { padding: 20px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; } .mt-6 { margin-top: 36px; }
.mb-2 { margin-bottom: 12px; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

/* ---------- Hero (Landingpage) ---------- */
.hero {
  position: relative; text-align: center;
  padding: 64px 20px 56px;
  background: radial-gradient(60% 50% at 50% 0%, rgba(124, 108, 255, .28), transparent 70%);
}
.hero-logo {
  width: 80px; height: 80px; border-radius: 24px;
  background: #000; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 38px;
  margin: 0 auto 24px;
  box-shadow: 0 18px 40px rgba(124, 108, 255, .35);
}
.hero h1 { font-size: 36px; }
@media (min-width: 640px) { .hero h1 { font-size: 44px; } }
.badge-pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(124, 108, 255, .35);
  background: rgba(124, 108, 255, .12);
  color: var(--brand); font-size: 12px; font-weight: 600;
}
.grad-text {
  background: linear-gradient(90deg, var(--brand), #818cf8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.cta-row {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-top: 32px;
}
@media (min-width: 640px) { .cta-row { flex-direction: row; justify-content: center; } }
.trust-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 24px; margin-top: 32px;
  font-size: 12px; color: var(--text-muted);
}
.trust-row span { display: flex; align-items: center; gap: 6px; }
.check { color: var(--green); }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 32px; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
.feature-card { transition: transform .15s, box-shadow .15s; }
.feature-card:hover { transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.fi-brand { background: rgba(124, 108, 255, .12); color: var(--brand); }
.fi-green { background: rgba(16, 185, 129, .12); color: var(--green); }
.fi-sky   { background: rgba(14, 165, 233, .12); color: #0ea5e9; }
.fi-amber { background: rgba(245, 158, 11, .12); color: #d97706; }

/* ---------- Download-Box ---------- */
.download-box {
  border-radius: var(--radius-lg); padding: 32px; text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), #6366f1);
  box-shadow: 0 18px 40px rgba(124, 108, 255, .3);
}
.store-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 18px;
  background: #fff; color: #0f172a; font-weight: 600;
  transition: transform .15s;
}
.store-btn:hover { transform: scale(1.05); }

/* ---------- Formulare ---------- */
.input, .select, .file {
  width: 100%; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124, 108, 255, .25);
}
.label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.error-text { color: var(--red); font-size: 14px; margin-bottom: 10px; }

/* Suchfeld mit Icon */
.search-wrap { position: relative; margin-top: 12px; }
.search-wrap svg {
  position: absolute; inset-inline-start: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-faint); pointer-events: none;
}
.search-wrap .input { padding-inline-start: 36px; border-radius: 16px; background: var(--surface); }

/* ---------- Filter-Pills (horizontal scrollbar) ---------- */
.pill-bar {
  display: flex; gap: 8px; overflow-x: auto;
  margin: 12px -16px 0; padding: 0 16px 4px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.pill-bar::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0; padding: 6px 16px; border-radius: 999px;
  background: var(--surface); color: var(--text-muted);
  font-size: 14px; font-weight: 500; transition: background .15s, color .15s;
}
.pill.active { background: var(--brand); color: #fff; box-shadow: var(--shadow); }

.list-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.sort-select {
  padding: 4px 8px; border-radius: 8px; font-size: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

/* ---------- Hub: Pack-Karten & Voting ---------- */
.pack-card { display: flex; gap: 12px; align-items: flex-start; animation: fadeUp .25s ease-out both; }
.vote-col { display: flex; flex-direction: column; align-items: center; }
.vote-btn { padding: 4px; border-radius: 10px; color: var(--text-faint); transition: color .15s, transform .15s; }
.vote-btn.up:hover:not([disabled]) { color: var(--green); transform: scale(1.12); }
.vote-btn.down:hover:not([disabled]) { color: var(--red); transform: scale(1.12); }
.vote-btn[disabled] { color: var(--surface-2); cursor: default; }
.vote-score { font-weight: 700; font-size: 14px; min-width: 2ch; text-align: center; }
.pack-body { flex: 1; min-width: 0; }
.pack-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-badge { display: inline-block; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.cat-med   { background: rgba(244, 63, 94, .12); color: #e11d48; }
.cat-tech  { background: rgba(14, 165, 233, .12); color: #0284c7; }
.cat-lang  { background: rgba(16, 185, 129, .12); color: #059669; }
.cat-misc  { background: var(--surface-2); color: var(--text-muted); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .5);
  display: none; align-items: flex-end; justify-content: center;
}
.modal-backdrop.open { display: flex; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 16px; } }
.modal {
  width: 100%; max-width: 28rem;
  background: var(--surface); padding: 20px;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .3);
}
@media (min-width: 640px) { .modal { border-radius: 24px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ---------- Floating Action Button ---------- */
.fab {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 600;
  box-shadow: 0 12px 28px rgba(124, 108, 255, .45);
  transition: background .15s, transform .1s;
}
.fab:hover { background: var(--brand-dark); }
.fab:active { transform: translateX(-50%) scale(.95); }

/* ---------- Footer (1-Klick-Erreichbarkeit) ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 20px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 18px; font-size: 14px; }
.footer-links a { color: var(--text-muted); transition: color .15s; }
.footer-links a:hover { color: var(--brand); }

/* ---------- Hinweisbox & Recht-Seiten ---------- */
.notice {
  border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--amber-border);
  background: var(--amber-bg); color: var(--amber-text);
  font-size: 14px;
}
.notice ul { padding-inline-start: 20px; margin-top: 8px; }
.notice li { margin-top: 4px; }
.legal p, .legal address, .legal dl { color: var(--text); }
.legal .card + .card { margin-top: 14px; }
.legal a.link { color: var(--brand); }
.legal a.link:hover { text-decoration: underline; }
dl.kv div { display: flex; gap: 8px; margin-top: 6px; }
dl.kv dt { width: 92px; flex-shrink: 0; color: var(--text-muted); font-weight: 500; }

/* ---------- Leerer Zustand & Animation ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 80px 0; text-align: center; }
.empty svg { width: 56px; height: 56px; color: var(--text-faint); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .6s ease-out both; }
.fade-up-2 { animation: fadeUp .6s ease-out .1s both; }
.fade-up-3 { animation: fadeUp .6s ease-out .2s both; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
