body {
  margin: 0;
  font-family: Arial, sans-serif;
  overflow-x: hidden;
}

#sidebar-panel {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 70px;
  background: #3B59F7;
  color: white;
  z-index: 1000;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(.4,0,.2,1);
  box-shadow: 2px 0 10px rgba(0,0,0,0.05);
  padding: 0;
}

#sidebar-panel.active {
  width: 220px;
  transform: translateX(0);
  padding-top: 40px;
}

.sidebar-marca {
  opacity: 0;
  pointer-events: none;
  transition:  opacity 0.s;
  padding: 40px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
}

#sidebar-panel.active .sidebar-marca {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.1s;
}

.sidebar-marca ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.sidebar-marca li {
  margin: 8px 10px;
  width: auto;;
  border-radius: 15px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.sidebar-marca a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  width: 100%;
  font-family: "Segoe UI", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 500;
  letter-spacing: 0.5px;
  font-size: 16px;
  transition: color 0.3s;
  white-space: nowrap;
  justify-content: flex-start;
}

.sidebar-marca li:not(.active):hover a {
    color: #ffffff;
}

.sidebar-marca li:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(6px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-marca li.active {
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
}

.sidebar-marca li.active a {
    color: #3B59F7;
    font-weight: 700;
}

#menu-toggle {
  position: fixed;
  left: 13px;
  top: 20px;
  width: 38px;
  height: 38px;
  font-size: 26px;
  background: #3B59F7;
  color: white;
  border: none;
  z-index: 1101;
  cursor: pointer;
  border-radius: 8px;
  display: block;
}

#sidebar-panel.active .close-btn {
  display: block;
}

main {
  margin-left: 65px;
  padding: 20px;
}

@media (max-width: 768px) {
  main {
    margin-left: 0;
  }
}

#config-container {
  position: fixed;
  bottom: 20px;
  left: 13px; 
  z-index: 1102;
}

.config-link {
  display: flex;
  align-items: center;
  height: 50px;
  width: 50px; 
  background-color: white;
  border-radius: 25px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  text-decoration: none;
  overflow: hidden;
  transition: width 0s cubic-bezier(.4,0,.2,1), background-color 0.2s, transform 0.2s;
}

#sidebar-panel.active ~ #config-container .config-link {
  width: 160px;
}

#sidebar-panel.active ~ #config-container .config-link h1 {
  opacity: 1;
}

.config-link:hover {
  background-color: #eef2ff;
  transform: scale(1.1);    
  box-shadow: 0 6px 15px rgba(59, 89, 247, 0.4); 
}

.ia-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  margin-left: 10px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 1px black);
}

.config-link h1 {
  font-family: Arial, sans-serif;
  font-size: 16px;
  color: #333;
  margin: 0 0 0 10px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}

#sidebar-panel.active ~ #config-container {
  left: 30px;
}

#sidebar-panel.active {
  width: 220px;
  transform: translateX(0);
  padding-top: 40px;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
}

#top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  z-index: 999;
}

.brand-name {
  font-family: "poppins", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #3B59F7;
  letter-spacing: 0.5px;
  margin-left: 90px;
  padding-top: 20px;
}

/* =========================================
   CÓDIGO ACTUALIZADO: Módulos de Películas, Login y Player
   (Pega esto debajo de tu código base)
   ========================================= */

/* --- 1. BARRA DE BÚSQUEDA (Navbar) --- */
.search-container {
  display: flex;
  align-items: center;
  
  /* CAMBIO CLAVE AQUÍ: */
  margin-left: auto; /* Empuja la barra hacia la derecha */
  margin-right: 20px; /* Para que no se pegue al borde de la pantalla */
  
  background: #f0f2f5;
  border-radius: 20px;
  padding: 5px 15px;
  width: 40%; 
  max-width: 400px;
}

.search-container input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  padding: 5px;
  font-size: 14px;
  color: #333;
}

.search-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
}
/* --- 2. GRID DE PELÍCULAS (Responsive + Sin Distorsión) --- */
#main-content {
  padding-top: 80px;
  padding-bottom: 40px;
  width: 100%;
  box-sizing: border-box;
}

.movies-grid {
  display: grid;
  /* Columnas inteligentes: se adaptan al ancho disponible */
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
  gap: 20px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.movie-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(59, 89, 247, 0.2);
}

/* Contenedor Portada: Mantiene proporción cine 2:3 */
.poster-container {
  width: 100%;
  aspect-ratio: 2 / 3; 
  overflow: hidden;
  background-color: #eee;
  position: relative;
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: cover; /* CLAVE: Evita que la imagen se aplaste */
  object-position: center top;
  transition: transform 0.5s ease;
}

.movie-card:hover .movie-poster {
  transform: scale(1.05);
}

.movie-info {
  padding: 15px;
  text-align: center;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  flex-grow: 1; 
}

.movie-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Máximo 2 líneas de texto */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.watch-btn {
  background-color: #3B59F7;
  color: white;
  border: none;
  padding: 10px 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  width: 100%;
  transition: background 0.2s;
}

.watch-btn:hover {
  background-color: #2240d4;
}

/* --- 3. MODAL Y LOGIN --- */

/* Fondo oscuro desenfocado */
.modal-overlay {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85); 
  backdrop-filter: blur(5px); 
  justify-content: center;
  align-items: center;
}

/* Contenedor general transparente y centrado */
.modal-content {
  background: transparent;
  box-shadow: none;
  border: none;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
}

/* TARJETA DE LOGIN (DISEÑO PROFESIONAL) */
#auth-step {
  background: white;
  width: 100%;
  max-width: 400px;
  padding: 40px 30px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  text-align: center;
  position: relative;
  animation: fadeInUp 0.4s ease;
}

/* Título dentro de la tarjeta */
#modal-movie-title {
    color: #333;
    margin-top: 0;
    font-size: 20px;
    font-weight: 700;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Input de contraseña */
#auth-step input {
  width: 100%;
  padding: 15px;
  margin: 20px 0;
  border: 2px solid #eee;
  background: #f9f9f9;
  border-radius: 12px;
  font-size: 16px;
  text-align: center;
  outline: none;
  box-sizing: border-box;
  transition: all 0.3s;
}

#auth-step input:focus {
  border-color: #3B59F7;
  background: white;
  box-shadow: 0 0 0 4px rgba(59, 89, 247, 0.1);
}

.verify-btn {
  width: 100%;
  padding: 15px;
  background: #3B59F7;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.verify-btn:hover {
  transform: translateY(-2px);
}

/* Botón de cerrar (X) */
.close-modal {
  position: absolute;
  top: 20px; /* Ajustado para estar dentro/cerca de la tarjeta */
  right: 20px;
  font-size: 30px;
  color: #999;
  cursor: pointer;
  z-index: 2010;
  line-height: 1;
  transition: color 0.3s;
}

/* Cuando la X está sobre fondo oscuro (en modo video) la hacemos blanca */
.modal-content:has(#player-step[style*="block"]) .close-modal {
    top: -40px;
    right: 0;
    color: white;
}

.close-modal:hover {
  color: #333;
}

/* --- 4. REPRODUCTOR DE VIDEO (Sin Bordes) --- */
#player-step {
    width: 100%;
    max-width: 900px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  background: black;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  border-radius: 12px;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- 5. AJUSTES MÓVILES --- */
@media (max-width: 600px) {
  .search-container { display: none; } 
  
  .movies-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
    padding: 10px; 
  }
  
  .watch-btn { 
    padding: 8px 0; 
    font-size: 12px; 
  }
  
  /* Ajuste del Login en Móvil */
  #auth-step {
    padding: 25px 20px;
    width: 90%;
  }
  
  /* Ajuste de la X de cerrar en móvil */
  .close-modal { 
    top: 10px; 
    right: 15px; 
    color: #333; 
  }
}


