/* --- Estilos da Navegação Adicional --- */
.main-nav {
    width: 100%;
    text-align: center;
    margin-top: 1.5rem;
}

.main-nav a {
    background: var(--cor-secundaria);
    color: var(--cor-texto);
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.main-nav a:hover {
    background: var(--cor-primaria);
}

/* --- Estilos da Grade de Itens Assistidos --- */
#watched-grid {
    display: grid;
    /* Layout responsivo: 1 coluna em telas pequenas, aumentando conforme a tela cresce */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 1rem;
    max-width: 1400px; /* Limita a largura máxima da grade */
    margin: 0 auto; /* Centraliza a grade */
}

.watched-item {
    background-color: var(--cor-fundo-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.watched-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

.watched-item .poster-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3; /* Proporção de poster */
}

.watched-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.watched-item .nota {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--cor-primaria);
    font-size: 1.4em;
    font-weight: bold;
    padding: 0.5rem 0.8rem;
    border-radius: 50%;
    border: 2px solid var(--cor-primaria);
    min-width: 50px;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.watched-item .info-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Faz este container ocupar o espaço restante */
}

.watched-item h2 {
    font-size: 1.5em;
    margin-bottom: 1rem;
    color: var(--cor-primaria);
}

.watched-item .comentario {
    font-style: italic;
    color: #ccc;
    line-height: 1.6;
    border-left: 3px solid var(--cor-secundaria);
    padding-left: 1rem;
    margin: 0;
    flex-grow: 1; /* Ocupa o espaço disponível, alinhando títulos */
}

.no-items-message {
    grid-column: 1 / -1; /* Ocupa todas as colunas da grade */
    text-align: center;
    font-size: 1.2em;
    color: #888;
}




/* Acessibilidade: sr-only */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Toolbar */
.watched-toolbar {
  margin: 1rem auto 0;
  max-width: 1200px;
  padding: 0 1rem;
}

.watched-toolbar .toolbar-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.75rem;
}

#filter-category, #search-box {
  background: var(--cor-fundo-card);
  color: var(--cor-texto);
  border: 1px solid var(--cor-borda, #444);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  outline: none;
}

#search-box::placeholder { opacity: .7; }

/* Responsivo */
@media (max-width: 640px) {
  .watched-toolbar .toolbar-row {
    grid-template-columns: 1fr;
  }
}




/* --- 8. Barra de Navegação Superior --- */

.top-nav {
    background-color: #0a0a0a; /* Um preto um pouco mais suave que o fundo */
    border-bottom: 2px solid var(--cor-secundaria);
    padding: 0.8rem 1rem;
    width: 100%;
    position: sticky; /* Faz a barra ficar fixa no topo ao rolar a página */
    top: 0;
    z-index: 100; /* Garante que a barra fique acima de outros elementos */
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center; /* Centraliza os links */
    align-items: center;
    gap: 2rem; /* Espaçamento entre os links */
}

.top-nav a {
    /* color: var(--cor-texto); */
    text-decoration: none;
    font-size: 1.1em;
    font-weight: bold;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.top-nav a:hover {
    color: var(--cor-primaria);
}

/* Efeito de sublinhado animado no link */
.top-nav a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--cor-primaria);
    bottom: 0;
    left: 0;
    transform: scaleX(0); /* Começa invisível */
    transform-origin: center;
    transition: transform 0.3s ease;
}

.top-nav a:hover::after {
    transform: scaleX(1); /* Aparece ao passar o mouse */
}



/* Barra superior unificada com o tema da index 
.top-nav, header .header-main {
  background: var(--cor-primaria, #111827);
  color: var(--texto-primario, #ffffff);
}
.top-nav a, header .header-main a {
  color: var(--texto-primario, #ffffff);
}

*/

/* Botão "assista" posicionando entre imagem e título */
.btn-assista--inline {
  display: inline-block;
  margin: 8px 0 6px;
}


/* === Botão "assista" estilizado === */
.watched-item .info-container .btn-assista {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--cor-primaria);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  border: none;
}

.watched-item .info-container .btn-assista:hover,
.watched-item .info-container .btn-assista:focus {
  opacity: 0.92;
  text-decoration: none;
}

.watched-item .info-container .btn-assista--inline {
  margin: 10px 0 8px;
}


/* === Botão "assista" como overlay na imagem === */
.watched-item .poster-container { position: relative; }

.watched-item .poster-container .btn-assista.btn-assista--overlay {
  position: absolute;
  bottom: 8px;
  left: 15%;
  transform: translateX(-50%);
  display: inline-block;
  padding: 6px 10px;          /* compacto: tamanho do texto com margens */
  border-radius: 8px;
  background: var(--cor-primaria);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  line-height: 1;
  border: none;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}

.watched-item .poster-container .btn-assista.btn-assista--overlay:hover,
.watched-item .poster-container .btn-assista.btn-assista--overlay:focus {
  opacity: .95;
  text-decoration: none;
}


/* ===== NOVO LAYOUT ASSISTIDOS (estilo LunaFlix) ===== */

.assistidos-page {
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 0 1rem 3rem;
}

/* Barra rosa do topo */
.assistidos-hero {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.assistidos-hero-inner {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  border-radius: 18px;
  background: var(--cor-primaria);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.assistidos-hero-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
}

.hero-logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.assistidos-hero-search {
  flex: 0 0 45%;
}

.assistidos-hero-search input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: none;
  outline: none;
  background: rgba(0,0,0,0.18);
  color: #fff;
  font-size: 0.95rem;
}

.assistidos-hero-search input::placeholder {
  color: rgba(255,255,255,0.8);
}

/* Layout em duas colunas */

.assistidos-layout {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.7fr);
  gap: 1.5rem;
}

/* Painel de detalhes à esquerda */

.assistidos-detail {
  background: rgba(10,10,10,0.85);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
  min-height: 360px;
}

.detail-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  text-align: center;
}

.detail-card-inner {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
}

.detail-poster {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
}

.detail-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}

.detail-rating-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #ffb300;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.badge-tipo {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.16);
}

.badge-tipo--lg {
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.detail-tags .tag {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  font-size: 0.75rem;
}

.detail-comment {
  margin-top: 0.25rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.detail-comment-empty {
  opacity: 0.7;
  font-style: italic;
}

.detail-actions {
  margin-top: 0.75rem;
}

.detail-actions .btn-assista {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: none;
  background: var(--cor-primaria);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

/* Coluna direita: lista */

.assistidos-sidebar-card {
  background: rgba(10,10,10,0.9);
  border-radius: 18px;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 540px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.sidebar-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.sidebar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.78rem;
  opacity: 0.9;
}

.stat-pill {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
}

.sidebar-filters {
  margin-top: 0.25rem;
}

.sidebar-filters select {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(20,20,20,0.9);
  color: var(--cor-texto);
  font-size: 0.9rem;
}

/* Lista em si */

.assistidos-list {
  margin-top: 0.6rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.assistidos-list .loader {
  margin: 1.5rem auto;
}

.empty-state {
  margin: 1.5rem 0;
  text-align: center;
  opacity: 0.7;
  font-size: 0.9rem;
}

.watched-list-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.45rem 0.4rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.watched-list-item:hover,
.watched-list-item:focus-visible {
  background: rgba(255,255,255,0.06);
  outline: none;
}

.watched-list-item--active {
  background: rgba(255,255,255,0.12);
}

.list-thumb img,
.thumb-placeholder {
  width: 42px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: #111;
}

.list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.list-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.list-meta-row {
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.list-comentario-preview {
  font-size: 0.8rem;
  opacity: 0.8;
  max-height: 2.4em;
  overflow: hidden;
}

/* Responsivo */

@media (max-width: 900px) {
  .assistidos-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-card-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .assistidos-sidebar-card {
    max-height: none;
  }
}

@media (max-width: 700px) {
  .assistidos-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .assistidos-hero-search {
    width: 100%;
    flex-basis: auto;
  }
}


/* ================== NEVE / CORAÇÕES CAINDO ================== */
.snow {
    pointer-events: none;
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 9999;
}

.snowflake {
    position: absolute;
    top: -10vh;
    will-change: transform;
    animation-name: snow-fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes snow-fall {
    0% {
        transform: translate3d(0, -10vh, 0);
    }
    100% {
        transform: translate3d(0, 110vh, 0);
    }
}
