/* ═══════════════════════════════════════════════════════════
   FILMABEND — LAYOUT
   Design: "The Projection Room"
   03-header.md + 04-views.md + 11-responsive.md
   ═══════════════════════════════════════════════════════════ */

/* ── HEADER CONTAINER ─────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  padding: env(safe-area-inset-top) var(--page-pad) 0;
  background: var(--ink);
}

/* Goldene Unterkante */
.header::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--amber-dim) 25%,
    var(--amber-dim) 75%,
    transparent 100%
  );
  opacity: .5;
}

/* ── SPROCKET PERFORATIONEN ───────────────────────────────── */
.sprockets {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-right: 16px;
  opacity: .4;
}
.sprocket {
  width: 6px;
  height: 9px;
  border: 1px solid var(--amber-dim);
  border-radius: 1px;
}

/* ── LOGO ─────────────────────────────────────────────────── */
.logo {
  font-family: var(--f-display);
  font-size: 1.6rem;
  letter-spacing: .06em;
  color: var(--cream);
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 36px;
  line-height: 1;
  user-select: none;
}
.logo em {
  color: var(--amber);
  font-style: normal;
}

/* ── NAVIGATION ───────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-btn {
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-family: var(--f-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
}
.nav-btn:hover  { color: var(--body); background: rgba(255,255,255,.05); }
.nav-btn.active { color: var(--amber); background: var(--amber-sub); }

/* Badge (Filmanzahl) */
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--amber);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: .6rem;
  font-weight: 500;
  margin-left: 5px;
  vertical-align: middle;
}

/* ── RECHTE AKTIONEN ──────────────────────────────────────── */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hbtn {
  padding: 5px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: .7rem;
  letter-spacing: .03em;
  cursor: pointer;
  transition: var(--t);
}
.hbtn:hover { border-color: var(--line-warm); color: var(--amber); }

/* Dropdown bleibt als Wrapper */
.header-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px;
  display: none;
  z-index: 200;
}
.dropdown-menu.open { display: block; }

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--body);
  text-align: left;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--t);
}
.dropdown-item:hover { background: var(--lift); color: var(--cream); }

/* ── SERVER-STATUS ────────────────────────────────────────── */
.server-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: .68rem;
  color: var(--muted);
}

.server-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2.4s ease infinite;
  flex-shrink: 0;
}

.server-dot.offline {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: none;
}

.server-dot.syncing {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
  animation: pulse .8s ease infinite;
}

/* ── MOBILE BOTTOM-NAVIGATION ─────────────────────────────── */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  background: var(--ink);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  color: var(--muted);
  font-size: 1.05rem;
  font-family: var(--f-mono);
  transition: var(--t);
}

.tab-btn i.ph {
  font-size: 1.45rem;
  line-height: 1;
}

.tab-btn span {
  font-size: .55rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tab-btn.active { color: var(--amber); }

/* ── VIEWS ────────────────────────────────────────────────── */
.view {
  display: none;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
}

.view.active {
  display: block;
  animation: fadeUp .32s ease both;
}

/* ── SETUP-DIALOG ─────────────────────────────────────────── */
.setup-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11,10,15,.96);
  padding: 20px;
}

.setup-modal__content {
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
}

.setup-modal__title {
  font-family: var(--f-display);
  font-size: 1.8rem;
  color: var(--cream);
  margin-bottom: 8px;
}

.setup-modal__desc {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--cream);
  font-size: .9rem;
  outline: none;
  transition: var(--t);
}

.form-group input:focus {
  border-color: var(--line-warm);
  box-shadow: 0 0 0 2px var(--amber-glow);
}

.settings-only { display: none; }
.setup-modal.is-settings-mode .settings-only { display: block; }
.person-editor-row {
  display: grid;
  grid-template-columns: 1fr 64px auto;
  gap: 8px;
  margin-bottom: 8px;
}
.person-editor-row .btn-ghost { padding: 8px 10px; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --panel-w: 100vw; }

  .panel-open .main-content {
    transform: none;
    filter: brightness(.4);
  }

  .hero { height: 420px; }
  .hcard { width: 130px; }
}

@media (max-width: 600px) {
  :root {
    --page-pad:  16px;
    --header-h:  50px;
  }

  .logo { font-size: 1.3rem; margin-right: 12px; }
  .sprockets { display: none; }
  .nav { display: none; }
  .header-right { gap: 5px; }
  .hbtn { padding: 5px 7px; }
  #sync-btn-label { display: none; }
  .server-tag { display: none; }
  .tabbar { display: flex; }
  .main-content { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .hero { height: 340px; }
  .hero-title { font-size: 3.2rem; }
  .hero-content { padding: 0 20px 32px; }
  .hero-desc { display: none; }
  .hero-actions .btn-outline { display: none; }

  .filter-section { gap: 5px; padding: 12px var(--page-pad) 10px; }
  .filter-label { display: none; }
  .search-wrap { margin-left: 0; width: 100%; order: 10; }
  .search-in { width: 100%; }

  .poster-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    padding: 0 0 60px;
  }
  .section-header { padding: 20px var(--page-pad) 14px; }
  .section-title  { font-size: 1.7rem; }

  .panel-hero { height: 200px; }
  .panel-title { font-size: 1.6rem; }
  .panel-body { padding: 0 16px 28px; }

  .disc-tagline { font-size: 2.5rem; }
  .cat-num { font-size: 2.5rem; }
  .hcard { width: 120px; }
  .hscroll { padding: 0 var(--page-pad); }
}

@media (hover: none) {
  .pcard-overlay { opacity: 1; }
  .pcard-info { transform: none; }
  .pcard::before, .pcard::after,
  .pcard .pcard-inner::before,
  .pcard .pcard-inner::after { opacity: .5; }
  .pcard-img { filter: saturate(.95) brightness(.85); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::after { display: none; }
  .hero-bg { transform: none !important; transition: none !important; }
}
