@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #141414;
  color: #fff;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

/* ====== HEADER ====== */
header {
  background: #000;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #222;
}

.logo {
  color: #e50914;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 2px;
}

nav {
  display: flex;
  gap: 0.25rem;
}

nav button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

nav button:hover { color: #fff; background: #1a1a1a; }
nav button.active { color: #fff; border-bottom: 2px solid #e50914; }

/* ====== BUSCA ====== */
.search-wrap {
  display: flex;
  align-items: center;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 5px 14px;
  gap: 8px;
  transition: border-color 0.2s;
}

.search-wrap:focus-within { border-color: #666; }

.search-wrap input {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  width: 180px;
}

.search-wrap input::placeholder { color: #666; }

/* ====== LOGIN BOX (header) ====== */
#login-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-entrar {
  background: #e50914;
  border: none;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-entrar:hover { background: #b8070f; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid #333;
  border-radius: 20px;
  padding: 4px 12px 4px 5px;
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e50914;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-chip-nome {
  font-size: 0.82rem;
  font-weight: 500;
  color: #eee;
}

.btn-sair {
  background: none;
  border: none;
  color: #666;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 4px;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s;
}
.btn-sair:hover { color: #e50914; }

/* ====== MODAL LOGIN ====== */
#login-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(6px);
}
#login-modal-overlay.open { display: flex; }

#login-modal {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  position: relative;
  animation: modalIn 0.22s ease;
}

#login-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #aaa;
  font-size: 1.1rem;
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
#login-modal-close:hover { background: #e50914; color: #fff; }

.login-modal-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid #222;
}

.login-logo {
  color: #e50914;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 3px;
  margin-bottom: 0.4rem;
}

.login-modal-header p {
  font-size: 0.85rem;
  color: #777;
}

.login-modal-body {
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.login-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-field input {
  background: #111;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-field input:focus {
  border-color: #e50914;
  box-shadow: 0 0 0 2px rgba(229,9,20,0.18);
}

.login-error {
  font-size: 0.8rem;
  color: #e57373;
  min-height: 1rem;
}

#lm-entrar-btn {
  background: #e50914;
  border: none;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
#lm-entrar-btn:hover { background: #b8070f; }

.login-hint {
  font-size: 0.78rem;
  color: #555;
  text-align: center;
  line-height: 1.5;
}

/* ====== PAGE TITLE ====== */
#page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 1px;
  padding: 1.5rem 2rem 0.25rem;
  color: #fff;
}

/* ====== SECTION LABEL ====== */
.section-label {
  font-size: 1rem;
  font-weight: 600;
  color: #e5e5e5;
  padding: 1.4rem 2rem 0.5rem;
}

/* ====== GRID ====== */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0.5rem 2rem;
}

.grid .movie-card {
  width: 150px;
  flex-shrink: 0;
}

/* ====== CARD ====== */
.movie-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #1c1c1c;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
  z-index: 2;
}

/* Poster (parte de cima) */
.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: #2a2a2a;
  flex-shrink: 0;
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.movie-card:hover .card-poster img {
  transform: scale(1.04);
}

.placeholder-img {
  width: 100%;
  height: 100%;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #444;
}

/* Info (parte de baixo) */
.card-info {
  padding: 8px 10px 10px;
  background: #1c1c1c;
  border-radius: 0 0 8px 8px;
  flex: 1;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-date {
  font-size: 0.72rem;
  color: #888;
  line-height: 1.3;
}

/* overlay removido — substituído por card-info */
.card-overlay { display: none; }

/* ====== FAV BUTTON ====== */
.fav-btn {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0, 0, 0, 0.65);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  opacity: 0;
  color: #fff;
}

.movie-card:hover .fav-btn { opacity: 1; }
.fav-btn:hover { transform: scale(1.2); border-color: rgba(255,255,255,0.5); }
.fav-btn.active {
  background: #e50914;
  border-color: #e50914;
  opacity: 1;
}

/* ====== EMPTY STATE ====== */
.empty-state {
  text-align: center;
  color: #666;
  padding: 5rem 2rem;
  font-size: 1rem;
}

.empty-state span {
  display: block;
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ====== LOADING ====== */
.loading {
  display: flex;
  gap: 8px;
  padding: 3rem;
  justify-content: center;
  align-items: center;
}

.dot {
  width: 9px; height: 9px;
  background: #e50914;
  border-radius: 50%;
  animation: bounce 0.9s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* ====== MODAL FILME ====== */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

#modal-overlay.open { display: flex; }

#modal {
  background: #1a1a1a;
  border-radius: 10px;
  width: 100%;
  max-width: 860px;
  position: relative;
  animation: modalIn 0.25s ease;
  margin: auto;
}

@keyframes modalIn {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

#modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}

#modal-close:hover { background: #e50914; }

#modal-trailer {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

#modal-trailer iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.modal-no-trailer {
  width: 100%;
  aspect-ratio: 16/9;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 0.9rem;
  gap: 0.5rem;
  border-radius: 10px 10px 0 0;
}

.modal-no-trailer span { font-size: 2.5rem; }

#modal-body {
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
}

#modal-poster {
  flex-shrink: 0;
  width: 110px;
  border-radius: 6px;
  overflow: hidden;
  background: #222;
  align-self: flex-start;
}

#modal-poster img { width: 100%; display: block; }

#modal-info { flex: 1; }

#modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
  color: #fff;
  line-height: 1.2;
}

#modal-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.modal-badge {
  background: #2a2a2a;
  border: 1px solid #333;
  color: #aaa;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
}

.modal-badge.rating {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
  font-weight: 600;
}

#modal-overview {
  font-size: 0.875rem;
  line-height: 1.7;
  color: #bbb;
  margin-bottom: 1.1rem;
}

#modal-fav-btn {
  background: none;
  border: 1.5px solid #e50914;
  color: #e50914;
  font-size: 0.85rem;
  padding: 7px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: 'Inter', sans-serif;
}

#modal-fav-btn:hover,
#modal-fav-btn.active {
  background: #e50914;
  color: #fff;
}

/* ====== AVALIAÇÕES (dentro do modal) ====== */
#avaliacoes {
  padding: 0 1.5rem 2rem;
  border-top: 1px solid #252525;
  margin-top: 0.5rem;
  padding-top: 1.5rem;
}

.av-form-card,
.av-lista-card {
  background: #141428;
  border: 1px solid #2e2e4d;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.av-form-card h3,
.av-lista-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}

.av-form-card textarea {
  width: 100%;
  background: #0e0e22;
  border: 1px solid #2e2e4d;
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 14px;
  font-family: inherit;
  color: #eee;
  height: 70px;
  resize: none;
  margin-top: 10px;
}

.av-form-card textarea:focus {
  outline: none;
  border-color: #7c6ff7;
  box-shadow: 0 0 0 2px rgba(124,111,247,0.2);
}

.av-estrelas {
  display: flex;
  gap: 4px;
  margin: 4px 0;
}

.av-estrelas button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 28px;
  color: #333;
  padding: 0;
  line-height: 1;
  transition: transform 0.1s;
}

.av-estrelas button.ativa {
  color: #EF9F27;
  transform: scale(1.15);
}

#av-hint {
  font-size: 12px;
  color: #666;
  display: block;
  margin-bottom: 2px;
}

#av-btn {
  margin-top: 12px;
  background: #7c6ff7;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  display: block;
}

#av-btn:hover  { background: #5a50c8; }
#av-btn:disabled { opacity: 0.4; cursor: default; }

#av-login-aviso p {
  font-size: 13px;
  color: #888;
}

#av-login-aviso a {
  color: #7c6ff7;
  text-decoration: none;
  font-weight: 600;
}
#av-login-aviso a:hover { text-decoration: underline; }

/* Resumo */
.av-resumo-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #2e2e4d;
}

.av-media { font-size: 36px; font-weight: 700; color: #fff; line-height: 1; }
.av-media-sub { font-size: 12px; color: #666; margin-top: 5px; }
.av-barras { flex: 1; }

.av-barra-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #777;
  margin-bottom: 4px;
}

.av-barra-track {
  flex: 1;
  height: 5px;
  background: #2e2e4d;
  border-radius: 3px;
  overflow: hidden;
}

.av-barra-fill {
  height: 100%;
  background: #ef9f27;
  border-radius: 3px;
  transition: width 0.4s;
}

/* Cards de avaliação */
.av-item {
  background: #0e0e22;
  border: 1px solid #2e2e4d;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

.av-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.av-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1e1e4a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #7c6ff7;
  flex-shrink: 0;
}

.av-item-nome { font-size: 13px; font-weight: 600; color: #eee; }

.av-estrelas-mini { font-size: 13px; color: #333; }
.av-estrelas-mini .cheia { color: #EF9F27; }

.av-texto { font-size: 13px; color: #aaa; line-height: 1.6; margin-top: 4px; }
.av-data  { font-size: 11px; color: #555; margin-top: 6px; }

.av-remover {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #3a3a3a;
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.av-remover:hover { color: #e24b4a; background: #2a1515; }

.av-vazio { text-align: center; padding: 1.5rem; color: #555; font-size: 14px; }

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  header { flex-wrap: wrap; gap: 0.75rem; padding: 0.75rem 1rem; }
  nav { order: 3; width: 100%; overflow-x: auto; gap: 0; }
  nav button { white-space: nowrap; font-size: 0.8rem; padding: 5px 10px; }
  .search-wrap { order: 2; }
  .search-wrap input { width: 120px; }
  .grid { padding: 0.5rem 1rem; }
  .grid .movie-card { width: 110px; }
  #page-title { padding: 1rem 1rem 0.25rem; }
  .section-label { padding: 1rem 1rem 0.4rem; }
}

@media (max-width: 600px) {
  #modal-body { flex-direction: column; }
  #modal-poster { width: 80px; }
  #modal-title { font-size: 1.3rem; }
}

.nav-dashboard {
  color: inherit;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}
.nav-dashboard:hover {
  background: rgba(255, 255, 255, 0.1);
}

i[data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  vertical-align: middle;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}