/* ============================================================
   tvShows — component styles only. Layout (header/hero/footer)
   is plain Tailwind utility classes in index.html, matching
   iCinema's palette:
   Dark Deep Black #0a0a0f · Dark Gray #16161f · Text #e0e0e0
   DeepBlue #0d6efd · Cyan glow #00d4ff · border slate-800 #1e293b
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ---------- Rows (list layout) ---------- */

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #16161f;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 10px 16px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.row:hover {
  background: #1c1c26;
  border-color: #00d4ff;
  transform: translateX(-2px);
}

.row-poster {
  order: 0; /* always first — not reorderable */
  flex: 0 0 52px;
  width: 52px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, #1f1f2b, #0a0a0f);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #64748b;
}

.row-poster.has-image {
  color: transparent;
}

.row-col {
  min-width: 0;
}

.row-col.title {
  flex: 1 1 220px;
  font-weight: 700;
  color: #e0e0e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-col.year {
  flex: 0 0 64px;
  color: #64748b;
  font-size: 0.85rem;
  text-align: center;
}

.row-col.rating {
  flex: 0 0 64px;
  color: #ffd166;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
}

.row-col.status {
  flex: 1 1 200px;
  color: #94a3b8;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-col.airing {
  flex: 1 1 220px;
  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #00d4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-msg {
  color: #64748b;
  font-size: 0.9rem;
  padding: 20px 0;
}

/* ---------- Table header row ---------- */

.row-header {
  background: transparent;
  border: none;
  border-bottom: 2px solid #1e293b;
  border-radius: 0;
  padding: 6px 16px 10px;
}

.row-header:hover {
  background: transparent;
  border-color: #1e293b;
  transform: none;
}

.row-header .row-col {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.row-poster-head {
  background: transparent !important;
}

/* ---------- Section-header gear icon ---------- */

.column-order-btn {
  background: #0a0a0f;
  border: 1px solid #1e293b;
  color: #64748b;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: color 0.2s, border-color 0.2s;
}

.column-order-btn:hover {
  color: #00d4ff;
  border-color: #00d4ff;
}

/* ---------- Column-order modal ---------- */

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

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: #16161f;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 24px 26px;
  max-width: 420px;
  width: 100%;
  color: #e0e0e0;
  font-family: "Heebo", sans-serif;
}

.modal h3 {
  margin: 0 0 8px;
  font-weight: 900;
}

.modal-hint {
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.column-order-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.column-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a0a0f;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.column-order-controls {
  display: flex;
  gap: 6px;
}

.icon-btn.small {
  background: #16161f;
  border: 1px solid #1e293b;
  color: #e0e0e0;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.icon-btn.small:hover {
  border-color: #00d4ff;
}

.icon-btn.small:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-primary,
.btn-secondary {
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: "Heebo", sans-serif;
}

.btn-primary {
  background: #0d6efd;
  color: white;
}

.btn-primary:hover {
  background: #00d4ff;
  color: #0a0a0f;
}

.btn-secondary {
  background: #16161f;
  color: #e0e0e0;
  border: 1px solid #1e293b;
}

.btn-secondary:hover {
  border-color: #64748b;
}

@media (max-width: 640px) {
  .row {
    flex-wrap: wrap;
  }
  .row-header {
    display: none; /* header labels don't fit well on mobile; rows are still labeled visually via icons */
  }
  .row-col.status,
  .row-col.title {
    flex-basis: 100%;
  }
}
