* {
  box-sizing: border-box;
  font-family: Inter, Arial, sans-serif;
}

body {
  margin: 0;
  padding: 14px 14px 24px;
  background: #081021;
  color: #e5e7eb;
}

#appRoot {
  animation: fadeIn 240ms ease-out;
}

main {
  display: grid;
  gap: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
}

header p {
  margin-top: 8px;
  color: #93c5fd;
  font-size: 13px;
}

.hero-card {
  position: relative;
  min-height: 184px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #1e293b;
  background: linear-gradient(135deg, #0f172a 0%, #172554 100%);
  animation: slideUp 240ms ease;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.42;
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.86));
}

.hero-content {
  position: relative;
  z-index: 1;
  min-height: 184px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfdbfe;
}

#heroTitle {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.05;
}

#heroMeta {
  margin: 0;
  color: #dbeafe;
  font-size: 13px;
}

.controls {
  display: flex;
  gap: 8px;
}

.imdb-controls {
  margin-top: 8px;
}

input {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e5e7eb;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  background: #475569;
}

.tabs {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.tabs button {
  white-space: nowrap;
  background: #172554;
  transition: transform 160ms ease, background 160ms ease;
  border: 1px solid transparent;
}

.tabs button:hover {
  transform: translateY(-1px);
  background: #1d4ed8;
}

.tabs::-webkit-scrollbar,
.chips::-webkit-scrollbar {
  display: none;
}

.tabs button.active,
.chips button.active {
  background: #2563eb;
  border-color: #60a5fa;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chips button {
  white-space: nowrap;
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 8px 12px;
  border-radius: 999px;
}

.results-state {
  font-size: 13px;
  color: #93c5fd;
  padding: 0 2px;
}

.results {
  display: grid;
  gap: 12px;
  min-height: 32px;
}

.downloads-panel {
  display: grid;
  gap: 14px;
}

.downloads-summary,
.download-card {
  border: 1px solid #1e293b;
  border-radius: 16px;
  background: #0f172a;
  padding: 14px;
}

.downloads-summary-title,
.downloads-group-title {
  margin: 0 0 8px;
  font-size: 16px;
  color: #f8fafc;
}

.downloads-summary-text {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
}

.downloads-group {
  display: grid;
  gap: 10px;
}

.download-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.download-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.download-card p,
.download-card-note {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
}

.download-card-bottom {
  margin-top: 10px;
}

.download-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.download-actions button {
  width: 100%;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.status-chip.warning {
  background: #3a2d12;
  color: #fde68a;
}

.status-chip.success {
  background: #0f1f17;
  color: #bbf7d0;
}

.season-block {
  border: 1px solid #1e293b;
  border-radius: 16px;
  background: #0b1328;
  padding: 12px;
  animation: slideUp 240ms ease;
}

.season-title {
  margin: 0 0 8px;
  font-size: 16px;
}

.option-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  border-top: 1px solid #1e293b;
  padding: 8px 0;
}

.option-line:first-of-type {
  border-top: 0;
}

.option-meta {
  font-size: 13px;
  color: #93c5fd;
}

.option-warning {
  margin-top: 6px;
  font-size: 13px;
  color: #fca5a5;
}

.detail-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #1e293b;
  background: #0b1328;
  color: #dbeafe;
  font-size: 14px;
  line-height: 1.4;
}

.detail-status.warning {
  border-color: #854d0e;
  background: #22170a;
  color: #fde68a;
}

.detail-status.success {
  border-color: #166534;
  background: #0f1f17;
  color: #bbf7d0;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.detail-actions button {
  width: 100%;
}

.card {
  display: flex;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  animation: slideUp 220ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #334155;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

.card.unavailable {
  opacity: 0.82;
}

.card.unavailable .poster {
  filter: grayscale(1) brightness(0.75);
}

.card.unavailable:hover {
  transform: none;
}

.card.pending .poster {
  filter: grayscale(0.4) brightness(0.88);
}

.poster {
  width: 92px;
  height: 138px;
  object-fit: cover;
  background: #111827;
  flex-shrink: 0;
}

.meta {
  padding: 10px 10px 12px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.title {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.15;
}

.subtitle {
  margin: 0 0 10px;
  color: #94a3b8;
  font-size: 13px;
}

.unavailable-badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: 2px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #3f1d1d;
  color: #fecaca;
  font-size: 12px;
  font-weight: 600;
}

.pending-badge {
  background: #3a2d12;
  color: #fde68a;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.actions button {
  flex: 1;
  font-size: 13px;
  padding: 10px 8px;
}

.q1080 {
  background: #0ea5e9;
}

.q4k {
  background: #7c3aed;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}

.hidden {
  display: none;
}

.modal-loading.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 560px;
  border-radius: 18px;
  border: 1px solid #1e293b;
  background: #0f172a;
  padding: 14px;
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.45);
}

.close-modal {
  float: right;
  background: #334155;
}

.modal-loading {
  display: grid;
  place-items: center;
  min-height: 220px;
  text-align: center;
  color: #bfdbfe;
}

.loader-ring {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(147, 197, 253, 0.18);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 12px;
}

#detailError {
  margin-top: 40px;
  border: 1px solid #7f1d1d;
  background: #1f1115;
  color: #fecaca;
  border-radius: 12px;
  padding: 14px;
}

.modal-seasons {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.season-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.season-selector::-webkit-scrollbar {
  display: none;
}

.season-selector-btn {
  white-space: nowrap;
  background: #111827;
  border: 1px solid #334155;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 8px 12px;
}

.season-selector-btn.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #fff;
}

.season-panel-host {
  display: grid;
  gap: 12px;
}

.skeleton-card {
  display: flex;
  gap: 12px;
  border-radius: 16px;
  padding: 10px;
  border: 1px solid #1e293b;
  background: #0f172a;
  overflow: hidden;
}

.skeleton-poster,
.skeleton-line {
  position: relative;
  overflow: hidden;
  background: #182234;
}

.skeleton-poster::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.2s infinite;
}

.skeleton-poster {
  width: 92px;
  height: 138px;
  border-radius: 12px;
}

.skeleton-meta {
  flex: 1;
  display: grid;
  gap: 10px;
  align-content: center;
}

.skeleton-line {
  height: 14px;
  border-radius: 999px;
}

.skeleton-line.long {
  width: 88%;
}

.skeleton-line.mid {
  width: 62%;
}

.skeleton-line.short {
  width: 44%;
}

.fatal {
  max-width: 720px;
  margin: 18vh auto 0;
  border: 1px solid #7f1d1d;
  background: #1f1115;
  border-radius: 12px;
  padding: 18px;
  color: #fecaca;
}

.fatal h1 {
  margin: 0 0 8px;
  color: #fca5a5;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}
