:root {
  --bg: #0e0f13;
  --bg-elev: #16181f;
  --bg-elev-2: #1e212b;
  --surface: #232733;
  --border: #2e3342;
  --text: #e8e9ed;
  --text-dim: #9aa0b0;
  --text-mute: #6b7183;
  --accent: #f5c26b;
  --accent-2: #6bb7c9;
  --danger: #e06b6b;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #1a1d28 0%, var(--bg) 60%) no-repeat;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 15, 19, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 0.9rem; }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-text h1 {
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: 0.2px;
}
.tagline {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.top-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.top-nav a {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.top-nav a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  padding: 1.5rem 2rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.panel-head h2 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.panel-sub { margin: 0 0 1rem; color: var(--text-dim); font-size: 0.9rem; }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.filter-group { display: flex; flex-direction: column; gap: 0.35rem; }
.filter-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
}
.filter-group select,
.filter-group input[type="search"] {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-group select:focus,
.filter-group input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 194, 107, 0.15);
}
.search-group { grid-column: span 2; }
@media (max-width: 640px) {
  .search-group { grid-column: span 1; }
}

.btn {
  background: var(--accent);
  color: #1a1408;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s, box-shadow 0.15s;
}
.btn:hover { background: #f7cf85; }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(224, 107, 107, 0.4);
}
.btn.danger:hover { background: rgba(224, 107, 107, 0.1); }

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.film-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}
.film-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.film-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.film-card .title {
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.3;
}
.film-card .meta {
  color: var(--text-dim);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.film-card .meta span::before {
  content: "· ";
  color: var(--text-mute);
  margin-right: 0.2rem;
}
.film-card .meta span:first-child::before { content: ""; margin: 0; }
.film-card .mood-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(245, 194, 107, 0.12);
  color: var(--accent);
  border: 1px solid rgba(245, 194, 107, 0.25);
  text-transform: capitalize;
  letter-spacing: 0.02em;
}
.film-card .actions {
  margin-top: auto;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.film-card .actions button { font-size: 0.78rem; padding: 0.35rem 0.6rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.hidden { display: none !important; }

.film-detail {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.film-detail-inner {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
}
.film-detail h3 { margin: 0 0 0.5rem; font-size: 1.3rem; }
.film-detail .detail-meta { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1rem; }
.film-detail .detail-body { color: var(--text); font-size: 0.95rem; }
.film-detail .detail-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.film-detail .close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.film-detail .close-btn:hover { color: var(--accent); border-color: var(--accent); }

.watchlist-panel {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}
.watchlist {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}
.watchlist-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: grab;
  transition: border-color 0.15s, background 0.15s;
}
.watchlist-item:active { cursor: grabbing; }
.watchlist-item.dragging { opacity: 0.5; border-color: var(--accent); }
.watchlist-item .rank {
  font-weight: 700;
  color: var(--accent);
  min-width: 1.5rem;
  text-align: center;
}
.watchlist-item .info { flex: 1; min-width: 0; }
.watchlist-item .info .title { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watchlist-item .info .sub { font-size: 0.75rem; color: var(--text-dim); }
.watchlist-item .remove {
  background: transparent;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
}
.watchlist-item .remove:hover { color: var(--danger); background: rgba(224, 107, 107, 0.1); }
.watchlist-empty {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.watchlist-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.save-note {
  color: var(--text-mute);
  font-size: 0.78rem;
  margin-top: 0.75rem;
}

.section {
  padding: 2rem 2rem 0;
  max-width: 1400px;
  margin: 0 auto;
}
.section-head h2 { margin: 0 0 0.4rem; font-size: 1.4rem; }
.section-head p { margin: 0 0 1.25rem; color: var(--text-dim); max-width: 720px; }

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.collection-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.collection-card h3 { margin: 0; font-size: 1.05rem; }
.collection-card p { margin: 0; color: var(--text-dim); font-size: 0.9rem; }
.collection-card .btn { align-self: flex-start; }

.add-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.form-row { display: flex; flex-direction: column; gap: 0.35rem; }
.form-row label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
}
.form-row input,
.form-row select,
.form-row textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 194, 107, 0.15);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.note-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.note-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--accent); }
.note-card p { margin: 0; color: var(--text); font-size: 0.92rem; }

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  color: var(--text-dim);
  background: var(--bg-elev);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { font-weight: 600; color: var(--text); margin: 0; }
.footer-meta { font-size: 0.82rem; margin: 0; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 0.85rem; }
.footer-links a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .site-header { flex-direction: column; align-items: flex-start; padding: 1rem; }
  .layout { padding: 1rem; }
  .section { padding: 1.5rem 1rem 0; }
  .watchlist-panel { position: static; max-height: none; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
