:root { font-family: "Arial Narrow", "Aptos Narrow", Arial, sans-serif; color: #f8f4ff; background: #120c25; --panel: rgba(34,22,55,.86); --panel2: rgba(25,15,44,.94); --accent: #d24fe8; --accent2: #ff9328; --line: rgba(225,87,246,.65); }
* { box-sizing: border-box; }
html, body { 
  margin: 0; 
  height: 100vh;
  min-height: 100%; 
  background: radial-gradient(circle at 60% 20%, #2b1747 0, #140c28 42%, #090711 100%);
  overflow: hidden; /* Verhindert das globale Scrollen der gesamten Seite */
}
body { 
  display: grid; 
  grid-template-rows: auto 1fr auto; 
}
.topbar { height: 58px; padding: 6px 15px; display:flex; align-items:center; justify-content:space-between; background: linear-gradient(90deg,#171027,#1d0d31); border-bottom: 1px solid #22163b; box-shadow: 0 2px 10px #0008; }
h1 { margin:0; font-size: 29px; font-weight: 500; letter-spacing: -.5px; }
.menu-button { background: transparent; border:0; color:#bbb; font-size:27px; cursor:pointer; }
.hidden { display:none !important; }
.main-grid {
  height: 100%; 
  min-height: 0; 
  padding: 7px 10px 7px; 
  display: grid; 
  grid-template-columns: minmax(235px, 18%) minmax(390px, 1fr) minmax(310px, .85fr); 
  gap: 9px; 
  overflow: hidden;
}
.panel { 
  height: 100%;
  min-height:0; 
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(36,25,58,.92), rgba(21,13,38,.95)); 
  border-radius:5px; 
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 2px 8px #0008; 
  overflow:hidden; 
}
.controls { padding: 11px 9px; overflow:auto; }
.field { display:grid; grid-template-columns: 80px minmax(0,1fr); align-items:center; gap:6px; margin-bottom:5px; }
.field label { font-size:18px; white-space:nowrap; }
input, select { width:100%; height:29px; border:1px solid #4b365d; border-radius:5px; background:#171126; color:#eee; font:inherit; font-size:16px; padding:3px 7px; outline:none; }
input:focus, select:focus { border-color:#ffb13e; box-shadow:0 0 0 1px #ffb13e55; }
select { appearance:auto; }
.search-button { width:100%; border:0; border-radius:5px; background:linear-gradient(#ffad3d,#f58b20); color:#140b1c; font-weight:700; font-size:18px; padding:7px 10px; cursor:pointer; margin-top:3px; }
.search-button:hover { filter:brightness(1.08); }
.status { min-height:22px; color:#d9cde3; font-size:13px; padding:5px 2px 0; margin-bottom: 10px; }
.film-list { overflow-y: auto; padding: 10px 8px 7px; }
.film-list-inner { display:flex; flex-direction:column; gap:5px; }
.empty-state, .preview-empty { color:#a99fb4; padding:30px 22px; text-align:center; }
.film-row { min-height:78px; display:grid; grid-template-columns: 104px minmax(0,1fr) auto; gap:12px; align-items:center; padding:5px 10px; border:1px solid rgba(215,67,237,.62); border-radius:5px; background:linear-gradient(100deg, rgba(53,36,77,.95), rgba(34,22,55,.9)); cursor:pointer; }
.film-row:hover, .film-row.selected { background:linear-gradient(100deg, rgba(72,42,91,.98), rgba(43,25,60,.98)); }
.film-tools { display:flex; align-items:center; justify-content:center; gap:7px; }
.eye-box { position:relative; display:flex; align-items:center; justify-content:center; }
.eye-box input { position:absolute; opacity:0; pointer-events:none; }
.eye { width:34px; height:26px; display:inline-flex; align-items:center; justify-content:center; border-radius:3px; background:#1b1030; color:#b54ad3; font-size:24px; border:1px solid transparent; }
.eye-box input:checked + .eye { border-color:#d34ee7; color:#d85ce9; }
.eye::before { content:"HL"; font-size:20px; }
.eye-box input:checked + .eye::after { content:"✓"; font-size:16px; margin-left:3px; }
/* --- Watchlist-Button Styling --- */
.wl-box { 
  position: relative; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  cursor: pointer; 
}

/* Versteckt die echte HTML-Checkbox */
.wl-box input { 
  position: absolute; 
  opacity: 0; 
  pointer-events: none; 
}

/* Der sichtbare Button im inaktiven Zustand (Stern) */
.wl-icon { 
  width: 34px; 
  height: 26px; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  border-radius: 3px; 
  background: #1b1030; 
  color: #ff9328; 
  font-size: 20px; 
  border: 1px solid transparent; 
  transition: all 0.2s ease;
}

.wl-icon::before { 
  content: "WL"; 
  font-size: 18px; 
}

/* Styling bei aktivierter Checkbox (Orangefarbene Umrandung + Häkchen) */
.wl-box input:checked + .wl-icon { 
  border-color: #ff9328; 
  color: #ffad3d; 
}

.wl-box input:checked + .wl-icon::after { 
  content: "✓"; 
  font-size: 15px; 
  margin-left: 2px; 
}
.film-text { min-width:0; font-size:clamp(16px,1.55vw,22px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Basis-Style für alle Thumbnails */
.film-thumb {
  width: 48px;            /* Standard-Breite (entspricht z.B. medium) */
  aspect-ratio: 2 / 3;    /* Sorgt automatisch für das richtige Poster-Verhältnis */
  object-fit: cover;      /* Schneidet Ränder sauber ab, verhindert Verzerren */
  border-radius: 3px;
  background: #160d27;
}
/* Dynamische Größen (passen die Breite an, Höhe skaliert automatisch mit) */
.film-row.size-tiny .film-thumb   { width: 50px;  }
.film-row.size-small .film-thumb  { width: 75px;  }
.film-row.size-medium .film-thumb { width: 100px;  }
.film-row.size-large .film-thumb  { width: 150px;  }
.film-row.size-huge .film-thumb   { width: 200px; }
.preview { padding:10px; overflow:auto; }
.preview-content img {
  width: 100%;
  height: 100%;
  max-height: 400px; /* Bzw. dein gewünschter Maximalwert */
  object-fit: contain; /* Behält das Seitenverhältnis bei und zeigt das gesamte Bild an */
  display: block;
  margin: 0 auto; /* Zentriert das Bild horizontal, falls Freiraum entsteht */
}
.preview-text { margin-top:9px; line-height:1.18; white-space:pre-wrap; font-size:var(--preview-font, 1rem); }
.preview-text strong { font-weight:700; }
footer { min-height: 54px; padding:8px 13px; display:flex; align-items:center; justify-content:space-between; background:#030303; border-top:4px solid #8c39aa; font-size:25px; }
footer nav { display:flex; gap:5px; font-size:20px; } footer a { color:#eee; }
.login-dialog { width:min(470px, calc(100vw - 30px)); border:1px solid #a943c0; border-radius:8px; color:#eee; background:linear-gradient(135deg,#211336,#0f091b); box-shadow:0 20px 80px #000; padding:0; }
.login-dialog::backdrop { background:rgba(0,0,0,.76); backdrop-filter:blur(3px); }
.login-dialog form { padding:22px; } .login-dialog h2 { margin:0 0 18px; font-size:26px; font-weight:500; }
.login-field { display:grid; grid-template-columns:100px 1fr; align-items:center; gap:10px; margin-bottom:10px; } .login-field label { font-size:18px; }
.password-hint { color:#bfb1ca; font-size:13px; line-height:1.35; margin:5px 0 10px 110px; } .login-error { color:#ff8d7d; min-height:22px; margin:4px 0 8px 110px; }

.list-buttons-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.action-button {
  border: 0;
  border-radius: 5px;
  background: #3b265c;
  color: #eee;
  padding: 6px 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.highlight-wl {
  color: #ff9328;
}
.highlight-hl {
  color: #d85ce9;
}

.action-button:hover { background: #523580; }
.action-button.danger { background: #611e38; color: #ffb3c1; }
.action-button.danger:hover { background: #85264b; }

@media (max-width: 950px) { 
  html, body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .main-grid { 
    height: auto;
    grid-template-columns: 1fr; 
    grid-template-areas: "controls" "preview" "films"; 
    overflow: visible; 
  } 

  .panel {
    height: auto;
    overflow: visible;
  }

  .controls { 
    grid-area: controls; 
  } 

  .preview { 
    grid-area: preview; 
    min-height: 300px;
    /* Verhindert das Überlappen durch sauberen Bounding Box Kontext */
    display: block; 
    overflow: hidden; 
  } 

  .preview-content img { 
    width: 100%;
    /* Wichtig: Auf 'auto' setzen statt 100%, damit sich die Box-Höhe am Bild ausrichtet */
    height: auto; 
    max-height: 45vh; 
    object-fit: contain;
  } 

  .film-list { 
    grid-area: films; 
    min-height: 420px; 
  } 

  footer { flex-direction: column; gap: 5px; text-align: center; } 
}
@media (min-width: 951px) { 
  .controls { grid-area:auto; } 
  .film-list { grid-area:auto; } 
  .preview { grid-area:auto; } 
}
@media (max-width: 620px) { 
  .field { grid-template-columns:100px 1fr; } 
  .film-row { grid-template-columns:72px minmax(0,1fr) auto; } 
  .film-tools { gap:3px; } 
  .film-text { font-size:17px; } 
  footer { font-size:17px; } 
  footer nav { font-size:14px; } 
}
