/* ============================================================
   RESET E VARIÁVEIS GLOBAIS
============================================================ */

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

:root {
  --bg: #0b0c0e;
  --bg-light: #181b20;
  --text: #e4e4e4;
  --text-muted: #b3b3b3;
  --primary: #ff2e63;
  --secondary: #08d9d6;
}

body {
  font-family: "inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ============================================================
   NAVEGAÇÃO
============================================================ */

.top-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 9999;
  padding: 12px 0;
  transition: background 0.3s;
}

.top-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  z-index: 5;
  pointer-events: none;
}

.top-nav-fav {
  padding: 12px 0;
  margin-bottom: 10vh;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
}

nav a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  display: flex;
  gap: 5px;
  align-items: center;
  transition: 0.2s;
}

nav a:hover {
  color: var(--primary);
}

.fav-link i {
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
}

.fav-link:hover i {
  opacity: 0.7;
}

/* ============================================================
   BARRA DE BUSCA
============================================================ */

.search-overlay {
  position: relative;
  display: flex;
  align-items: center;
}

.search-overlay input {
  width: 0px;
  opacity: 0;
  padding: 8px 12px;
  border-radius: 20px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.386);
  color: white;
  transition: 0.3s ease;
  margin-right: 1rem;
}

.search-overlay.open input {
  width: 200px;
  opacity: 1;
}

.search-overlay.open input::placeholder {
  color: rgba(0, 0, 0, 0.578);
}

#search-toggle,
#search-submit {
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  transition: 0.2s;
}

#search-toggle:hover {
  color: var(--primary);
}

#search-submit.hidden {
  display: none;
}

.search-overlay.open #search-submit {
  display: block;
}

/* ============================================================
   HERO / CARROSSEL
============================================================ */

.hero-container {
  position: relative;
  width: 100%;
  height: 80vh;
  overflow: hidden;
  background: #000;
}

.hero-carousel {
  width: 100%;
  height: 100%;
  position: relative;
}

#hero-carousel::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 15%;
  background: linear-gradient(to top, rgb(0, 0, 0), rgba(0, 0, 0, 0));
  z-index: 5;
  pointer-events: none;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: top center;
  transition: opacity 1.2s ease;
  opacity: 0;
}

.hero-slide.active {
  opacity: 1;
}

.hero-content {
  position: absolute;
  bottom: 10%;
  left: 5%;
  width: 50%;
  color: #fff;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: bold;
}

.hero-content p {
  font-size: 1rem;
  margin-top: 0.5rem;
  max-width: 500px;
}

.hero-buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

.hero-btn {
  padding: 0.7rem 1.6rem;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.hero-btn.play {
  background: #fff;
  color: #000;
}

.hero-btn.plus {
  background: #ffffff40;
  backdrop-filter: blur(5px);
  color: #fff;
}

.hero-btn:hover {
  opacity: 0.85;
}

/* ============================================================
   GRID DE CARDS
============================================================ */

.cards-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

#trending-section {
  margin-top: 2rem;
}

/* ============================================================
   CARD DO FILME
============================================================ */

.card {
  max-width: 250px;
  background: var(--bg-light);
  padding: 0.8rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px #00000040;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.card:hover {
  transform: scale(1.03);
}

.card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 10px;
}

.card h3 {
  margin-top: 0.6rem;
  font-size: 1.1rem;
  color: var(--secondary);
}

.card p {
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

/* ============================================================
   BOTÕES
============================================================ */

.card button,
button {
  padding: 0.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.btn-detalhes {
  background: var(--secondary);
  color: #000;
}

.btn-detalhes:hover {
  opacity: 0.85;
}

.btn-favoritar {
  background: var(--primary);
  color: white;
}

.btn-favoritar:hover {
  opacity: 0.85;
}

.btn-remover {
  background: #d9534f;
  color: white;
}

.btn-remover:hover {
  opacity: 0.85;
}

/* ============================================================
   DETALHES DO FILME
============================================================ */

#detalhes-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  overflow-y: auto;
  padding-top: 5rem;
  z-index: 1000;
}

#detalhes-section.hidden {
  display: none !important;
}

.detalhes-filme {
  background: transparent;
  padding: 2rem;
  border-radius: 12px;
  max-width: 900px;
  margin: 0 auto;
  min-height: calc(100vh - 5rem);
  display: flex;
  flex-direction: column;
}

.detalhes-filme h2 {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 1rem;
}

.detalhes-filme h3 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.detalhes-filme img {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  margin: 1rem 0;
}

.detalhes-filme p {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

.elenco-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.elenco-list li {
  background: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--text-muted);
}

.detalhes-filme iframe {
  margin-top: 1.5rem;
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 16 / 9;
}

#btn-voltar {
  padding: 0.7rem 1.2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: 0.2s;
}

#btn-voltar:hover {
  opacity: 0.85;
}

/* ============================================================
   PÁGINA FAVORITOS
============================================================ */

.favoritos-container {
  padding-top: 2rem;
}

#listaFavoritos {
  margin-top: 2rem;
}

/* ============================================================
   MODAL TRAILER
============================================================ */

#trailer-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#trailer-modal > div {
  position: relative;
  width: 90%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
}

#close-trailer {
  position: absolute;
  top: -40px;
  right: 0;
  background: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

#close-trailer:hover {
  opacity: 0.85;
}

#trailer-modal iframe {
  border-radius: 12px;
  width: 100%;
  height: 100%;
}

/* ============================================================
   BOTÃO VOLTAR
============================================================ */

#btn-voltar {
  padding: 0.7rem 1.2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: 0.2s;
  margin-bottom: 20px;
}

#btn-voltar:hover {
  opacity: 0.85;
}

/* ============================================================
   RESPONSIVIDADE
============================================================ */

@media (max-width: 768px) {
  .hero-content {
    width: 80%;
    bottom: 5%;
    left: 10%;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 0.9rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.8rem;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .detalhes-filme {
    padding: 1rem;
  }

  .detalhes-filme h2 {
    font-size: 1.5rem;
  }

  .elenco-list {
    flex-direction: column;
  }

  .elenco-list li {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.3rem;
  }

  .nav-actions {
    gap: 10px;
  }

  .search-overlay.open input {
    width: 120px;
  }

  .hero-content {
    width: 90%;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .detalhes-filme img {
    max-width: 100%;
  }
}

/* ============================================================
   FOOTER
============================================================ */

.site-footer {
  margin-top: 4rem;
  background: linear-gradient(
    135deg,
    var(--bg-light) 0%,
    rgba(8, 217, 214, 0.05) 100%
  );
  border-top: 1px solid var(--primary);
  padding: 3rem 0 1.5rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.8rem;
  font-weight: bold;
}

.footer-section h4 {
  font-size: 1.1rem;
  color: var(--secondary);
  margin-bottom: 0.8rem;
}

.footer-section p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: var(--text-muted);
  text-decoration: none;
  transition: 0.2s;
  font-size: 0.95rem;
}

.footer-section ul li a:hover {
  color: var(--secondary);
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVIDADE - FOOTER
============================================================ */

@media (max-width: 768px) {
  .site-footer {
    margin-top: 3rem;
    padding: 2rem 0 1rem;
  }

  .footer-content {
    gap: 1.5rem;
    grid-template-columns: 1fr;
  }

  .footer-section h3 {
    font-size: 1.3rem;
  }

  .footer-section h4 {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .site-footer {
    margin-top: 2rem;
    padding: 1.5rem 0 1rem;
  }

  .footer-content {
    gap: 1rem;
  }

  .footer-section h3 {
    font-size: 1.2rem;
  }

  .footer-section p {
    font-size: 0.9rem;
  }

  .footer-bottom p {
    font-size: 0.8rem;
  }
}
