@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #eef3fb;
  --panel: #ffffff;
  --edge: #d3e0f2;
  --gold: #2f5fac;
  --gold-dim: #7fa1d6;
  --text: #1c2b40;
  --muted: #64748c;
  --border: #91B1DE;
  --movie: #2274A5;
  --show: #EB9C0A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(circle at 15% 0%, rgba(47,95,172,0.07), transparent 45%);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.wrap.wide {
  max-width: 1080px;
}

.marquee {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.01em;
  color: var(--gold);
  margin: 0 0 4px;
}

.subhead {
  color: var(--muted);
  margin: 0 0 36px;
  font-size: 0.95rem;
}

nav.tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 36px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
}

nav.tabs a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
}

nav.tabs a.active {
  color: var(--gold);
  font-weight: 500;
  background: #fff;
  border: 2px solid var(--gold);
}
.card {
  background: var(--panel);
  border: 2px solid var(--edge);
  border-radius: 8px;
  padding: 28px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input[type=text],
.field textarea,
.field select {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--edge);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
}

.field textarea { resize: vertical; min-height: 60px; }

.radio-row {
  display: flex;
  gap: 20px;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

button.save {
  background: var(--gold);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
}

button.save:hover { background: #244d8f; }

.cancel-link {
  margin-left: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.cancel-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.notice {
  background: #e5f3ea;
  border: 2px solid #b9dcc4;
  color: #2f6b45;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-bar input[type=text] {
  flex: 1;
  background: var(--panel);
  border: 2px solid var(--edge);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
}

.filter-bar select {
  background: var(--panel);
  border: 2px solid var(--edge);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
}

.filter-bar input[type=text]:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(47,95,172,0.12);
}
.table-wrap {
  background: var(--panel);
  border: 2px solid var(--edge);
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 4px 16px rgba(47,95,172,0.08);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  font-weight: 600;
  padding: 16px 22px;
  border-bottom: 2px solid var(--border);
  background: #f6f9fe;
}

tbody td {
  padding: 18px 22px;
  border-bottom: 2px solid var(--edge);
  vertical-align: middle;
  font-size: 0.9rem;
  position: relative;
}

tbody tr:nth-child(even) td {
  background: #f6f9fe;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #e9f1fc;
}

tbody td:first-child {
  border-left: 6px solid var(--edge);
}

tbody tr[data-type="movie"] td:first-child { border-left-color: var(--movie); }
tbody tr[data-type="show"] td:first-child { border-left-color: var(--show); }

.row-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.row-note {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 3px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 8px;
  white-space: nowrap;
  color: #ffffff;
}

.badge.movie { background: var(--movie); }
.badge.show { background: var(--show); }

.service-form { margin: 0; }

.col-service {
  text-align: left;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.service-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
  border-radius: 8px;
  padding: 3px 6px 3px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.service-remove {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 2px;
}

.service-remove:hover {
  color: #ffffff;
}

.service-add {
  appearance: none;
  -webkit-appearance: none;
  border: 2px dashed var(--edge);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 3px 8px;
  cursor: pointer;
}

.service-add:focus {
  outline: none;
  border-color: var(--gold);
}

.col-title {
  min-width: 260px;
}

.col-date {
  color: var(--muted);
  white-space: nowrap;
}

.date-form {
  margin: 0;
}

.date-input {
  border: 2px solid var(--edge);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 5px 8px;
  cursor: pointer;
}

.date-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(47,95,172,0.12);
}

.col-actions {
  text-align: right;
  white-space: nowrap;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  margin-left: 2px;
}

.action-icon:hover {
  background: #e9f1fc;
  color: var(--gold);
}

.watch-icon:hover {
  background: #e6f4ec;
  color: #2f8f6f;
}

.remove-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
}

.remove-icon:hover {
  background: #fbe9e7;
  color: #a13f2e;
}

.empty {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  border: 2px dashed var(--edge);
  border-radius: 4px;
}

/* ---- Section title (edit page: "Seasons") ---- */

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
}

/* ---- Season rows (edit page) ---- */

.season-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.season-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 2px solid var(--edge);
  border-radius: 8px;
  background: var(--bg);
}

.season-row.season-add {
  margin-top: 4px;
  background: var(--panel);
  border-style: dashed;
}

.season-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.season-input {
  width: 100px;
  background: var(--panel);
  border: 2px solid var(--edge);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

.season-save {
  background: var(--gold);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
}

.season-save:hover {
  background: #244d8f;
}

/* ---- Progress pill (used on the Watching table and season headers) ---- */

.progress-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  background: #dce9fa;
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}

.progress-pill-empty {
  color: var(--muted);
  background: var(--bg);
}

.show-body {
  border-top: 2px solid var(--edge);
  padding: 18px 22px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- Seasons (nested inside a show) ---- */

.season-block {
  background: var(--panel);
  border: 2px solid var(--edge);
  border-radius: 8px;
  overflow: hidden;
}

.season-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

.season-summary::-webkit-details-marker {
  display: none;
}

/* ---- Episodes (nested inside a season) ---- */

.episode-list {
  border-top: 2px solid var(--edge);
  display: flex;
  flex-direction: column;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--edge);
}

.episode-row:last-child {
  border-bottom: none;
}

.episode-row.episode-watched {
  background: #f2f8f4;
}

.episode-toggle-form {
  margin: 0;
}

.episode-check {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 1.15rem;
  color: var(--edge);
  display: flex;
  align-items: center;
}

.episode-watched .episode-check {
  color: #2f8f6f;
}

.episode-label {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text);
}

.episode-date-form {
  margin: 0;
}

.episode-delete {
  width: 22px;
  height: 22px;
  font-size: 0.95rem;
}

/* ---- Watched page: expandable per-episode detail row ---- */

tr.has-detail td {
  border-bottom: none;
}

.episode-detail-row td {
  padding: 0;
  border-bottom: 2px solid var(--edge);
  background: var(--bg);
}

.episode-detail-cell {
  padding: 0 !important;
}

.episode-detail {
  padding: 0;
}

.episode-detail-summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 22px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.episode-detail-summary::-webkit-details-marker {
  display: none;
}

.episode-detail .show-body {
  padding: 16px 22px 20px;
}

.chevron-icon {
  font-size: 0.65rem;
  margin-right: 6px;
  color: var(--muted);
  display: inline-block;
  transition: transform 0.15s ease;
}

details[open] > summary .chevron-icon {
  transform: rotate(90deg);
}
#service_select {
    padding: 4px;
    border-radius: 8px;
    color: #64748c;
}
#service_select option:checked {
    background-color: #007bff; /* your highlight colour */
    color: white;
    border-radius: 8px;        /* rounded highlight */
}
#service_select option {
    padding: 1px 8px;
}

/* ---- Scroller Bar ---- */
#service_select::-webkit-scrollbar {
    width: 10px;
}

#service_select::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 8px 8px 8px 8px; /* top-right, bottom-right rounded */
}

#service_select::-webkit-scrollbar-thumb {
    background: #bcbcbc;
    border-radius: 8px 8px 8px 8px; /* round only the right side */
}

#service_select::-webkit-scrollbar-thumb:hover {
    background: #999;
}
