/* Estilos personalizados */
@import url('colors.css'); /* Importación de la paleta de colores personalizada */

/* Fuente Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* Fuente global */
* {
  font-family: 'Montserrat', sans-serif;
}

body {
  font-family: 'Montserrat', sans-serif;
}

/* Estilos para el menú móvil */
body.overflow-hidden {
  overflow: hidden;
  position: relative;
  height: 100%;
}

/* Efecto de transición para el menú móvil */
#mobile-menu {
  transition: transform 0.3s ease-in-out;
  height: 100vh;
  width: 100vw;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  position: fixed;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  z-index: 9999 !important;
}

/* Aseguramos que el menú hamburguesa solo aparezca en móviles (menores a 640px) */
@media (min-width: 640px) {
  #mobile-menu-button {
    display: none !important;
  }
  
  #mobile-menu {
    display: none !important;
  }
}

/* Sombra sutil para el botón del menú hamburguesa */
#mobile-menu-button {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* Estilos para asegurar que el botón sea clickeable */
#mobile-menu-button svg {
  pointer-events: none;
}

/* ===== MENÚ MÓVIL - CORRECCIÓN COMPLETA ===== */
/* Forzar el estilo del menú móvil */
#mobile-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: white !important;
  z-index: 9999 !important;
  overflow-y: auto !important;
  transition: transform 0.3s ease-in-out !important;
}

/* Estados del menú móvil */
#mobile-menu.translate-x-full {
  transform: translateX(100%) !important;
}

#mobile-menu.translate-x-0 {
  transform: translateX(0) !important;
}

/* Ocultar en desktop */
@media (min-width: 640px) {
  #mobile-menu {
    display: none !important;
  }
}

/* Mostrar en móvil */
@media (max-width: 639px) {
  #mobile-menu {
    display: block !important;
  }
  
  /* Asegurar que los botones sean visibles y grandes */
  #nav-login-mobile, #nav-registro-mobile {
    display: flex !important;
    min-height: 60px !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  /* Hacer el botón hamburguesa más visible */
  #mobile-menu-button {
    border: 2px solid #6b7280 !important;
    background: white !important;
    padding: 12px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  }
  
  #mobile-menu-button:hover {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
  }
}

/* Mejorar la apariencia de los enlaces del menú móvil */
.mobile-nav-link {
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  display: block;
  width: 100%;
  text-decoration: none;
  color: #1f2937;
}

.mobile-nav-link:hover {
  color: #2563eb;
  background-color: #eff6ff;
}

/* Estilos para el header del menú móvil */
#mobile-menu .border-b {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Animación suave para el menú móvil */
#mobile-menu {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Animación para los enlaces del menú móvil */
#mobile-menu a {
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  display: block;
  width: 100%;
  margin: 0;
  text-decoration: none;
  color: #1f2937;
}

/* Estilos para el navbar principal */
header.navbar-large-screen {
  min-height: 72px; /* Altura mínima consistente */
}

header nav a {
  transition: color 0.2s ease;
  position: relative;
}

header nav a:hover {
  color: #2563eb;
}

/* Efecto hover para enlaces del navbar */
header nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 50%;
  background-color: #2563eb;
  transition: all 0.2s ease;
  transform: translateX(-50%);
}

header nav a:hover::after {
  width: 80%;
}

/* Responsive para el navbar */
@media (max-width: 639px) {
  header .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  header img {
    max-width: 120px;
  }
}

/* Asegurar que los botones de sesión siempre sean visibles en desktop */
@media (min-width: 640px) {
  #nav-login, #nav-registro {
    display: inline-flex !important;
  }
  
  /* Prevenir que los botones se envuelvan */
  header .hidden.sm\\:flex {
    flex-wrap: nowrap;
    min-width: fit-content;
  }
}

/* Responsive adicional para corregir problemas específicos */

/* Asegurar aspect ratio correcto en todas las imágenes del catálogo */
.aspect-square {
  aspect-ratio: 1;
}

/* Mejorar el espaciado en móviles para todas las páginas */
@media (max-width: 639px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Títulos más pequeños en móvil */
  h1 {
    font-size: 1.875rem !important; /* text-3xl */
    line-height: 2.25rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important; /* text-2xl */
    line-height: 2rem !important;
  }
  
  h3 {
    font-size: 1.25rem !important; /* text-xl */
    line-height: 1.75rem !important;
  }
}

/* Mejorar botones en dispositivos táctiles */
@media (max-width: 1023px) {
  button, .button, a[class*="bg-"] {
    min-height: 44px; /* Tamaño mínimo táctil recomendado */
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

#mobile-menu a:hover, #mobile-menu a:active, #mobile-menu a:focus {
  background-color: rgba(59, 130, 246, 0.05);
  transform: translateX(5px);
  color: #2563eb;
}

/* Asegurarse de que los enlaces en el menú móvil sean claramente visibles y clickeables */
.mobile-nav-link {
  display: block !important;
  width: 100% !important;
  position: relative !important;
  z-index: 9999 !important;
  text-align: center !important;
  font-size: 18px !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3) !important;
  touch-action: manipulation !important;
}

/* Estilos adicionales para mejorar la usabilidad del menú móvil */
#mobile-menu {
  height: 100vh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Destacar los enlaces en el menú móvil para mejor visualización */
#mobile-menu a {
  transition: all 0.3s ease !important;
}

#mobile-menu a:active {
  background-color: rgba(59, 130, 246, 0.2) !important;
  color: #2563eb !important;
  transform: scale(0.98) !important;
}

/* Efecto overlay para cuando el menú móvil está abierto */
body.overflow-hidden::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 30;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Asegurar que el menú sea visible cuando está activado */
.translate-x-0 {
  transform: translateX(0) !important;
}

/* Pantallas pequeñas - ajustes adicionales */
@media (max-width: 640px) {
  #mobile-menu {
    width: 100vw;
    padding-top: 80px;
  }
  
  #mobile-menu a {
    font-size: 18px;
    padding: 15px 0;
  }
}

/* Arreglo para problema de z-index */
header {
  position: relative;
  z-index: 50;
}

/* Asegúrate que los botones tengan suficiente área clickable */
#mobile-menu-button svg {
  pointer-events: none;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fadeIn {
  animation: fadeIn 1s ease-in;
}

@keyframes slideInLeft {
  from { 
    opacity: 0; 
    transform: translateX(-30px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

@keyframes slideInRight {
  from { 
    opacity: 0; 
    transform: translateX(30px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Animación específica para el banner principal */
.hero-title-animate {
  animation: fadeInScale 1.2s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
  opacity: 0;
}

.hero-title-word-1 {
  animation-delay: 0.1s;
}

.hero-title-word-2 {
  animation-delay: 0.3s;
}

.hero-title-word-3 {
  animation-delay: 0.5s;
}

/* Estilos adicionales */
.hover-grow {
  transition: transform 0.3s ease;
}

.hover-grow:hover {
  transform: scale(1.05);
}

/* Estilos para el carousel de testimonios */
.testimonials-carousel {
  overflow: hidden;
  position: relative;
}

.testimonials-slide {
  transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Arreglo para los iconos de comillas */
.testimonial-card {
  margin-top: 20px; /* Espacio adicional para el ícono de comilla */
  transition: all 0.3s ease;
}

.testimonial-card .absolute {
  top: -8px; /* Ajustar posición del ícono */
}

.carousel-nav-btn {
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.carousel-nav-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.carousel-nav-btn:active {
  transform: scale(0.95);
}

.carousel-indicator {
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-indicator:hover {
  transform: scale(1.2);
}

.carousel-indicator.active {
  background: linear-gradient(135deg, #9333ea, #ec4899);
}

/* Animación suave para las tarjetas de testimonios */
.testimonial-card {
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Estilos responsivos para el carousel */
@media (max-width: 768px) {
  .carousel-nav-btn {
    width: 40px;
    height: 40px;
    transform: translateX(0) !important;
    position: relative;
    margin: 0 10px;
  }
  
  .carousel-navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
  }
  
  .testimonials-slide .grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Estilos personalizados para el formulario */
input:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Estilos para dispositivos móviles */
@media (max-width: 768px) {
  .hero-text {
    font-size: 1.5rem;
  }
  
  /* Mejora de espaciado general para móviles */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  /* Ajuste de tamaños de texto para móviles */
  h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }
  
  h2 {
    font-size: 1.75rem !important;
  }
  
  h3 {
    font-size: 1.5rem !important;
  }
  
  /* Ajustes para mejorar espacios en móviles */
  .py-16 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  .py-12 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  /* Mejora táctil para botones en móviles */
  button, a.btn, .btn, [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Ajustes para inputs en móviles */
  input, select, textarea {
    font-size: 16px !important; /* Evita zoom automático en iOS */
  }
  
  /* Mejoras para el formulario de búsqueda en móvil */
  #heroSearchForm {
    width: 100%;
  }
  
  #heroUrlInput {
    height: 50px;
    font-size: 16px !important;
    padding-left: 36px !important;
  }
  
  #downloadBtn {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    justify-content: center;
    font-size: 16px !important;
  }
}

/* Mejoras para tablet */
@media (min-width: 640px) and (max-width: 1023px) {
  #heroSearchForm {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  
  #heroUrlInput {
    height: 54px;
  }
  
  #downloadBtn {
    height: 54px;
    min-width: 160px;
  }
}

/* Mejoras adicionales para la experiencia de usuario */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Efectos de desvanecimiento para transiciones suaves */
.fade-enter {
  opacity: 0;
  transform: translateY(20px);
}

.fade-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}

.fade-exit {
  opacity: 1;
  transform: translateY(0);
}

.fade-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.6s ease;
}

/* Estilos específicos para la barra de búsqueda en el Hero */
#heroSearchForm {
  transition: all 0.3s ease;
}

#heroUrlInput {
  -webkit-appearance: none; /* Para iOS */
  appearance: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
  height: auto;
  width: 100%;
  box-sizing: border-box;
}

#heroUrlInput:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

#downloadBtn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
  transform-origin: center;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

#downloadBtn:active {
  transform: scale(0.98);
}

/* Clase específica para asegurar proporciones correctas en tablets */
@media (min-width: 640px) {
  #heroSearchForm {
    display: flex;
    align-items: center;
  }
  
  #heroSearchForm > div.flex-1 {
    flex: 1;
  }
  
  #downloadBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
  }
}

@media (max-width: 639px) {
  /* Ajustes específicos para móvil */
  .glassmorphism {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  
  #heroUrlInput {
    border-width: 2px;
    font-size: 14px !important;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  /* Ajustes específicos para tablet */
  #heroSearchForm {
    gap: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  
  .glassmorphism {
    width: 90%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 12px;
  }
  
  #heroUrlInput {
    height: 54px;
    flex: 1;
    font-size: 15px !important;
    min-width: 0; /* Evita que el input crezca demasiado */
  }
  
  #downloadBtn {
    height: 54px;
    min-width: 140px; /* Tamaño mínimo para tablets pequeñas */
    width: auto; /* Permitir que crezca según el contenido */
    font-size: 15px !important;
    white-space: nowrap;
    padding-left: 12px;
    padding-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Ajuste específico para tablets más pequeñas */
  @media (max-width: 768px) {
    #downloadBtn {
      min-width: 130px;
      padding-left: 10px;
      padding-right: 10px;
    }
    
    #downloadBtn i {
      margin-right: 6px;
    }
  }
}
