/* ====================================================================== */
/* FoodYcation – Styles (mobile-first, Light/Dark)                        */
/* ====================================================================== */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/bricolage-grotesque.woff2') format('woff2');
}
:root {
  --font-display: 'Bricolage Grotesque', -apple-system, "Segoe UI", Roboto, sans-serif;
  --brand: #ff5a5f;
  --brand-2: #ff385c;
  --like: #22c55e;
  --nope: #ef4444;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --text: #1a1a1c;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(0,0,0,.12);
  --nav-h: 64px;
  --header-h: 54px;
}
:root[data-theme="dark"] {
  --bg: #0e0f13;
  --surface: #1a1c22;
  --surface-2: #23262e;
  --text: #f3f4f6;
  --muted: #9aa1ad;
  --border: #2c2f38;
  --shadow: 0 10px 34px rgba(0,0,0,.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;            /* Fallback */
  height: 100dvh;           /* dynamische Viewport-Höhe – iOS-Toolbar-sicher */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* --- Header ----------------------------------------------------------- */
.app-header {
  flex: 0 0 auto;
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 0 10px 0 12px; padding-top: env(safe-area-inset-top);
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: relative; z-index: 200;
}
.brand { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -.3px; display: flex; align-items: center; gap: 6px; flex-shrink: 1; min-width: 0; }
.brand-logo { height: 30px; width: auto; display: block; }
.header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.icon-btn { font-size: 17px; width: 32px; height: 32px; border-radius: 50%; }
.icon-btn:active { background: var(--surface-2); }
.lang-select { position: relative; }
#lang-btn { font-size: 18px; }
.lang-menu { position: absolute; top: 42px; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 40; min-width: 150px; }
.lang-menu button { display: block; width: 100%; text-align: left; padding: 12px 14px; font-size: 14px; }
.lang-menu button:active { background: var(--surface-2); }
.lang-menu button.active { background: var(--surface-2); color: var(--brand-2); font-weight: 700; }
.mode-badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; background: var(--surface-2); color: var(--muted); cursor: pointer; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.mode-badge:active { opacity: .7; }
.mode-badge.google { background: #e6f4ea; color: #137333; }
.mode-badge.demo { background: #fff3d6; color: #a8710a; }

/* --- Layout ----------------------------------------------------------- */
.app-main { flex: 1 1 auto; position: relative; overflow: hidden; min-height: 0; }
.view { display: none; height: 100%; }
.view.active { display: flex; flex-direction: column; }
.view-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.view-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.count-pill { font-size: 13px; background: var(--brand); color: #fff; border-radius: 20px; padding: 1px 9px; vertical-align: middle; }

/* --- Card-Stack (Entdecken) ------------------------------------------- */
.card-stack { position: relative; flex: 1; margin: 10px 14px 4px; }
.stack-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 20px; }

.rcard {
  position: absolute; inset: 0;
  background: var(--surface); border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow); will-change: transform;
  display: flex; flex-direction: column;
  user-select: none; touch-action: none; cursor: grab;
}
.rcard.dragging { cursor: grabbing; }
.rcard .photo {
  position: relative; flex: 1; min-height: 55%;
  background-size: cover; background-position: center;
  display: flex; align-items: flex-end;
}
.rcard .photo-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 84px; }
.photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.fav-item .thumb .photo-img, .detail-card .d-photo .photo-img { position: absolute; inset: 0; }
.d-photo .photo-img { z-index: 0; }
.rcard .grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.15) 45%, rgba(0,0,0,0) 70%); }
.photo-dots { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; gap: 4px; z-index: 3; }
.photo-dots span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.4); }
.photo-dots span.on { background: #fff; }

.rcard .card-title { position: relative; z-index: 3; color: #fff; padding: 16px 16px 14px; width: 100%; }
.rcard .card-title h3 { margin: 0 0 4px; font-size: 24px; font-weight: 800; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.rcard .subline { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 13px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.rcard .subline .open { color: #7CFCB4; } .rcard .subline .closed { color: #ffb4b4; }

.rcard .body { padding: 12px 16px 14px; background: var(--surface); }
.rcard .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); border-radius: 20px; padding: 4px 10px; }
.tag.cuisine { background: rgba(255,90,95,.12); color: var(--brand-2); }
.rcard .summary { font-size: 13px; color: var(--muted); line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .addr { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 5px; }

/* Swipe-Stempel */
.stamp {
  position: absolute; top: 30px; z-index: 5; font-size: 30px; font-weight: 900;
  padding: 6px 16px; border-radius: 12px; border: 4px solid; opacity: 0;
  text-transform: uppercase; letter-spacing: 1px; pointer-events: none;
  transition: opacity .12s ease;
}
.stamp.like { left: 20px; color: var(--like); border-color: var(--like); transform: rotate(-18deg); }
.stamp.nope { right: 20px; color: var(--nope); border-color: var(--nope); transform: rotate(18deg); }

/* Swipe-Buttons */
.swipe-controls { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.round-btn {
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; transition: transform .12s;
  font-weight: 700;
}
.round-btn:active { transform: scale(.9); }
.round-btn.undo { width: 46px; height: 46px; font-size: 20px; color: #f0a500; }
.round-btn.nope { width: 62px; height: 62px; font-size: 30px; color: var(--nope); }
.round-btn.info { width: 46px; height: 46px; font-size: 18px; color: #3b82f6; }
.round-btn.like { width: 62px; height: 62px; font-size: 28px; color: var(--like); }
.round-btn:disabled { opacity: .35; }

/* --- Favoriten -------------------------------------------------------- */
.fav-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 20px; -webkit-overflow-scrolling: touch; }
.fav-item {
  display: flex; gap: 12px; background: var(--surface); border-radius: 16px; padding: 10px;
  margin-bottom: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.06); align-items: center;
}
.fav-item .thumb { position: relative; overflow: hidden; width: 74px; height: 74px; border-radius: 12px; background-size: cover; background-position: center; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.fav-item .fi-main { flex: 1; min-width: 0; }
.fav-item h4 { margin: 0 0 3px; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-item .fi-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.fav-item .fi-actions { display: flex; gap: 4px; }
.mini-btn { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); font-size: 15px; display: flex; align-items: center; justify-content: center; }
.mini-btn:active { background: var(--border); }
.mini-btn.del { color: var(--nope); }
.visited-badge { font-size: 10px; font-weight: 700; color: #137333; background: #e6f4ea; border-radius: 6px; padding: 1px 6px; }

.empty-state { flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 30px; }
.empty-state.show { display: flex; }
.empty-emoji { font-size: 60px; margin-bottom: 12px; }

/* --- Karte ------------------------------------------------------------ */
#map { flex: 1; width: 100%; height: 100%; background: var(--surface-2); z-index: 1; }
.map-fallback { display: flex; align-items: center; justify-content: center; height: 100%; padding: 30px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.map-pop { font-family: inherit; color: #1a1a1c; }
.map-pop b { font-size: 14px; }
.map-pop .mp-actions { margin-top: 6px; display: flex; gap: 8px; }
.map-pop a { color: var(--brand-2); font-weight: 700; text-decoration: none; font-size: 12px; }

/* --- Filter ----------------------------------------------------------- */
.filter-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; }
.f-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
.f-row b { color: var(--brand-2); }
.f-label { display: block; font-size: 14px; font-weight: 700; margin: 18px 0 8px; }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.select-full, .select-sm, .input-full { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 14px; width: 100%; }
.select-sm { width: auto; padding: 7px 10px; font-size: 13px; border-radius: 10px; }
.loc-search { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.loc-search .input-full { flex: 1; }
.loc-search .btn-sm { white-space: nowrap; }
.loc-active { font-size: 12px; color: var(--muted); margin: 4px 0 4px; min-height: 16px; }
.loc-active.on { color: var(--brand-2); font-weight: 600; }
.chip-row { display: flex; gap: 8px; }
.chip-wrap { flex-wrap: wrap; }
.chip-wrap .chip { flex: 0 0 auto; padding: 8px 13px; font-size: 13px; }
.or { display: flex; align-items: center; text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.or span { padding: 0 10px; }
.chip { flex: 1; padding: 10px 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; color: var(--muted); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.toggle-grid label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.toggle-grid input { width: 18px; height: 18px; accent-color: var(--brand); }
.sticky-apply { display: block; width: auto; margin: 8px 16px calc(14px + env(safe-area-inset-bottom)); }

/* --- Profil ----------------------------------------------------------- */
.profile-box { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 24px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.setting-row input { width: 20px; height: 20px; accent-color: var(--brand); }
.stat-row { display: flex; gap: 10px; margin: 18px 0; }
.stat { flex: 1; background: var(--surface); border-radius: 14px; padding: 14px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.stat b { display: block; font-size: 24px; font-weight: 800; color: var(--brand-2); }
.stat span { font-size: 12px; color: var(--muted); }

/* --- Buttons ---------------------------------------------------------- */
.btn { border-radius: 14px; padding: 13px 18px; font-size: 15px; font-weight: 700; transition: transform .1s, opacity .1s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #fee2e2; color: #b91c1c; }
:root[data-theme="dark"] .btn-danger { background: #3a1a1a; color: #ff8080; }
.btn-block { display: block; width: 100%; margin-top: 10px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }

/* --- Bottom-Nav ------------------------------------------------------- */
.bottom-nav {
  flex: 0 0 auto; position: relative;
  min-height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--surface); border-top: 1px solid var(--border); z-index: 20;
}
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; font-weight: 600; color: var(--muted); }
.nav-btn span:first-child { font-size: 20px; line-height: 1; }
.nav-btn.active { color: var(--brand); }

/* --- Overlays --------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px); }
.overlay.hidden { display: none; }
.consent-card { background: var(--surface); border-radius: 24px; padding: 28px 24px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.consent-emoji { font-size: 44px; margin-bottom: 8px; }
.consent-logo { display: block; width: auto; height: 112px; margin: 0 auto 2px; }
.consent-card h1 { font-family: var(--font-display); margin: 0 0 10px; font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.consent-card p { font-size: 14px; line-height: 1.5; margin: 0 0 14px; }

.detail-card { background: var(--surface); border-radius: 22px; max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow); }

/* Restaurant-Suche */
.search-card { background: var(--surface); border-radius: 22px; max-width: 460px; width: 100%; max-height: 82vh; display: flex; flex-direction: column; box-shadow: var(--shadow); align-self: flex-start; margin-top: calc(18px + env(safe-area-inset-top)); }
.search-head { display: flex; gap: 8px; align-items: center; padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.search-head .input-full { flex: 1; }
.search-results { flex: 1; min-height: 60px; overflow-y: auto; padding: 10px 14px 14px; -webkit-overflow-scrolling: touch; }
.search-results .fav-item { cursor: pointer; }
.detail-card .d-photo { height: 220px; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-size: 76px; position: relative; }
.detail-card .d-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 18px; }
.detail-card .d-body { padding: 18px; }
.detail-card h3 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.d-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.d-actions a, .d-actions button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 14px; text-decoration: none; }
.d-note { width: 100%; min-height: 60px; border: 1px solid var(--border); border-radius: 12px; padding: 10px; font-family: inherit; font-size: 14px; background: var(--bg); color: var(--text); resize: vertical; }

/* Rezensionen */
.d-reviews-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 8px; }
.d-reviews-head .f-label { margin: 0; }
.review { border-top: 1px solid var(--border); padding: 10px 0; }
.review:first-child { border-top: none; }
.review-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.review-author { font-weight: 700; font-size: 13px; }
.review-stars { color: #f0a500; font-size: 12px; font-weight: 700; }
.review-time { font-size: 11px; color: var(--muted); margin-left: auto; }
.review-text { font-size: 13px; color: var(--muted); line-height: 1.45; white-space: pre-wrap; }
.reviews-msg { font-size: 13px; color: var(--muted); padding: 6px 0; }
.reviews-more { display: block; text-align: center; margin-top: 10px; padding: 11px; border-radius: 12px; background: var(--surface-2); color: var(--brand-2); font-weight: 700; font-size: 14px; text-decoration: none; }
.reviews-note { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center; }
.d-feature-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }

.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.hidden { display: none !important; }

/* --- Toast ------------------------------------------------------------ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1f2937; color: #fff; padding: 11px 18px; border-radius: 24px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 1100; box-shadow: var(--shadow); max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 620px) {
  body { max-width: 480px; margin: 0 auto; box-shadow: 0 0 0 1px var(--border); }
}
