/* ── Header filter controls (page-size pills + refresh) ─────────────────── */

.missing-filter-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.missing-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

html.dark .missing-refresh-btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.38);
}

.missing-refresh-btn:hover {
  background: rgba(99, 145, 210, 0.12);
  border-color: rgba(99, 145, 210, 0.4);
  color: var(--tcm-blue-color);
}

.missing-refresh-btn i.icon {
  margin: 0;
  font-size: 0.82em;
}

/* ── Panel body — no extra padding, rows handle their own spacing ─────────── */

.missing-panel > section {
  padding: 0;
}

.missing-panel > section .ui.pagination.menu {
  /* padding: 0.75rem 0;
  display: flex;
  justify-content: center; */
}

/* ── Header count badge (in .settings-panel-header) ─────────────────────── */

.missing-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25em;
  min-width: 1.8em;
  padding: 0.15em 0.5em;
  font-size: 0.85em;
  font-weight: 700;
  background: rgba(99, 145, 210, 0.15);
  color: var(--tcm-blue-color);
  border-radius: 20px;
  letter-spacing: 0;
  text-transform: none;
}

/* ── Series row (shared by missing-cards and unloaded-cards) ─────────────── */

.missing-series-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

html.dark .missing-series-row {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.missing-series-row:last-child {
  border-bottom: none;
}

.missing-series-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.missing-series-header:hover {
  background: rgba(0, 0, 0, 0.025);
}

html.dark .missing-series-header:hover {
  background: rgba(255, 255, 255, 0.025);
}

.missing-series-poster {
  width: 34px;
  height: 51px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.08);
}

.missing-series-name {
  font-size: 0.95em;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.82);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.dark .missing-series-name {
  color: rgba(255, 255, 255, 0.87);
}

.missing-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2em;
  padding: 0.2em 0.55em;
  font-size: 0.78em;
  font-weight: 700;
  background: rgba(99, 145, 210, 0.12);
  color: var(--tcm-blue-color);
  border-radius: 20px;
  flex-shrink: 0;
  letter-spacing: 0;
}

/* ── Expand / Load buttons ───────────────────────────────────────────────── */

.missing-expand-btn,
.missing-load-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-size: 0.8em;
  font-weight: 600;
}

.missing-expand-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.4);
}

html.dark .missing-expand-btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.35);
}

.missing-expand-btn:hover {
  background: rgba(99, 145, 210, 0.12);
  border-color: rgba(99, 145, 210, 0.4);
  color: var(--tcm-blue-color);
}

.missing-expand-btn i.icon {
  margin: 0;
  font-size: 0.9em;
}

.missing-load-btn {
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(99, 145, 210, 0.35);
  background: rgba(99, 145, 210, 0.1);
  color: var(--tcm-blue-color);
}

.missing-load-btn:hover {
  background: rgba(99, 145, 210, 0.2);
  border-color: var(--tcm-blue-color);
}

.missing-load-btn i.icon {
  margin: 0 0.2em 0 0;
  font-size: 0.9em;
}

/* ── Expandable episode-pills panel (missing cards) ──────────────────────── */

.missing-episodes-panel,
.missing-cards-panel {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.8rem 1rem 0.9rem;
  background: rgba(0, 0, 0, 0.02);
}

html.dark .missing-episodes-panel,
html.dark .missing-cards-panel {
  border-top-color: rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.18);
}

.missing-episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.missing-episode-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  padding: 0.28em 0.65em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.055);
  border: 1px solid rgba(0, 0, 0, 0.085);
  font-size: 0.82em;
  line-height: 1.4;
  transition: background 0.12s, border-color 0.12s;
}

html.dark .missing-episode-pill {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.09);
}

.missing-episode-pill:hover {
  background: rgba(99, 145, 210, 0.1);
  border-color: rgba(99, 145, 210, 0.3);
}

.missing-episode-code {
  font-weight: 700;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.92em;
  color: var(--tcm-blue-color);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.missing-episode-title {
  color: rgba(0, 0, 0, 0.58);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.dark .missing-episode-title {
  color: rgba(255, 255, 255, 0.48);
}

/* ── Expandable card-thumbnail grid (unloaded cards) ─────────────────────── */

.missing-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 0.55rem;
}

.missing-card-thumb {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

.missing-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.missing-card-thumb:hover img {
  transform: scale(1.03);
}

.missing-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.22em 0.5em;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  font-size: 0.74em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.05em;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* ── Missing Logos list ──────────────────────────────────────────────────── */

.missing-logos-list {
  display: flex;
  flex-direction: column;
}

.missing-logo-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  cursor: pointer;
}

html.dark .missing-logo-item {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.missing-logo-item:last-child {
  border-bottom: none;
}

.missing-logo-item:hover {
  background: rgba(0, 0, 0, 0.025);
  color: inherit;
}

html.dark .missing-logo-item:hover {
  background: rgba(255, 255, 255, 0.025);
}

.missing-logo-name {
  font-size: 0.95em;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.82);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.dark .missing-logo-name {
  color: rgba(255, 255, 255, 0.87);
}

.missing-logo-file {
  font-size: 0.8em;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  color: rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  padding: 0.2em 0.5em;
  flex-shrink: 0;
}

html.dark .missing-logo-file {
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ── Loading state ───────────────────────────────────────────────────────── */

.missing-loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 2rem;
  font-size: 0.9em;
  color: rgba(0, 0, 0, 0.35);
}

html.dark .missing-loading-state {
  color: rgba(255, 255, 255, 0.3);
}

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

.missing-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  gap: 0.5rem;
}

.missing-empty-state > i.icon {
  font-size: 2.5em !important;
  color: var(--tcm-blue-color);
  opacity: 0.22;
  margin: 0 0 0.25rem !important;
  display: block;
}

.missing-empty-title {
  font-size: 1em;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.45);
}

html.dark .missing-empty-title {
  color: rgba(255, 255, 255, 0.4);
}

.missing-empty-desc {
  font-size: 0.86em;
  color: rgba(0, 0, 0, 0.3);
  max-width: 300px;
  line-height: 1.55;
}

html.dark .missing-empty-desc {
  color: rgba(255, 255, 255, 0.25);
}

.missing-empty-desc a {
  color: var(--tcm-blue-color);
  text-decoration: none;
}

.missing-empty-desc a:hover {
  text-decoration: underline;
}
