/* ============================================================
   AI-Gästebuch · Online-Version · Custom CSS
   (Basis = lokale style.css, ergänzt um mobile-first-Regeln)
   Tailwind übernimmt das meiste, hier: Komponenten & Animationen
   ============================================================ */

/* ── Root ──────────────────────────────────────────────────── */
:root {
  --gold:        #c9a96e;
  --gold-light:  #e8d5b0;
  --gold-dark:   #8b6914;
  --cream:       #fff8f0;
  --surface:     #2c1810;
  --surface-lt:  #3d2218;
  --surface-dk:  #1a0a05;
}

* { box-sizing: border-box; }

html, body {
  /* mobile: niemals horizontal scrollen */
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: radial-gradient(ellipse at top, #2c1810 0%, #1a0a05 70%);
  min-height: 100vh;
  min-height: 100dvh; /* mobile: echte Viewport-Höhe */
}

/* ── Typografie ────────────────────────────────────────────── */
h1, h2, h3, .font-serif { font-family: 'Playfair Display', Georgia, serif; }
body, p, button, input, textarea { font-family: 'Lato', sans-serif; }

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: rgba(44, 24, 16, 0.7);
  border: 1px solid rgba(201, 169, 110, 0.25);
  border-radius: 1rem;
  padding: 2rem;
  backdrop-filter: blur(8px);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #c9a96e 0%, #8b6914 100%);
  color: #1a0a05;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.85rem 2rem;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 24px rgba(201, 169, 110, 0.3);
  border: none;
  font-family: 'Lato', sans-serif;
  letter-spacing: 0.02em;
  /* mobile: Touch-Ziel & kein iOS-Doppeltipp-Zoom */
  min-height: 44px;
  touch-action: manipulation;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(201, 169, 110, 0.45);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  color: var(--gold);
  border: 1px solid rgba(201, 169, 110, 0.35);
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  display: inline-block;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  font-family: 'Lato', sans-serif;
  min-height: 44px;
  touch-action: manipulation;
}
.btn-ghost:hover {
  border-color: var(--gold);
  background: rgba(201, 169, 110, 0.08);
}

.btn-skip {
  color: rgba(255, 248, 240, 0.35);
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  transition: color 0.2s;
}
.btn-skip:hover {
  color: rgba(255, 248, 240, 0.65);
}

/* ── Input ─────────────────────────────────────────────────── */
.input-field {
  background: rgba(255, 248, 240, 0.06);
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 0.75rem;
  color: var(--cream);
  padding: 0.85rem 1.2rem;
  font-family: 'Lato', sans-serif;
  font-size: 1rem; /* 16px → verhindert iOS-Autozoom */
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}
.input-field::placeholder { color: rgba(255, 248, 240, 0.3); }
.input-field:focus {
  border-color: var(--gold);
  background: rgba(255, 248, 240, 0.1);
}

/* ── Choice-Button ─────────────────────────────────────────── */
.choice-btn {
  background: rgba(255, 248, 240, 0.04);
  transition: all 0.2s;
  min-height: 44px;
  touch-action: manipulation;
}
.choice-btn:hover {
  background: rgba(201, 169, 110, 0.1);
  border-color: var(--gold) !important;
  transform: translateX(4px);
}
.choice-btn.selected {
  background: rgba(201, 169, 110, 0.2);
  border-color: var(--gold) !important;
  color: var(--gold-light);
}

/* ── Status-Badge ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-family: 'Lato', sans-serif;
}
.status-ok   { background: rgba(74, 222, 128, 0.12); color: #86efac; border: 1px solid rgba(74,222,128,0.3); }
.status-warn { background: rgba(251, 191, 36, 0.12); color: #fde68a; border: 1px solid rgba(251,191,36,0.3); }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,0.5), transparent);
}

/* ── Photo Frame ───────────────────────────────────────────── */
.photo-frame {
  position: relative;
  display: inline-block;
  width: 100%;
}
.photo-frame::before,
.photo-frame::after {
  content: '';
  position: absolute;
  border: 2px solid rgba(201, 169, 110, 0.4);
  border-radius: 1.2rem;
  pointer-events: none;
}
.photo-frame::before { inset: -8px; }
.photo-frame::after  { inset: -16px; opacity: 0.4; }

/* ── Animationen ───────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn { animation: fadeIn 0.5s ease-out forwards; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.animate-float { animation: float 3s ease-in-out infinite; display: inline-block; }

/* ── Hintergrund-Partikel ──────────────────────────────────── */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: var(--gold);
  animation: particle-rise linear infinite;
}
@keyframes particle-rise {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── KI-Danksagung: Chat-Bubbles ───────────────────────────── */
.ai-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(201, 169, 110, 0.15);
  border: 1px solid rgba(201, 169, 110, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.chat-bubble-ai {
  background: rgba(44, 24, 16, 0.85);
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 1rem;
  border-top-left-radius: 0.25rem;
  padding: 0.65rem 1rem;
  color: rgba(255, 248, 240, 0.8);
  max-width: 22rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-bubble-user {
  background: rgba(201, 169, 110, 0.15);
  border: 1px solid rgba(201, 169, 110, 0.35);
  border-radius: 1rem;
  border-top-right-radius: 0.25rem;
  padding: 0.65rem 1rem;
  color: var(--gold);
  max-width: 22rem;
  font-size: 0.9rem;
}

/* ── KI-Danksagung: Tag-Chips ──────────────────────────────── */
.chip {
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(201, 169, 110, 0.3);
  color: rgba(255, 248, 240, 0.65);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(255, 248, 240, 0.04);
  font-family: 'Lato', sans-serif;
  /* mobile: bequemes Touch-Ziel */
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  touch-action: manipulation;
}
.chip:hover {
  border-color: var(--gold);
  color: var(--cream);
  background: rgba(201, 169, 110, 0.08);
}
.chip.chip-active {
  background: rgba(201, 169, 110, 0.2);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Danksagung: Responsive Zwei-Spalten → gestapelt ───────── */
/* Mobile-first: einspaltig (Fragen oben, Ergebnis darunter).   */
.dank-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 768px) {
  .dank-grid {
    grid-template-columns: 1fr 1.15fr;
    gap: 1.75rem;
  }
}

/* Rechte Ausgabe-Spalte: mobil kompakter, Desktop großzügig */
.dank-output { min-height: 340px; }
@media (min-width: 768px) {
  .dank-output { min-height: 500px; }
}

/* ── Song-Player-Bar (unten fixiert, mobil klein) ──────────── */
#song-bar {
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface-dk); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ============================================================
   Mobile-first-Feinschliff (< 640px)
   ============================================================ */
@media (max-width: 640px) {
  /* Alle Formularfelder ≥16px gegen iOS-Auto-Zoom (überschreibt
     kleinere Inline-Schriftgrößen z. B. in der Danksagung).      */
  input, textarea, select { font-size: 16px !important; }

  /* Karten etwas kompakter, damit mehr Platz auf kleinen Screens */
  .card { padding: 1.25rem; border-radius: 0.9rem; }

  /* Chat-Bubbles dürfen volle Breite nutzen */
  .chat-bubble-ai, .chat-bubble-user { max-width: 100%; }

  /* Haupt-Padding schlanker */
  main { padding-left: 1.1rem !important; padding-right: 1.1rem !important; }
}
