/* =========================================================
   /catalog — lista paginada de uma categoria
   ========================================================= */

:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #000;
  color: #f5f5f7;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  scrollbar-width: none;
}
body::-webkit-scrollbar {
  display: none;
}

/* ------------------------------ topo ----------------------------------- */

.cat-top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 16px 24px 18px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.72) 64%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cat-top-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  min-height: 42px;
}

/* Mesmo visual do botão "Voltar para o catálogo" do player. */
.cat-back {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.cat-back:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(-2px);
}

.cat-back:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
}

.cat-head {
  min-width: 0;
  padding: 0 120px;
  text-align: center;
}

.cat-title {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.15;
}

.cat-sub {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ------------------------------- grid ---------------------------------- */

.cat-main {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 10px 24px 40px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px 16px;
  padding-top: 8px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  transition: transform 0.22s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
}

.cat-card:hover .cat-poster img {
  filter: brightness(1.1);
}

.cat-card:focus-visible .cat-poster {
  outline: 1px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.cat-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: #1a1d24;
}

.cat-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s ease;
}

.cat-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cat-badge.is-tv {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.45);
}

.cat-badge.is-movie {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
}

.cat-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 8px;
}

.cat-name {
  overflow: hidden;
  color: #f3f4f6;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-meta {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 500;
}

/* ------------------------------ estados -------------------------------- */

.cat-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 280px;
  padding: 48px 16px;
  text-align: center;
}

.cat-spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: catSpin 0.8s linear infinite;
}

@keyframes catSpin {
  to {
    transform: rotate(360deg);
  }
}

.cat-state-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 12.5px;
}

.cat-retry {
  margin-top: 4px;
  padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cat-retry:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cat-empty {
  padding: 72px 16px 30px;
  text-align: center;
}

.cat-empty-title {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  font-weight: 600;
}

.cat-empty-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
}

/* ---------------------------- paginação -------------------------------- */

.cat-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 42px 0 46px;
}

.cat-pager-nums {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
}

.pager-arrow,
.pager-num {
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.52);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.pager-num {
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
}

.pager-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 13px;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.pager-num:hover,
.pager-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.pager-num.is-active {
  border-color: #fff;
  background: #fff;
  color: #000;
  cursor: default;
}

.pager-gap {
  padding: 0 3px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 12px;
  user-select: none;
}

.pager-arrow:disabled,
.pager-num:disabled {
  opacity: 0.32;
  cursor: default;
}

.pager-arrow:disabled:hover,
.pager-num:disabled:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.52);
}

.pager-num.is-active:disabled {
  opacity: 1;
  background: #fff;
  color: #000;
}

.pager-arrow:focus-visible,
.pager-num:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

/* ------------------------------- mobile -------------------------------- */

@media (max-width: 760px) {
  .cat-top {
    padding: 62px 16px 14px;
  }

  .cat-top-inner {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 0;
  }

  .cat-back {
    left: 16px;
    top: 14px;
  }

  .cat-head {
    width: 100%;
    padding: 0;
  }

  .cat-title {
    font-size: 24px;
  }

  .cat-main {
    padding: 4px 16px 24px;
  }

  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 20px 11px;
    padding-top: 4px;
  }

  .cat-name {
    font-size: 12px;
  }

  .cat-meta {
    font-size: 10.5px;
  }

  .cat-pager {
    padding: 30px 0 34px;
    gap: 5px;
  }

  .pager-arrow {
    padding: 0 10px;
    font-size: 11.5px;
  }
}

@media (max-width: 380px) {
  .pager-arrow .pager-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cat-card,
  .cat-poster img,
  .cat-back,
  .pager-arrow,
  .pager-num,
  .cat-spinner {
    transition: none;
    animation: none;
  }

  .cat-card:hover {
    transform: none;
  }
}