/* PBMDb – IMDb-inspiriertes dunkles Theme mit eigenem Branding */
:root {
  --yellow: #f5c518;
  --bg: #101010;
  --bg-card: #1a1a1a;
  --bg-card-hover: #232323;
  --bg-header: #121212;
  --text: #ffffff;
  --text-dim: #b3b3b3;
  --text-faint: #757575;
  --border: #2c2c2c;
  --peter: #5799ef;
  --ben: #57e08d;
  --comm: #c884f0;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--yellow); }
button { font-family: inherit; }
img { max-width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  background: var(--yellow);
  color: #121212;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  padding: 3px 10px;
  border-radius: 5px;
  flex-shrink: 0;
}
.logo:hover { color: #000; }
.logo span { font-weight: 400; }
.main-nav { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav-link:hover { background: #252525; color: var(--text); }

.search-box { flex: 1 1 260px; position: relative; min-width: 200px; }
.search-box input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: #121212;
  font-size: 0.95rem;
  outline: none;
}
.search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 420px;
  overflow-y: auto;
  z-index: 200;
}
.suggest-item {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  align-items: center;
}
.suggest-item:hover { background: var(--bg-card-hover); }
.suggest-item img, .suggest-item .mini-poster {
  width: 36px;
  height: 53px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.suggest-title { font-size: 0.92rem; font-weight: 500; }
.suggest-meta { font-size: 0.8rem; color: var(--text-dim); }

/* Profil-Umschalter */
.user-switch { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.user-chip {
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.user-chip:hover { border-color: var(--text-dim); color: var(--text); }
.user-chip.active-peter { border-color: var(--peter); background: var(--peter); color: #04121f; }
.user-chip.active-ben { border-color: var(--ben); background: var(--ben); color: #03180c; }

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}
.section-title {
  color: var(--yellow);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 34px 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 26px;
  background: var(--yellow);
  border-radius: 2px;
}
.section-sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 16px; }

.loading-screen { text-align: center; padding: 120px 0; color: var(--text-dim); }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--yellow);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1c1c1c 0%, #101010 60%),
              radial-gradient(circle at 85% 15%, rgba(245, 197, 24, 0.16), transparent 50%);
  background-blend-mode: screen;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 30px;
  margin-bottom: 8px;
}
.hero h1 { font-size: 1.9rem; margin-bottom: 8px; }
.hero h1 em { color: var(--yellow); font-style: normal; }
.hero p { color: var(--text-dim); max-width: 640px; line-height: 1.5; }
.hero .hero-stats { display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 1.5rem; color: var(--yellow); }
.hero-stat span { color: var(--text-faint); font-size: 0.84rem; }

/* ---------- Poster-Reihen ---------- */
.poster-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 168px;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a transparent;
}
.movie-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.movie-card:hover { transform: translateY(-3px); border-color: #4a4a4a; }
.poster-wrap { position: relative; aspect-ratio: 2/3; background: #262626; }
.poster-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-fallback {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  background: linear-gradient(160deg, #2e2e2e, #191919);
  color: var(--text-faint);
  text-align: center;
  padding: 10px;
}
.poster-fallback .pf-icon { font-size: 2rem; }
.poster-fallback .pf-title { font-size: 0.78rem; line-height: 1.3; }
.rank-badge {
  position: absolute;
  top: 0; left: 0;
  background: rgba(18, 18, 18, 0.88);
  color: var(--yellow);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px 9px;
  border-bottom-right-radius: 8px;
}
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 0.92rem; font-weight: 600; line-height: 1.25; }
.card-meta { font-size: 0.78rem; color: var(--text-faint); }
.card-scores { display: flex; gap: 8px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.score-star { color: var(--yellow); font-size: 0.9rem; font-weight: 700; }
.score-star .off { color: var(--text-faint); font-weight: 400; }

.pb-badges { display: inline-flex; gap: 4px; }
.pb-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #262626;
  color: var(--text-faint);
}
.pb-badge.p-set { background: rgba(87, 153, 239, 0.18); color: var(--peter); }
.pb-badge.b-set { background: rgba(87, 224, 141, 0.18); color: var(--ben); }

.cm-badge {
  font-size: 0.72rem;
  color: var(--text-faint);
  background: #262626;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- Sticker auf Postern ---------- */
.stickers { position: absolute; inset: 0; pointer-events: none; }
.sticker {
  position: absolute;
  pointer-events: auto;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
}
img.sticker { max-width: 46%; max-height: 40%; width: auto; height: auto; }
img.sticker.sk-both-top { max-width: 64%; max-height: 42%; }
.sticker.s-0 { right: -4%; bottom: -2%; transform: rotate(-8deg); }
.sticker.s-1 { left: -4%; bottom: -2%; transform: rotate(7deg); }
img.sticker.sk-both-top.s-0 { right: 50%; transform: translateX(50%) rotate(-6deg); }
.sticker-emoji {
  font-size: 1.5rem;
  background: rgba(18, 18, 18, 0.85);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
}
.sticker-emoji.se-peter { border-color: var(--peter); }
.sticker-emoji.se-ben { border-color: var(--ben); }
.sticker-emoji.se-both { border-color: var(--yellow); font-size: 1.3rem; }
.sticker-emoji.s-0 { right: 6px; bottom: 6px; }
.sticker-emoji.s-1 { left: 6px; bottom: 6px; }
/* Detailansicht: Sticker als dezentes Eck-Badge, nicht übers Poster */
.detail-poster { position: relative; }
.detail-poster img.sticker { max-width: 24%; max-height: 22%; }
.detail-poster img.sticker.sk-both-top { max-width: 32%; max-height: 24%; }
.detail-poster img.sticker.sk-both-top.s-0 { right: -5%; left: auto; transform: rotate(-6deg); }
.detail-poster .sticker.s-0 { right: -5%; bottom: -3%; }
.detail-poster .sticker.s-1 { left: -5%; bottom: -3%; }

/* ---------- Chart-Liste ---------- */
.chart-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 20px;
  align-items: center;
}
.chart-controls select, .chart-controls input[type="search"] {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
}
.chart-count { color: var(--text-faint); font-size: 0.85rem; margin-left: auto; }

.chart-list { display: flex; flex-direction: column; gap: 10px; }
.chart-row {
  display: grid;
  grid-template-columns: 44px 64px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px 10px 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.chart-row:hover { background: var(--bg-card-hover); }
.chart-rank { font-size: 1.05rem; font-weight: 800; color: var(--text-dim); text-align: center; }
.chart-row .mini-poster { width: 64px; height: 94px; border-radius: 6px; background: #262626; }
.chart-poster { position: relative; width: 64px; height: 94px; flex-shrink: 0; }
.chart-poster .poster-slot { width: 100%; height: 100%; }
.chart-poster .poster-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.chart-poster .poster-fallback { border-radius: 6px; padding: 4px; }
.chart-poster .pf-title { display: none; }
.chart-poster .pf-icon { font-size: 1.3rem; }
.chart-poster img.sticker { max-width: 60%; max-height: 48%; }
.chart-poster img.sticker.sk-both-top { max-width: 78%; max-height: 52%; }
.chart-poster img.sticker.sk-both-top.s-0 { right: -6%; left: auto; transform: rotate(-6deg); }
.chart-poster .sticker-emoji {
  width: 22px; height: 22px;
  font-size: 0.7rem;
  border-width: 1.5px;
}
.chart-poster .sticker-emoji.se-both { font-size: 0.62rem; }
.chart-poster .sticker-emoji.s-0 { right: 2px; bottom: 2px; }
.chart-poster .sticker-emoji.s-1 { left: 2px; bottom: 2px; }
.mini-poster { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--text-faint); }
.chart-info h3 { font-size: 1.02rem; font-weight: 600; }
.chart-info .de-title { color: var(--text-dim); font-size: 0.84rem; font-style: italic; }
.chart-info .meta { color: var(--text-faint); font-size: 0.82rem; margin-top: 4px; }
.chart-ratings { display: flex; gap: 16px; align-items: center; text-align: center; }
.rating-block b { display: block; font-size: 1.05rem; }
.rating-block span { font-size: 0.68rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.rating-block .r-total { color: var(--yellow); }
.rating-block .r-peter { color: var(--peter); }
.rating-block .r-ben { color: var(--ben); }
.rating-block .r-comm { color: var(--comm); }
.imdb-inline { color: var(--text-faint); font-size: 0.78rem; }

.load-more {
  margin: 26px auto 0;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 34px;
  border-radius: 999px;
  cursor: pointer;
}
.load-more:hover { border-color: var(--yellow); color: var(--yellow); }

/* ---------- Detailseite ---------- */
.detail-back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
}
.detail-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
  align-items: start;
}
.detail-poster {
  border-radius: var(--radius);
  background: #262626;
  aspect-ratio: 2/3;
  box-shadow: var(--shadow);
}
.detail-poster .poster-slot { width: 100%; height: 100%; border-radius: var(--radius); overflow: hidden; }
.detail-poster .poster-slot img { width: 100%; height: 100%; object-fit: cover; }
.detail-head h1 { font-size: 2rem; line-height: 1.15; }
.detail-head .de-title { color: var(--text-dim); font-style: italic; margin-top: 4px; }
.detail-meta { color: var(--text-dim); font-size: 0.92rem; margin: 10px 0 14px; }
.genre-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.genre-tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 13px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.ratings-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.rating-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.rating-card .rc-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.rating-card .rc-value { font-size: 1.7rem; font-weight: 800; }
.rating-card .rc-value small { font-size: 0.9rem; color: var(--text-faint); font-weight: 400; }
.rating-card.total { border-color: rgba(245, 197, 24, 0.5); }
.rating-card.total .rc-value { color: var(--yellow); }
.rating-card.peter .rc-value { color: var(--peter); }
.rating-card.ben .rc-value { color: var(--ben); }
.rating-card.community .rc-value { color: var(--comm); }
.rating-card .rc-count { font-size: 0.72rem; color: var(--text-faint); margin-top: 4px; }

.plot { line-height: 1.65; color: #e4e4e4; margin: 12px 0 18px; max-width: 760px; }
.plot-source { font-size: 0.78rem; color: var(--text-faint); }
.credits { margin-top: 14px; font-size: 0.92rem; line-height: 1.9; }
.credits b { color: var(--text-dim); font-weight: 600; margin-right: 6px; }

/* Bewertungs-Widget */
.rate-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 22px;
  max-width: 560px;
}
.rate-widget h3 { font-size: 1rem; margin-bottom: 4px; }
.rate-widget .rw-hint { color: var(--text-faint); font-size: 0.82rem; margin-bottom: 12px; }
.stars { display: flex; gap: 4px; flex-wrap: wrap; }
.star-btn {
  background: none;
  border: none;
  font-size: 1.7rem;
  color: #3d3d3d;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.1s, color 0.1s;
}
.star-btn:hover { transform: scale(1.2); }
.star-btn.lit { color: var(--yellow); }
.rate-actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; }
.btn {
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--yellow); color: #121212; }
.btn-primary:hover { background: #ffd633; }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn-danger { background: transparent; color: #e05757; border: 1px solid #5a2727; }

.community-widget { border-color: rgba(200, 132, 240, 0.35); }
.star-btn.lit-comm { color: var(--comm); }

.person-link { color: var(--text); text-decoration: underline; text-decoration-color: #4a4a4a; }
.person-link:hover { color: var(--yellow); }
.person-sub { font-size: 1.05rem; color: var(--text-dim); margin: 24px 0 10px; }

.ext-line { font-size: 0.8rem; color: var(--text-faint); margin-top: 8px; }
.ext-line a { color: var(--text-faint); text-decoration: underline; }
.ext-line a:hover { color: var(--yellow); }

.btn-small { padding: 6px 12px; font-size: 0.8rem; flex-shrink: 0; }
.wr-lang {
  font-size: 0.66rem;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 6px;
  text-transform: uppercase;
}

/* ---------- Formulare (Film hinzufügen) ---------- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 720px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; }
.form-field input, .form-field textarea {
  background: #101010;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.92rem;
  outline: none;
  font-family: inherit;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--yellow); }
.wiki-results { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.wiki-result {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: #101010;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
}
.wiki-result:hover { border-color: var(--yellow); }
.wiki-result img { width: 42px; height: 62px; object-fit: cover; border-radius: 4px; }
.wiki-result .wr-desc { font-size: 0.8rem; color: var(--text-dim); }

/* ---------- Reviews ---------- */
.reviews-section { margin-top: 44px; }
.review-count { color: var(--text-faint); font-weight: 400; font-size: 1rem; }
.review-form { max-width: 720px; margin: 14px 0 26px; }
.review-form textarea { resize: vertical; min-height: 90px; }
.review-list { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.review-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.review-card p { color: #e4e4e4; line-height: 1.6; font-size: 0.94rem; white-space: pre-wrap; }
.review-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2c2c2c;
  color: var(--text-faint);
}
.review-badge.rb-peter { background: rgba(87, 153, 239, 0.18); color: var(--peter); }
.review-badge.rb-ben { background: rgba(87, 224, 141, 0.18); color: var(--ben); }
.review-date { color: var(--text-faint); font-size: 0.78rem; }
.review-delete {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.5;
}
.review-delete:hover { opacity: 1; }

/* ---------- Footer / Toast ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 16px 40px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.footer-small { font-size: 0.76rem; color: var(--text-faint); margin-top: 6px; }
.footer-small a { text-decoration: underline; }

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #262626;
  border: 1px solid var(--yellow);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 500;
  transition: opacity 0.3s;
}
.hidden { display: none; }

.notice {
  background: rgba(245, 197, 24, 0.08);
  border: 1px solid rgba(245, 197, 24, 0.35);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.88rem;
  color: #e8d48a;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-poster { max-width: 260px; }
  .chart-row { grid-template-columns: 34px 50px 1fr; }
  .chart-row .mini-poster, .chart-poster { width: 50px; height: 74px; }
  .chart-ratings { grid-column: 1 / -1; justify-content: flex-start; padding-left: 6px; }
  .header-inner { gap: 10px; }
  .main-nav { order: 3; }
  .search-box { order: 4; flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}
