/* ============================================================
   Kleinanzeigen-Klon für Musikvideo "Was letzte Preis"
   Eigenständiges Design, angelehnt an typische Marktplatz-Optik
   ============================================================ */

:root {
  /* Eigenständige Farbwelt (Petrol/Türkis statt Limette) */
  --lime: #16b3a2;
  --lime-dark: #0f9689;
  --lime-soft: #d9f2ee;
  --green-ink: #063d38;
  --green-deep: #0b5e55;
  --price: #0a8f66;
  --paper: #ffffff;
  --bg: #f2f4f5;
  --ink: #1f2328;
  --ink-soft: #6b7075;
  --line: #e5e7ea;
  --badge-purple-bg: #e6edf8;
  --badge-purple-ink: #33568f;
  --top-purple: #e2641a;
  --danger: #c4322e;
  --radius: 8px;
  --pill-radius: 10px;
  --shadow: 0 1px 3px rgba(10, 30, 28, .08);
  font-size: 17px; /* etwas größer als üblich, damit es auf Kamera gut lesbar ist */
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.topbar { background: var(--paper); }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo svg { height: 40px; width: auto; }
.logo-word {
  font-size: 1.65rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--green-ink);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: var(--pill-radius); padding: 9px 20px;
  font-weight: 700; font-size: .95rem;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
}
.pill.lime { background: var(--lime); border-color: var(--lime); color: var(--green-ink); }
.pill.green { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.pill.ghost-green { border-color: var(--green-deep); color: var(--green-deep); background: var(--paper); }
.pill:hover { filter: brightness(.96); }

/* ---------- Suchband ---------- */
.searchband { background: var(--lime); padding: 22px 0; }
.searchband-inner { display: flex; align-items: center; gap: 22px; }
.searchbox {
  flex: 1; display: flex; align-items: stretch;
  background: var(--paper); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow);
}
.searchbox .seg {
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px; border-right: 1px solid var(--line);
  color: var(--ink-soft); font-size: .95rem; white-space: nowrap;
}
.searchbox .seg.grow { flex: 1; }
.searchbox input {
  border: 0; outline: 0; font: inherit; width: 100%;
  padding: 14px 0; color: var(--ink); background: transparent;
}
.searchbox .find-btn {
  border: 0; background: var(--green-deep); color: #fff;
  font-weight: 700; padding: 0 26px; border-radius: 9px; margin: 5px;
}
.band-icons { display: flex; gap: 26px; }
.band-icon {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--green-ink); font-size: .8rem; font-weight: 700;
}
.band-icon svg { width: 26px; height: 26px; }

/* ---------- Breadcrumb / Meta ---------- */
.crumb {
  padding: 18px 0 10px; color: var(--ink-soft); font-size: .92rem;
}
.crumb b { color: var(--ink); }

/* ---------- Layout Liste ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; gap: 22px; padding-bottom: 60px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { display: none; } }

.sidebar .box {
  background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px;
}
.sidebar h3 { font-size: 1rem; margin-bottom: 10px; }
.sidebar ul { list-style: none; }
.sidebar li { padding: 4px 0; color: var(--ink-soft); font-size: .92rem; }
.sidebar li b { color: var(--ink); font-weight: 600; }
.sidebar li .count { color: #9aa0a6; }
.sidebar a:hover { text-decoration: underline; }

/* ---------- Anzeigen-Karten ---------- */
.ad-list { display: flex; flex-direction: column; gap: 14px; }
.ad-card {
  display: flex; gap: 18px; background: var(--paper);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; position: relative; transition: box-shadow .15s ease;
}
.ad-card:hover { box-shadow: 0 3px 10px rgba(20,30,10,.14); }
.ad-thumb {
  width: 210px; height: 158px; flex: none; border-radius: 6px;
  overflow: hidden; background: #e9ebec; position: relative;
}
.ad-thumb svg, .ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-thumb .photo-count {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.65); color: #fff; font-size: .75rem;
  padding: 2px 8px; border-radius: 4px;
}
.ad-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ad-meta { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: .85rem; margin-bottom: 6px; }
.ad-meta .loc, .ad-meta .date { display: inline-flex; align-items: center; gap: 5px; }
.ad-meta svg { width: 15px; height: 15px; }
.ad-title { font-size: 1.18rem; font-weight: 700; line-height: 1.25; }
.ad-card:hover .ad-title { text-decoration: underline; }
.ad-desc {
  color: var(--ink-soft); font-size: .93rem; margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ad-bottom { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; padding-top: 10px; }
.ad-price { color: var(--price); font-weight: 800; font-size: 1.25rem; }
.ad-price .vb { font-weight: 600; font-size: .95rem; }
.ad-tags { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tag {
  background: #f1f2f4; border: 1px solid var(--line); color: var(--ink-soft);
  font-size: .78rem; padding: 3px 10px; border-radius: 5px;
}
.tag.direct { display: inline-flex; align-items: center; gap: 5px; }
.ad-card:has(.badge-top) .ad-meta { padding-right: 52px; }
.badge-top {
  position: absolute; top: 0; right: 0;
  background: var(--top-purple); color: #fff; font-size: .72rem; font-weight: 800;
  padding: 4px 10px; border-radius: 0 var(--radius) 0 var(--radius);
  letter-spacing: .05em;
}

/* Eigene Anzeige löschen */
.del-ad {
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-soft);
  border-radius: 999px; padding: 6px 12px; font-size: .95rem; line-height: 1;
}
.del-ad:hover { border-color: var(--danger); color: var(--danger); }

/* Likes */
.like-wrap {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 14px; background: var(--paper);
  font-weight: 700; color: var(--ink); user-select: none;
  position: relative;
}
.like-wrap .heart { width: 20px; height: 20px; color: var(--danger); }
.like-count { min-width: 3ch; text-align: left; font-variant-numeric: tabular-nums; }
.like-wrap.pulse .heart { animation: heartpop .35s ease; }
@keyframes heartpop {
  0% { transform: scale(1); } 40% { transform: scale(1.55); } 100% { transform: scale(1); }
}
.fly-heart {
  position: fixed; pointer-events: none; z-index: 999;
  font-size: 22px; animation: flyup 1.1s ease-out forwards;
}
@keyframes flyup {
  0%   { opacity: 1; transform: translate(0,0) scale(.7) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx, 20px), -140px) scale(1.4) rotate(var(--rot, 20deg)); }
}
.plus-one {
  position: fixed; pointer-events: none; z-index: 999;
  color: var(--price); font-weight: 800; font-size: 1rem;
  animation: plusfloat 1s ease-out forwards;
}
@keyframes plusfloat {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-60px); }
}

/* ---------- Detailseite ---------- */
.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 22px; padding-bottom: 60px; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }
.panel {
  background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px;
}
.gallery { position: relative; border-radius: var(--radius); overflow: hidden; background: #191b1c; }
.gallery .stage { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.gallery .stage svg, .gallery .stage img { width: 100%; height: 100%; object-fit: contain; }
.gallery .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 6px;
  background: rgba(20,20,20,.65); color: #fff; font-size: 1.3rem;
}
.gallery .nav.prev { left: 12px; }
.gallery .nav.next { right: 12px; }
.gallery .counter {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(0,0,0,.65); color: #fff; font-size: .8rem;
  padding: 3px 10px; border-radius: 4px;
}
.detail-title { font-size: 1.55rem; font-weight: 800; margin-bottom: 6px; }
.detail-price { color: var(--price); font-weight: 800; font-size: 1.5rem; }
.detail-price small { color: var(--ink-soft); font-weight: 500; font-size: .95rem; margin-left: 8px; }
.detail-meta { color: var(--ink-soft); font-size: .92rem; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.detail-meta span { display: inline-flex; align-items: center; gap: 7px; }
.detail-meta svg { width: 16px; height: 16px; }
.schutz-banner {
  background: var(--lime-soft); border-radius: 6px; padding: 14px 18px;
  margin-top: 16px; font-size: .95rem;
}
.schutz-banner b { color: var(--green-ink); }
.kv-table { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px 20px; }
.kv-table dt { font-weight: 700; }
.kv-table dd { color: var(--ink-soft); text-align: right; }
.panel h2 { font-size: 1.15rem; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.desc-text { white-space: pre-line; color: #33373c; }

/* Aktions-Buttons rechts */
.action-stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.action-stack .pill { justify-content: center; padding: 13px 20px; font-size: 1rem; }

/* Verkäuferkarte */
.seller-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.seller-head { display: flex; gap: 14px; align-items: flex-start; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: #6b7075; color: #fff; font-weight: 800; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
}
.avatar.green { background: var(--green-deep); }
.seller-name { font-weight: 800; color: var(--green-ink); font-size: 1.05rem; }
.seller-badges { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; align-items: flex-start; }
.sbadge {
  background: var(--badge-purple-bg); color: var(--badge-purple-ink);
  font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.seller-info { color: var(--ink-soft); font-size: .88rem; margin-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.seller-foot { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.id-row {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 20px; display: flex; justify-content: space-between;
  color: var(--ink-soft); font-size: .9rem; margin-bottom: 18px;
}

/* Bot-Kommentare */
.q-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.q-item:last-child { border-bottom: 0; }
.q-item .avatar { width: 40px; height: 40px; font-size: 1rem; }
.q-name { font-weight: 700; font-size: .9rem; }
.q-name .q-time { color: #9aa0a6; font-weight: 400; margin-left: 8px; font-size: .8rem; }
.q-text { font-size: .95rem; margin-top: 2px; }

/* ---------- Chat ---------- */
.chat-shell {
  display: grid; grid-template-columns: 340px 1fr;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin: 18px auto 40px;
  height: calc(100vh - 210px); min-height: 480px;
}
.convo-list { border-right: 1px solid var(--line); overflow-y: auto; }
.convo-list h2 { padding: 16px 18px; font-size: 1.1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); }
.convo {
  display: flex; gap: 12px; padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid #f0f1f3; align-items: center;
}
.convo:hover, .convo.active { background: #f4f7ea; }
.convo .avatar { width: 44px; height: 44px; font-size: 1rem; }
.convo-body { flex: 1; min-width: 0; }
.convo-name { font-weight: 700; font-size: .92rem; display: flex; justify-content: space-between; }
.convo-name time { color: #9aa0a6; font-weight: 400; font-size: .78rem; }
.convo-prev { color: var(--ink-soft); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread {
  background: var(--lime); color: var(--green-ink); font-size: .75rem; font-weight: 800;
  border-radius: 999px; min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head {
  display: flex; gap: 12px; align-items: center; padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.thread-head .avatar { width: 40px; height: 40px; font-size: .95rem; }
.thread-head .t-item { color: var(--ink-soft); font-size: .85rem; }
.thread-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: #fafbfc; }
.msg { max-width: 70%; padding: 10px 15px; border-radius: 14px; font-size: .97rem; position: relative; animation: msgin .25s ease; }
@keyframes msgin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.in  { background: #eef0f2; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.out { background: var(--lime-soft); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg time { display: block; font-size: .72rem; color: #9aa0a6; margin-top: 4px; text-align: right; }
.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing i {
  width: 8px; height: 8px; border-radius: 50%; background: #9aa0a6;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.thread-input { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.thread-input input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 11px 18px; font: inherit; outline: none;
}
.thread-input input:focus { border-color: var(--lime-dark); }

/* ---------- Formular (Inserieren) ---------- */
.form-panel { max-width: 760px; margin: 0 auto 60px; }
.form-panel label { display: block; font-weight: 700; margin: 18px 0 6px; }
.form-panel input[type=text], .form-panel input[type=number], .form-panel textarea, .form-panel select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 6px;
  padding: 11px 14px; font: inherit; outline: none; background: var(--paper);
}
.form-panel input:focus, .form-panel textarea:focus { border-color: var(--lime-dark); }
.photo-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.photo-pick .opt {
  border: 2.5px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer;
  aspect-ratio: 4/3; background: #e9ebec;
}
.photo-pick .opt.selected { border-color: var(--green-deep); }
.photo-pick .opt svg, .photo-pick .opt img { width: 100%; height: 100%; object-fit: cover; }

/* Veröffentlicht-Overlay */
.publish-toast {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(20,25,15,.45); z-index: 500;
}
.publish-toast.show { display: flex; }
.publish-card {
  background: var(--paper); border-radius: 12px; padding: 40px 50px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.3); animation: msgin .3s ease;
}
.publish-card .check { width: 74px; height: 74px; margin: 0 auto 16px; color: var(--price); }
.publish-card h2 { font-size: 1.4rem; border: 0; padding: 0; margin-bottom: 6px; }
.publish-card p { color: var(--ink-soft); }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--line); background: var(--paper);
  color: #9aa0a6; font-size: .82rem; padding: 22px 0 34px; margin-top: 20px;
}
.foot .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
