/* Estilos para la sección de canales y carruseles */

.canales-section {
  position: relative;
  overflow: visible; /* Cambiar para permitir las animaciones de hover */
  padding: 2rem 0;
  background-color: #0d0220;
}

.canales-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #ffffff;
}

.canales-subtitle {
  font-size: 1.125rem;
  color: #bbbbbb;
  max-width: 36rem;
  margin: 0 auto 3rem;
  text-align: center;
}

/* Contenedor principal de carruseles */
.canales-carruseles {
  margin-bottom: 2rem;
  overflow: visible;
  position: relative;
  z-index: 1;
}

/* Estilos para los carruseles */
.canales-carousel-container {
  position: relative;
  overflow: visible; /* Cambiar a visible para permitir las animaciones */
  margin-bottom: 0.25rem; /* Reducir para acercar las filas */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  height: 110px; /* Ajustado para acercar las filas */
  padding: 10px 0; /* Reducido para acercar las filas */
}

.canales-carousel {
  display: flex;
  align-items: center;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  overflow: visible; /* Asegurar que las animaciones de hover no se corten */
}

.carousel-hacia-derecha {
  animation-name: slideRight;
  animation-duration: 60s;
  position: relative;
  left: -10%;
  width: 120%;
}

.carousel-hacia-izquierda {
  animation-name: slideLeft;
  animation-duration: 60s;
  position: relative;
  left: -10%;
  width: 120%;
}

@keyframes slideRight {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes slideLeft {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0%);
  }
}

.canal-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin: 0 0.5rem;
  padding: 0.75rem;
  width: 100px; /* Reducido para acercar las filas */
  height: 100px; /* Reducido para acercar las filas */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative; /* Ayuda con el posicionamiento de los elementos internos */
  overflow: visible !important; /* Forzar a visible para que no se recorte */
  transform-origin: center center; /* Asegurar que las transformaciones se apliquen desde el centro */
  transform-style: preserve-3d; /* Mejorar animación 3D */
  will-change: transform; /* Optimizar rendimiento de animación */
}

.canal-logo:hover {
  transform: translateY(-10px) rotate(5deg);
  box-shadow: 0 15px 20px -5px rgba(221, 0, 255, 0.4);
  overflow: visible !important; /* Prevenir que los logos se corten al pasar el ratón */
  z-index: 50; /* Aumentado para asegurar que esté por encima de otros elementos */
  animation: logoGlow 1.5s infinite alternate;
  position: relative; /* Asegurar el correcto posicionamiento */
}

.canal-logo img {
  max-width: 100%;
  max-height: 55px; /* Ajustado por tamaño del contenedor */
  object-fit: contain;
  transform: scale(1.5); /* Añadido para hacer los logos 50% más grandes */
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Transición mejorada */
  transform-origin: center center;
  backface-visibility: hidden; /* Mejorar calidad de animación */
}

.canal-logo:hover img {
  transform: scale(1.7) rotateZ(-5deg);
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(221, 0, 255, 0.5));
}

/* Estilos para los planes de canales */
.canales-planes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 3rem auto;
  max-width: 1000px;
}

.canales-plan {
  background: rgba(26, 9, 64, 0.6);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  position: relative;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(221, 0, 255, 0.2);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 280px;
  max-height: 320px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.canales-plan:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 35px -5px rgba(221, 0, 255, 0.4);
  border-color: rgba(221, 0, 255, 0.5);
}

.canales-plan-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.canales-plan-count {
  display: inline-block;
  background: linear-gradient(135deg, #dd00ff, #aa00ff);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  margin: 1.25rem 0;
  width: 80%;
  box-shadow: 0 4px 15px rgba(221, 0, 255, 0.3);
}

.canales-plan-btn {
  display: inline-block;
  background: linear-gradient(135deg, rgba(221, 0, 255, 0.15), rgba(170, 0, 255, 0.15));
  color: #ffffff;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(221, 0, 255, 0.3);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
  text-align: center;
  width: 60%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.canales-plan-btn:hover {
  background: linear-gradient(135deg, rgba(221, 0, 255, 0.3), rgba(170, 0, 255, 0.3));
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  border-color: rgba(221, 0, 255, 0.6);
}

/* Estilos para el modal de canales */
.canales-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem 1rem;
}

.canales-modal-content {
  background: #1a0940;
  border-radius: 1rem;
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  position: relative;
  animation: modalFadeIn 0.3s ease;
  border: 1px solid rgba(221, 0, 255, 0.3);
  box-shadow: 0 25px 50px -12px rgba(221, 0, 255, 0.25);
}

/* Grid para los canales */
.canales-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  width: 100%;
}

@media (max-width: 480px) {
  .canales-modal-content {
    padding: 1.5rem 1rem;
    margin: 1rem auto;
    width: 92%;
  }
  
  .canales-modal-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  .canales-modal-subtitle {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
  }

  .canales-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.canales-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.3s ease;
}

.canales-modal-close:hover {
  color: #dd00ff;
}

.canales-modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.canales-modal-subtitle {
  color: #aaaaaa;
  margin-bottom: 2rem;
}

.canales-lista {
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem 0;
}

/* Estilos para las categorías en el modal */
.categorias-container {
  margin-bottom: 2rem;
}

.canales-categoria {
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeInCategory 0.4s ease forwards;
}

@keyframes fadeInCategory {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.categoria-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #dd00ff;
  border-bottom: 1px solid rgba(221, 0, 255, 0.3);
  padding-bottom: 0.5rem;
  position: relative;
}

.categoria-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #dd00ff, #aa00ff);
  animation: expandLine 0.8s ease 0.3s forwards;
}

@keyframes expandLine {
  to {
    width: 100%;
  }
}

.canal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: all 0.3s ease;
  opacity: 0;
  animation: fadeInCanal 0.5s ease forwards;
  position: relative;
  overflow: hidden;
}

@keyframes fadeInCanal {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.canal-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(221, 0, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.canal-item:hover::before {
  left: 100%;
}

@media (max-width: 480px) {
  .canal-item {
    padding: 0.5rem;
  }
  
  .canal-item-logo {
    width: 50px;
    height: 50px;
    margin-bottom: 0.375rem;
  }
  
  .canal-item-name {
    font-size: 0.75rem;
  }
  
  .canal-item-logo img {
    transform: scale(1.5); /* Mantener proporción aumentada en móvil */
  }
}

.canal-item:hover {
  background-color: rgba(221, 0, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(221, 0, 255, 0.2);
}

.canal-item-logo {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.25rem;
  transition: all 0.3s ease;
}

.canal-item:hover .canal-item-logo {
  transform: scale(1.1);
  background-color: rgba(221, 0, 255, 0.15);
}

.canal-item-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: scale(1.5); /* Aumentado en 50% */
  transition: transform 0.3s ease;
}

.canal-item:hover .canal-item-logo img {
  transform: scale(1.6);
}

.canal-item-name {
  font-size: 0.875rem;
  color: #ffffff;
  transition: color 0.3s ease;
}

.canal-item:hover .canal-item-name {
  color: #dd00ff;
}

/* Botón Ver Plan */
.ver-plan-button-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(221, 0, 255, 0.3);
}

.ver-plan-btn.animated-btn {
  background: linear-gradient(45deg, #dd00ff, #aa00ff, #7700cc, #5e00b3);
  background-size: 300% 300%;
  animation: gradient-animation 3s ease infinite;
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 0.75rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(221, 0, 255, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: none;
  letter-spacing: 1px;
}

.ver-plan-btn.animated-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 25px rgba(221, 0, 255, 0.5);
}

.ver-plan-btn.animated-btn:active {
  transform: translateY(-2px);
}

.ver-plan-btn.animated-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.7s;
}

.ver-plan-btn.animated-btn:hover::before {
  left: 100%;
}

@keyframes gradient-animation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes logoGlow {
  0% {
    box-shadow: 0 15px 20px -5px rgba(221, 0, 255, 0.4);
  }
  100% {
    box-shadow: 0 20px 30px -5px rgba(221, 0, 255, 0.8);
  }
}

/* Media queries para responsividad */
@media (max-width: 768px) {
  .canales-section {
    padding: 1.5rem 0;
  }
  
  .canales-title {
    font-size: 2rem;
  }
  
  .canales-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  
  .canal-logo {
    width: 70px;
    height: 70px;
    margin: 0 0.375rem;
  }
  
  .canales-modal-content {
    padding: 1.5rem;
  }
  
  .canales-carousel-container {
    margin-bottom: 0.1rem; /* Reducido para acercar más las filas */
    padding: 15px 0; /* Reducido pero manteniendo espacio para animaciones */
    height: 100px;
  }
  
  .canales-planes {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin: 2rem auto;
    gap: 1.5rem;
  }
  
  .canales-plan {
    padding: 1.5rem;
    min-height: 260px;
    max-height: 300px;
  }
  
  .canales-plan-count {
    font-size: 1.125rem;
    padding: 0.625rem 1.75rem;
    width: 85%;
  }
  
  .canales-plan-btn {
    font-size: 0.7rem;
    padding: 0.45rem 0.9rem;
    width: 65%;
  }
}

@media (max-width: 480px) {
  .canales-planes {
    grid-template-columns: 1fr;
    margin: 1.5rem auto;
  }
  
  .canal-logo {
    width: 60px;
    height: 60px;
  }
  
  .canales-carousel-container {
    margin-bottom: 0.1rem; /* Reducido para acercar más las filas */
    padding: 10px 0; /* Reducido pero manteniendo espacio para animaciones */
    height: 80px;
  }
  
  .canales-plan {
    padding: 1.25rem;
    min-height: 240px;
    max-height: 260px;
    aspect-ratio: auto;
  }
  
  .canales-plan-count {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    width: 90%;
    margin: 1rem 0;
  }
  
  .canales-plan-btn {
    width: 70%;
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
  }
}