@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Tailwind Configuration */
@layer base {
  :root {
    --color-primary-50: #eef9ff;
    --color-primary-100: #dff3ff;
    --color-primary-200: #b8e8ff;
    --color-primary-300: #7ad7ff;
    --color-primary-400: #3bc1ff;
    --color-primary-500: #0ea5fd;
    --color-primary-600: #0084f5;
    --color-primary-700: #0068c6;
    --color-primary-800: #0058a3;
    --color-primary-900: #064b85;
    --color-primary-950: #042e54;

    --color-secondary-50: #f5f7fa;
    --color-secondary-100: #ebeef3;
    --color-secondary-200: #d2dae5;
    --color-secondary-300: #acbcd0;
    --color-secondary-400: #8199b9;
    --color-secondary-500: #64809f;
    --color-secondary-600: #526a85;
    --color-secondary-700: #45576c;
    --color-secondary-800: #3d4a5b;
    --color-secondary-900: #36404e;
    --color-secondary-950: #21272f;

    --color-accent-50: #fef2f3;
    --color-accent-100: #fde6e7;
    --color-accent-200: #fbd0d5;
    --color-accent-300: #f7aab2;
    --color-accent-400: #f27a8a;
    --color-accent-500: #ea526a;
    --color-accent-600: #d5294b;
    --color-accent-700: #b31d3f;
    --color-accent-800: #961b3c;
    --color-accent-900: #801b39;
    --color-accent-950: #460a1c;
  }

  body {
    font-family: 'Inter', sans-serif;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
  }
}

@layer utilities {
  .text-shadow {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .text-gradient {
    @apply bg-clip-text text-transparent bg-gradient-to-r from-primary-600 to-accent-500;
  }
}

/* Variables CSS globales para consistencia */
:root {
  /* Transiciones estándar */
  --transition-default: all 0.3s ease;
  --transition-slow: all 0.5s ease;
  
  /* Elevaciones (sombras) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Espaciado común */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Bordes */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Variables del sistema de diseño */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
  
  /* Espaciado */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
}

/* Clases de utilidad para consistencia */
.transition-standard {
  transition: var(--transition-default);
}

.shadow-elevation-1 {
  box-shadow: var(--shadow-sm);
}

.shadow-elevation-2 {
  box-shadow: var(--shadow-md);
}

.shadow-elevation-3 {
  box-shadow: var(--shadow-lg);
}

.shadow-elevation-4 {
  box-shadow: var(--shadow-xl);
}

/* Foco consistente para accesibilidad */
.focus-ring {
  @apply focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 focus:ring-offset-white;
}

.dark .focus-ring {
  @apply focus:ring-offset-gray-900;
}

/* Animaciones para los elementos decorativos */
@keyframes blob {
  0% {
    transform: scale(1) translate(0px, 0px);
  }
  33% {
    transform: scale(1.1) translate(20px, -20px);
  }
  66% {
    transform: scale(0.9) translate(-20px, 20px);
  }
  100% {
    transform: scale(1) translate(0px, 0px);
  }
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

/* Patrones de fondo */
.bg-dots-pattern {
  background-image: radial-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.bg-dots-pattern-subtle {
  background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
}

.bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
}

.bg-diagonal-pattern {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.03),
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 10px
  );
}

/* Transiciones suaves para elementos interactivos */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Animación para elementos flotantes alrededor de la imagen principal */
@keyframes float {
  0% {
    transform: translateY(0px) rotate(var(--rotation, 0deg));
  }
  50% {
    transform: translateY(-10px) rotate(var(--rotation, 0deg));
  }
  100% {
    transform: translateY(0px) rotate(var(--rotation, 0deg));
  }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animation-delay-500 {
  animation-delay: 0.5s;
}

.animation-delay-1000 {
  animation-delay: 1s;
}

.animation-delay-1500 {
  animation-delay: 1.5s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

/* Efectos de hover personalizados */
.feature-card {
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
}

/* Efectos de scroll unificadas */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed,
.scroll-reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Efecto para botón CTA */
.btn-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 253, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(14, 165, 253, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 253, 0);
  }
}

/* Mejoras de accesibilidad */
.focus-visible:focus {
  outline: 2px solid #0ea5fd;
  outline-offset: 2px;
}

/* Estilos específicos para navegación por teclado */
.user-is-tabbing *:focus {
  outline: 3px solid #0ea5fd !important; 
  outline-offset: 3px !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 253, 0.4) !important;
}

.user-is-tabbing button:focus,
.user-is-tabbing a:focus,
.user-is-tabbing input:focus,
.user-is-tabbing select:focus,
.user-is-tabbing textarea:focus,
.user-is-tabbing [role="button"]:focus,
.user-is-tabbing [tabindex="0"]:focus {
  transform: scale(1.02);
}

/* Efectos para las imágenes */
.screenshot-hover {
  transition: all 0.5s ease;
}

.screenshot-hover:hover {
  transform: scale(1.02);
  /* box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); */
}

/* Efectos para las cards de testimonio */
.testimonial-card {
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  background-color: #f8fafc;
  transform: translateY(-5px);
}

/* Efectos para el FAQ */
.faq-item {
  transition: all 0.2s ease-in-out;
}

.faq-item:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Estilos para el tutorial paso a paso */
.tutorial-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.tutorial-step {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  width: 100%;
}

.tutorial-step.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.tutorial-step .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .tutorial-step .grid {
    grid-template-columns: 1fr;
  }
  .tutorial-image-container {
    order: -1;
  }
}

.tutorial-image-container {
  max-height: none;
  height: auto;
}

.tutorial-image-container img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.tutorial-image-container:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.tutorial-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0.5rem;
}

.tutorial-step-btn {
  cursor: pointer;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.tutorial-step-btn.active {
  background-color: #0ea5fd;
  color: white;
  font-weight: 600;
}

.tutorial-step-btn:not(.active):hover {
  background-color: rgba(14, 165, 253, 0.1);
  color: rgba(14, 165, 253, 0.8);
}

.tutorial-dot-btn {
  cursor: pointer;
  transition: all 0.3s ease;
}

.tutorial-dot-btn.active {
  background-color: #0ea5fd;
  transform: scale(1.2);
}

.tutorial-content {
  opacity: 0;
  animation: fadeInContent 0.5s ease 0.2s forwards;
}

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

/* Control de la imagen principal */
.hero-screenshot-container {
  max-height: none;
  height: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  z-index: 5;
}

.hero-screenshot {
  width: 100%;
  object-fit: contain;
  object-position: top center;
  max-height: 500px;
  position: relative;
  z-index: 10;
  transition: all 0.5s ease;
  border-radius: 6px;
}

.hero-screenshot:hover {
  transform: scale(1.02);
}

/* Animación para la etiqueta GRATIS */
@keyframes highlight-pulse {
  0% {
    transform: scale(1) rotate(12deg);
    box-shadow: 0 0 0 0 rgba(234, 82, 106, 0.7);
  }
  50% {
    transform: scale(1.08) rotate(12deg);
    box-shadow: 0 0 0 10px rgba(234, 82, 106, 0);
  }
  100% {
    transform: scale(1) rotate(12deg);
    box-shadow: 0 0 0 0 rgba(234, 82, 106, 0);
  }
}

.animate-pulse {
  animation: highlight-pulse 2s infinite;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .dark-mode-support {
    /* Estilos para modo oscuro si se implementa */
  }
}

/* Ajustes responsivos globales */
@media (max-width: 640px) {
  h1 {
    font-size: clamp(1.875rem, 5vw, 3rem);
  }
  
  h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
  }
  
  section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

/* Estilos generales */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Enfoque accesible */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 253, 0.35);
}

/* Animaciones */
@keyframes float {
  0% {
    transform: translateY(0px) rotate(-6deg);
  }
  50% {
    transform: translateY(-10px) rotate(-2deg);
  }
  100% {
    transform: translateY(0px) rotate(-6deg);
  }
}

@keyframes floatReverse {
  0% {
    transform: translateY(0px) rotate(6deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
  100% {
    transform: translateY(0px) rotate(6deg);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animation-delay-500 {
  animation-delay: 500ms;
}

.animation-delay-1000 {
  animation-delay: 1000ms;
}

.animation-delay-1500 {
  animation-delay: 1500ms;
}

.animation-delay-2000 {
  animation-delay: 2000ms;
}

/* Hover effects */
.hover-lift {
  transition: transform 0.2s, box-shadow 0.2s;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Tutorial paso a paso */
.tutorial-container {
  overflow: hidden;
}

.tutorial-step {
  display: none;
}

.tutorial-step.active {
  display: block;
}

.tutorial-nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.tutorial-nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.tutorial-step-btn {
  white-space: nowrap;
}

/* Efectos para captura de pantalla */
.screenshot-hover {
  transition: transform 0.3s ease-in-out;
}

.hero-screenshot-container:hover .screenshot-hover {
  transform: scale(1.02);
}

/* Acordeones FAQ - versión optimizada */
.faq-question {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.faq-icon {
  transition: transform 0.3s ease;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
}

.faq-answer.active {
  max-height: 1000px; /* Valor suficientemente alto para acomodar todo el contenido */
  opacity: 1;
}

/* Versión para JavaScript que usa display:block/none */
.faq-answer[style*="display: block"] {
  animation: fadeInAnswer 0.3s ease forwards;
}

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

/* Media queries */
@media (max-width: 640px) {
  .tutorial-step-btn {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Utilitarios adicionales */
.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}