/* ───────────────────────────────────────────────
   PauleyTV — Main Stylesheet
   Dark cinema aesthetic, mobile-first responsive
─────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg:          #0d0f14;
  --bg2:         #13161d;
  --bg3:         #1a1e28;
  --surface:     #20263300;
  --card:        #181c25;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.13);
  --accent:      #e8b84b;
  --accent2:     #c9943a;
  --red:         #e05252;
  --green:       #4caf7d;
  --blue:        #5b9cf6;
  --text:        #dde1ec;
  --text2:       #8891a8;
  --text3:       #545b6e;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 4px 24px rgba(0,0,0,0.45);
  --font-head:   'Bebas Neue', sans-serif;
  --font-body:   'DM Sans', sans-serif;
  --font-mono:   'DM Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────── */

.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--accent);
  text-decoration: none;
}

.logo span { color: var(--text); }

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg3);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ── Page title area ─────────────────────────── */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.page-title {
  font-family: var(--font-head);
  font-size: 32px;
  letter-spacing: 1px;
  color: var(--text);
}

.page-title span { color: var(--accent); }

/* ── Buttons ─────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s;
  text-decoration: none;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--accent);
  color: #0d0f14;
}
.btn-primary:hover { background: var(--accent2); }

.btn-ghost {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { color: var(--text); background: #252b38; }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(224,82,82,.3);
}
.btn-danger:hover { background: rgba(224,82,82,.1); }

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ── Sort bar ────────────────────────────────── */

.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text2);
}

.sort-bar span { font-weight: 500; }

.sort-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sort-btn:hover { color: var(--text); border-color: var(--border2); }
.sort-btn.active {
  background: var(--bg2);
  color: var(--accent);
  border-color: var(--accent);
}

.sort-arrow { font-size: 10px; }

/* ── Season table ────────────────────────────── */

.season-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
}

.season-table {
  width: 100%;
  border-collapse: collapse;
}

.season-table th {
  background: var(--bg3);
  color: var(--text3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 11px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.season-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.season-table th.sortable:hover { color: var(--text2); }
.season-table th.sort-active { color: var(--accent); }

.season-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.season-table tr:last-child td { border-bottom: none; }

.season-table tr:hover td { background: rgba(255,255,255,.02); }

.show-name {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.show-name a {
  color: inherit;
  text-decoration: none;
}
.show-name a:hover { color: var(--accent); }

.season-num {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 5px;
  color: var(--text2);
  white-space: nowrap;
}

.platform-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.platform-tag {
  background: rgba(91,156,246,.12);
  color: var(--blue);
  border: 1px solid rgba(91,156,246,.2);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.date-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
}

.date-future { color: var(--accent); }

.ep-count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text2);
}

/* ── Star rating ─────────────────────────────── */

.star-row {
  display: inline-flex;
  gap: 3px;
  cursor: pointer;
}

.star {
  font-size: 20px;
  color: var(--text3);
  transition: color .1s, transform .1s;
  line-height: 1;
}

.star:hover,
.star.hover { color: var(--accent); }
.star.filled { color: var(--accent); }

.star:hover { transform: scale(1.15); }

/* ── Section header ──────────────────────────── */

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 36px 0 16px;
}

.section-label-text {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
}

.section-count {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 2px 9px;
  border-radius: 100px;
}

/* ── Upcoming table ──────────────────────────── */

.upcoming-table {
  width: 100%;
  border-collapse: collapse;
}

.upcoming-table td,
.upcoming-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.upcoming-table th {
  background: var(--bg3);
  color: var(--text3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.upcoming-table tr:last-child td { border-bottom: none; }
.upcoming-table tr:hover td { background: rgba(255,255,255,.02); }

/* ── Add Show modal / overlay ────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.modal-title {
  font-family: var(--font-head);
  font-size: 24px;
  letter-spacing: 1px;
  margin-bottom: 20px;
  color: var(--text);
}

.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  margin-top: -4px;
}
.modal-close:hover { color: var(--text); }

/* ── Search input ────────────────────────────── */

.search-wrap {
  position: relative;
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px 10px 40px;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text3); }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 16px;
  pointer-events: none;
}

.autocomplete-list {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 300px;
  overflow-y: auto;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.selected { background: var(--bg3); }

.ac-poster {
  width: 36px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg3);
  flex-shrink: 0;
}

.ac-poster-empty {
  width: 36px;
  height: 52px;
  background: var(--bg3);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 18px;
}

.ac-info { flex: 1; min-width: 0; }
.ac-title { font-weight: 600; font-size: 14px; color: var(--text); }
.ac-year  { font-size: 12px; color: var(--text2); font-family: var(--font-mono); }
.ac-overview {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Episode page ────────────────────────────── */

.show-hero {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  align-items: flex-start;
}

.show-poster {
  width: 130px;
  border-radius: var(--radius);
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.show-hero-info { flex: 1; }

.show-hero-title {
  font-family: var(--font-head);
  font-size: 36px;
  letter-spacing: 1px;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
}

.show-hero-season {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.show-overview {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.65;
  max-width: 600px;
}

.ep-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ep-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

.ep-row:last-child { border-bottom: none; }
.ep-row:hover { background: rgba(255,255,255,.02); }

.ep-row.watched { opacity: .45; }

.ep-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  background: var(--bg3);
  border-radius: 5px;
  padding: 3px 6px;
}

.ep-info { min-width: 0; }

.ep-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
}

.ep-check {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.ep-future { color: var(--text3); font-style: italic; }

/* ── Completed page ──────────────────────────── */

.completed-table {
  width: 100%;
  border-collapse: collapse;
}

.completed-table th,
.completed-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.completed-table th {
  background: var(--bg3);
  color: var(--text3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.completed-table tr:last-child td { border-bottom: none; }
.completed-table tr:hover td { background: rgba(255,255,255,.02); }

.stars-display {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 1px;
}

.stars-empty { color: var(--text3); }

/* ── Empty state ─────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}

.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-text { font-size: 15px; }

/* ── Toast ───────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn .25s ease;
  max-width: 280px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red);   }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}

/* ── Spinner ─────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Unfollow confirm ────────────────────────── */

.confirm-bar {
  display: none;
  background: rgba(224,82,82,.1);
  border: 1px solid rgba(224,82,82,.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.confirm-bar.show { display: flex; }

/* ── Responsive ──────────────────────────────── */

@media (max-width: 640px) {
  .site-header { padding: 0 14px; }
  .logo { font-size: 22px; }
  .nav-links a { padding: 6px 8px; font-size: 12px; }

  .page-title { font-size: 24px; }

  .season-table th:nth-child(4),
  .season-table td:nth-child(4),
  .season-table th:nth-child(5),
  .season-table td:nth-child(5) { display: none; }

  .show-hero { flex-direction: column; }
  .show-poster { width: 100px; }
  .show-hero-title { font-size: 26px; }

  .modal { padding: 20px; }

  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}
/* ── Append these rules to the bottom of style.css ── */

.movie-thumb-wrap {
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
}

.movie-thumb {
  width: 32px;
  height: 46px;
  object-fit: cover;
  border-radius: 4px;
  vertical-align: middle;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
