/* Custom CSS for animations and effects - CORRECTED VERSION */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

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

/* Animation keyframes */
@keyframes gradient-x {
  0%,
  100% {
    background-size: 200% 200%;
    background-position: left center;
  }
  50% {
    background-size: 200% 200%;
    background-position: right center;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.6);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

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

/* Animation classes */
.animate-gradient-x {
  animation: gradient-x 3s ease infinite;
}

.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out forwards;
  opacity: 0;
}

.animate-fade-in-left {
  animation: fade-in-left 0.8s ease-out forwards;
  opacity: 0;
}

.animate-fade-in-right {
  animation: fade-in-right 0.8s ease-out forwards;
  opacity: 0;
}

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

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Delay classes */
.delay-100 {
  animation-delay: 100ms;
}
.delay-200 {
  animation-delay: 200ms;
}
.delay-300 {
  animation-delay: 300ms;
}
.delay-500 {
  animation-delay: 500ms;
}
.delay-700 {
  animation-delay: 700ms;
}
.delay-900 {
  animation-delay: 900ms;
}
.delay-1000 {
  animation-delay: 1000ms;
}
.delay-1100 {
  animation-delay: 1100ms;
}

/* Grid pattern */
.bg-grid-pattern {
  background-image: linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Custom button styles */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

/* Product card effects */
.product-card {
  position: relative;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(6, 182, 212, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-card:hover::before {
  opacity: 1;
}

.product-card .p-4 {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .space-y-2 {
  margin-top: auto;
}

/* Tech badge hover effect */
.tech-badge {
  position: relative;
  transition: all 0.3s ease;
}

.tech-badge:hover {
  transform: translateY(-2px);
}

/* Navigation link effects */
.nav-link {
  position: relative;
}

.nav-underline {
  transition: width 0.3s ease;
}

/* Feature item effects */
.feature-item {
  position: relative;
}

.feature-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
  z-index: -1;
}

.feature-item:hover::before {
  width: 200px;
  height: 200px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #06b6d4, #0891b2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #0891b2, #0e7490);
}

/* Text truncation utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Loading states */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #06b6d4;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Hover effects for buttons */
.btn-buy:hover {
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.3);
}

.btn-cta:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Glassmorphism effects */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Parallax effect for background elements */
.parallax {
  transform: translateZ(0);
  will-change: transform;
}

/* Hotmart button styling */
.hotmart-button {
  width: 100%;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hotmart-button:hover {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
}

/* Botones de Hotmart responsivos */
.hotmart__button-checkout img {
  max-height: 40px !important;
  width: auto !important;
}

/* Animaciones de entrada escalonadas */
.product-card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Asegurar altura consistente para títulos y descripciones */
.min-h-3rem {
  min-height: 3rem;
}

.min-h-2-5rem {
  min-height: 2.5rem;
}

/* Focus states for accessibility */
.focus-visible:focus {
  outline: 2px solid #06b6d4;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .animate-fade-in-left,
  .animate-fade-in-right {
    animation: fade-in-up 0.8s ease-out forwards;
  }

  /* Better mobile spacing */
  .product-card {
    margin-bottom: 1rem;
    min-height: 450px;
  }

  /* Mobile-friendly text sizes */
  .mobile-text-adjust {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  /* Mobile button adjustments */
  .btn-mobile {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }

  /* Mobile navigation improvements */
  #mobile-menu {
    animation: slideDown 0.3s ease-out;
  }

  /* Hero section mobile adjustments */
  .hero-title {
    font-size: 2rem;
    line-height: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .mobile-stack {
    flex-direction: column;
  }

  .mobile-full-width {
    width: 100%;
  }

  .mobile-text-center {
    text-align: center;
  }

  .mobile-mb-4 {
    margin-bottom: 1rem;
  }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
  .product-card {
    min-height: 480px;
  }
}

/* Desktop optimizations */
@media (min-width: 1025px) {
  .container-padding {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Large screen optimizations */
@media (min-width: 1281px) {
  .product-card {
    min-height: 520px;
  }
}

/* Responsive grid específico para productos */
@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1025px) and (max-width: 1280px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1281px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

/* Contador de productos animación */
.product-counter {
  animation: slideDown 0.5s ease-out;
}

/* Ripple effect for buttons */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Keyboard navigation support */
.keyboard-navigation *:focus {
  outline: 2px solid #06b6d4 !important;
  outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .product-card {
    border: 2px solid #000;
  }

  .btn-primary {
    border: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (preparado para futuro) */
@media (prefers-color-scheme: dark) {
  .bg-grid-pattern {
    background-image: linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  }
}

/* Utilities adicionales */
.transition-all-300 {
  transition: all 0.3s ease;
}

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

.hover-translate-y-2:hover {
  transform: translateY(-2px);
}

/* Fix para elementos que se salen del viewport */
.overflow-x-hidden {
  overflow-x: hidden;
}

/* Mejoras de performance */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Contenedor principal */
.main-container {
  max-width: 100vw;
  overflow-x: hidden;
}
