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

body {
  font-family: 'Montserrat', sans-serif;
  background: #1c1c1c;
  color: #fff;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #141414;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
}

.logo svg {
  fill: #e50914; /* rojo estilo Netflix */
}

.logo-text {
  display: inline;
}

.logo span {
  color: #fff;
}

/* Buscador */
.search-container {
  flex: 1;
  max-width: 400px;
  margin: 0 15px;
  display: flex;
  align-items: center;
  background: #222;
  border-radius: 25px;
  overflow: hidden;
}
.search-container input {
  flex: 1;
  border: none;
  padding: 8px 12px;
  outline: none;
  background: transparent;
  color: #fff;
}
.search-container button {
  background: #e50914;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
}

/* Botón hamburguesa */
.menu-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
}

/* Menú de navegación */
.nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
}
.nav a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
}
.nav a:hover {
  color: #e50914;
}

/* Responsive */
@media (max-width: 768px) {
  .logo-text {
    display: none; /* ocultar texto del logo */
  }

  .menu-toggle {
    display: block; /* mostrar botón hamburguesa */
  }

  .nav {
    position: absolute;
    top: 60px;
    right: 0;
    background: #141414;
    width: 200px;
    padding: 15px;
    border-radius: 0 0 0 12px;
    display: none;
    flex-direction: column;
    gap: 15px;
  }

  .nav ul {
    flex-direction: column;
    gap: 15px;
  }

  .nav.show {
    display: flex;
  }
}

.search-btn svg, .menu-btn svg {
  fill: #fff;
  transition: transform 0.2s ease;
}

.search-btn:hover svg, .menu-btn:hover svg {
  transform: scale(1.1);
  fill: #e50914;
}

/* Secciones */
.section-title {
  margin: 20px;
  font-size: 1.2rem;
  border-left: 5px solid #e50914;
  padding-left: 10px;
}

/* Grid de películas */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
}

.movie-card {
  background: #222;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.movie-card:hover {
  transform: scale(1.05);
}

.movie-card img {
  width: 100%;
  display: block;
}

.movie-info {
  padding: 10px;
  text-align: center;
}

.movie-info h3 {
  font-size: 1rem;
  margin: 5px 0;
}

.movie-info p {
  font-size: 0.8rem;
  color: #aaa;
}

/* Paginación */
.paginacion {
  position: fixed;
  bottom: 0;
  background: #141414;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px;
}

.paginacion button {
  cursor: pointer;
  border: none;
  height: 45px;
  width: 150px;
  background: #e50914;
  color: #fff;
  border-radius: 100px;
  font-weight: 600;
  transition: .3s ease all;
}

.paginacion button:hover {
  background: #b44726;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  padding: 50px;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: block;
  opacity: 1;
}

.modal-content {
  background: #222;
  margin: auto;
  padding: 20px;
  border-radius: 12px;
  max-width: 600px;
  color: #fff;
}

.close {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

.modal-poster {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 15px;
}

#movieResults {
  display: none;
}

/* --- Modal especial: Sin resultados --- */
#movieModal.no-results .modal-content {
  text-align: center;
  background: #222; /* un poco más oscuro */
  border: 2px dashed #e50914; /* borde especial */
  color: #fff;
}

#movieModal.no-results #modalPoster {
  filter: grayscale(100%);
  opacity: 0.6;
}

#movieModal.no-results #modalTitle {
  font-size: 1.8rem;
  color: #e50914; /* resaltar el título */
}

#movieModal.no-results #modalOverview {
  margin-top: 15px;
  font-size: 1rem;
  color: #ccc;
}

/* --- Animación shake para el buscador --- */
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.search-container.shake {
  animation: shake 0.4s;
}

.no-results-card.shake {
  animation: shake 0.4s;
}