:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22c55e;
  --danger: #ef4444;
  --border: #1f2937;
  --input: #0b1224;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #0b1020, #0b1328);
  color: var(--text);
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 20px;
}

h1 { margin: 0; font-size: 24px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
}

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}

textarea { min-height: 120px; font-family: monospace; }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

button {
  background: var(--accent);
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  color: #0b1020;
  font-weight: 600;
  cursor: pointer;
}
button.secondary { background: #475569; color: #e5e7eb; }

.badge { display: inline-block; background: #1e293b; padding: 6px 10px; border-radius: 8px; font-size: 12px; margin-right: 6px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.table th { color: var(--muted); font-weight: 500; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; }
.alert.success { background: rgba(34,197,94,0.1); color: #86efac; border: 1px solid rgba(34,197,94,0.4); }
.alert.error { background: rgba(239,68,68,0.12); color: #fecdd3; border: 1px solid rgba(239,68,68,0.4); }

.footer { color: var(--muted); font-size: 12px; margin-top: 16px; }

/* TMDB cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.tmdb-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #0b1224;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: border 0.2s, transform 0.2s;
}
.tmdb-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tmdb-thumb {
  width: 72px;
  height: 108px;
  border-radius: 8px;
  background: #1f2937;
  object-fit: cover;
  flex-shrink: 0;
}
.tmdb-title { margin: 0; font-size: 15px; }
.tmdb-overview {
  color: var(--muted);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tmdb-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

@media (max-width: 640px) {
  .tmdb-thumb { width: 64px; height: 96px; }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  width: min(680px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.season-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  white-space: nowrap;
}
.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 12px;
}
.modal-close {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
