/* ==========================================================================
   TEMA "ABERTO E ESPAÇOSO"
   Usado por index.php e post.php (carregado depois do Bootstrap).
   Para trocar cores/tamanhos, mexa primeiro nas variáveis logo abaixo.
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;

  --nav: #0f172a;
  --nav-2: #1e293b;
  --nav-line: #334155;

  --accent: #f59e0b;
  --accent-2: #f97316;
  --accent-ink: #b45309;
  --green: #10b981;
  --blue: #2563eb;

  --radius: 16px;
  --wrap: 1344px;
  --nav-h: 61px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-head: 'Outfit', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
a:hover { text-decoration: none; }
img { max-width: 100%; }

h1, h2, h3, h4 { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--nav);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 8px 24px -16px rgba(0, 0, 0, .5);
}

.site-nav {
  min-height: var(--nav-h);
  padding: 0;
  background: transparent;
}

.site-nav .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.site-nav .navbar-brand {
  margin: 0 20px 0 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
}
.site-nav .navbar-brand img { display: block; height: 36px; width: auto; }

.site-nav .navbar-toggler {
  margin-left: auto;
  border: 1px solid var(--nav-line);
  padding: 6px 10px;
}
.site-nav .navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(245, 158, 11, .25); }

.site-nav .navbar-collapse { align-items: center; gap: 12px; }

.site-nav .navbar-nav { gap: 2px; }

.site-nav .nav-link {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.site-nav .nav-link:hover,
.site-nav .nav-link:focus,
.site-nav .nav-link.show { color: #fff; }
.site-nav .nav-link.active { color: var(--accent); }
.site-nav .dropdown-toggle::after { margin-left: .45em; vertical-align: .2em; border-width: .3em .3em 0; }

.site-nav .dropdown-menu {
  margin-top: 6px;
  min-width: 220px;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  padding: 8px;
  background: #111a2e;
  border: 1px solid var(--nav-2);
  border-radius: 14px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .55);
}
.site-nav .dropdown-item {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}
.site-nav .dropdown-item:hover,
.site-nav .dropdown-item:focus { background: var(--nav-2); color: #fff; }
.site-nav .dropdown-divider { border-color: var(--nav-2); margin: 6px 4px; }

/* Busca */
.nav-search {
  position: relative;
  flex: 0 1 253px;
  min-width: 180px;
}
.nav-search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 18px;
  border-radius: 999px;
  border: 1px solid var(--nav-line);
  background: var(--nav-2);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 14px;
}
.nav-search input::placeholder { color: #94a3b8; }
.nav-search input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .2);
}
.nav-search button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
}

/* Botão Entrar */
.btn-entrar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #14c99a, #22d3a5);
  color: #042f24;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 6px 18px -4px rgba(16, 185, 129, .55);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-entrar:hover { color: #042f24; transform: translateY(-1px); box-shadow: 0 10px 22px -4px rgba(16, 185, 129, .6); }

/* Menu recolhido (celular / tablet) */
@media (max-width: 1199.98px) {
  .site-nav .navbar-collapse { padding: 8px 0 18px; }
  .site-nav .navbar-nav { margin-bottom: 12px; }
  .site-nav .dropdown-menu { position: static !important; transform: none !important; max-height: 300px; margin: 4px 0 8px; }
  .nav-search { flex: 1 1 auto; width: 100%; max-width: none; }
  .btn-entrar { margin-top: 12px; width: 100%; }
  .site-nav .navbar-collapse { flex-direction: column; align-items: stretch; }
}

/* ---------- Títulos de seção (com barrinha laranja) ---------- */
.sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.25;
  color: var(--ink);
}
.sec-title::before {
  content: "";
  flex: none;
  width: 4px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.sec-title--lg { font-size: 24px; }
.sec-title--lg::before { height: 26px; }

/* ==========================================================================
   PÁGINA DO FILME (post.php)
   ========================================================================== */

/* Migalhas de pão */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 24px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.crumbs a { color: var(--muted); transition: color .15s ease; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: #cbd5e1; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 700; }

/* Cabeçalho do filme */
.post-head {
  text-align: center;
  padding: 19px 0 24px;
  border-bottom: 1px solid var(--line);
}
.post-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(25px, 4vw, 30px);
  letter-spacing: -.01em;
  line-height: 1.15;
  margin: 0 0 8px;
  text-wrap: balance;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 10px;
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted);
}
.post-meta span + span::before { content: "·"; margin-right: 10px; color: #94a3b8; }
.post-updated {
  margin-top: 4px;
  line-height: 1.4;
  font-size: 11.5px;
  color: var(--muted);
}
.post-updated i { margin-right: 4px; }

/* Grade: conteúdo + barra lateral */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 196px;
  gap: 24px;
  align-items: start;
  padding: 24px 0 80px;
}

/* Pôster + informações */
.detail {
  display: grid;
  grid-template-columns: 302px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.poster {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: 0 22px 44px -16px rgba(15, 23, 42, .45);
}
.poster img {
  display: block;
  width: 100%;
  aspect-ratio: 298 / 442;
  object-fit: cover;
}

/* Etiqueta de classificação indicativa */
.age {
  position: absolute;
  top: 11px;
  left: 11px;
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  background: #fbbf24;
  color: #0f172a;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .4);
}
.age-l  { background: #22c55e; color: #052e16; }
.age-10 { background: #3b82f6; color: #fff; }
.age-12 { background: #fbbf24; color: #0f172a; }
.age-14 { background: #f97316; color: #fff; }
.age-16 { background: #ef4444; color: #fff; }
.age-18 { background: #111827; color: #fff; }

.btn-trailer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-trailer i { color: var(--accent); font-size: 17px; }
.btn-trailer:hover { background: #1e293b; transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(15, 23, 42, .6); }

/* Ficha técnica */
.spec { margin: 0; }
.spec-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 9.5px 0;
  border-bottom: 1px dashed var(--line);
  line-height: 19px;
}
.spec-row:last-child { border-bottom: 0; }
.spec dt {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.spec dd a { color: var(--accent); font-weight: 700; }
.spec dd a:hover { color: var(--accent-2); }
.spec .imdb-nota { color: var(--accent); font-weight: 700; }

/* Selos de qualidade */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  box-shadow: 0 3px 8px -3px rgba(37, 99, 235, .6);
}
.tag:nth-child(n+3) {
  background: #e2e8f0;
  color: var(--accent-ink);
  box-shadow: none;
}

/* Blocos com linha separadora */
.block {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.detail-info .block:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.synopsis {
  margin: 0;
  font-size: 15.2px;
  line-height: 1.85;
  color: var(--ink-2);
}

/* Downloads */
.dl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -20px rgba(15, 23, 42, .25);
}
.dl-summary {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--muted);
}
.dl-summary strong { color: var(--ink); font-weight: 700; }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.dl-option {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}
.dl-option h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
}
.dl-option h3 i { color: var(--accent); }

.btn-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-dl:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.05); }
.btn-dl--green { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 10px 20px -10px rgba(16, 185, 129, .8); }
.btn-dl--blue  { background: linear-gradient(135deg, #1d4ed8, #3b82f6); box-shadow: 0 10px 20px -10px rgba(37, 99, 235, .8); }

.dl-sub {
  margin: 24px 0 12px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
}
.dl-sub:first-child { margin-top: 0; }

.ep-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  margin: 0;
  padding: 0 4px 0 0;
  list-style: none;
  overflow-y: auto;
}
.ep-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-weight: 600;
}
.ep-list li span i { color: var(--accent); margin-right: 8px; }
.ep-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.ep-list a:hover { color: #fff; filter: brightness(1.06); }

/* Relacionados */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}
.rel-item { display: block; }
.rel-item .thumb {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: 0 10px 24px -12px rgba(15, 23, 42, .45);
  transition: transform .25s ease, box-shadow .25s ease;
}
.rel-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rel-item:hover .thumb { transform: translateY(-4px); box-shadow: 0 18px 32px -14px rgba(15, 23, 42, .5); }
.rel-item .nome {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-2);
}
.rel-item:hover .nome { color: var(--ink); }

/* Barra lateral de gêneros */
.side-title {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.side-list li + li { border-top: 1px solid var(--line); }
.side-list a {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease, padding .15s ease;
}
.side-list a:hover { background: #fff7ed; color: var(--accent-ink); padding-left: 18px; }
.side-list a.is-current { background: #fff7ed; color: var(--accent-ink); font-weight: 700; }

/* Modal do trailer */
.modal-backdrop.show { background-color: #000 !important; opacity: .92 !important; }
.modal-content.trailer { background: #0b1120; color: #fff; border: 1px solid var(--nav-2); border-radius: 18px; overflow: hidden; }

/* ==========================================================================
   LISTAGEM (index.php)
   ========================================================================== */
.page { padding-top: 36px; padding-bottom: 80px; }

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.list-head .sec-title { margin: 0; }
.list-count { font-size: 13px; font-weight: 600; color: var(--muted); }
.list-sub { margin: -10px 0 26px; color: var(--muted); font-size: 14px; }
.list-sub strong { color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 34px 24px;
}

.card-movie__link { display: block; color: inherit; }
.card-movie__link:hover { color: inherit; }

.card-movie__poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: 0 12px 26px -12px rgba(15, 23, 42, .45);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card-movie__poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.card-movie__link:hover .card-movie__poster,
.card-movie__link:focus-visible .card-movie__poster {
  transform: translateY(-5px);
  box-shadow: 0 22px 38px -14px rgba(15, 23, 42, .5);
}
.card-movie__link:hover img { transform: scale(1.06); }

.pill {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .82);
  backdrop-filter: blur(4px);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

.card-movie__hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(to top, rgba(15, 23, 42, .94) 0%, rgba(15, 23, 42, .6) 55%, rgba(15, 23, 42, 0) 100%);
  color: #e2e8f0;
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  transition: opacity .25s ease;
}
.card-movie__link:hover .card-movie__hover,
.card-movie__link:focus-visible .card-movie__hover { opacity: 1; }
.card-movie__hover .idioma {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #1f1300;
  font-size: 11px;
  font-weight: 800;
}
.card-movie__hover p { margin: 0; }

.card-movie__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 14px 2px 6px;
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.005em;
}
.card-movie__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.card-movie__meta .imdb-nota { color: var(--accent-ink); }
.card-movie__meta .imdb-nota i { color: var(--accent); margin-right: 3px; }

.vazio {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 18px;
  font-weight: 500;
}

/* Paginação */
.pagination {
  --bs-pagination-padding-x: 0;
  --bs-pagination-padding-y: 0;
  gap: 6px;
  margin-top: 48px;
}
.pagination .page-link {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: none;
}
.pagination .page-link:hover { background: #fff7ed; color: var(--accent-ink); border-color: #fed7aa !important; }
.pagination .page-item.active .page-link { background: var(--ink); border-color: var(--ink) !important; color: #fff; }

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */
@media (max-width: 1199.98px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }

  .layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }

  /* Gêneros viram "chips" abaixo do conteúdo */
  .side-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .side-list li + li { border-top: 0; }
  .side-list a,
  .side-list a:hover {
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
  }
  .rel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .wrap { padding: 0 16px; }

  .detail { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .detail-poster { width: min(280px, 100%); margin: 0 auto; }

  .spec-row { grid-template-columns: 128px minmax(0, 1fr); gap: 12px; }
  .synopsis { font-size: 15.5px; }
  .dl-card { padding: 18px; }

  .post-head { padding: 18px 0 22px; }
  .page { padding-top: 24px; padding-bottom: 64px; }
  .sec-title--lg { font-size: 21px; }
}

@media (max-width: 575.98px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .rel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
  .rel-item:nth-child(5) { display: none; } /* evita item sozinho na última linha */
  .card-movie__title { font-size: 13.5px; }
  .spec dt { font-size: 11.5px; }
  .spec dd { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
