/* ============================================
   CRM Dental - Modern Landing Styles
   3D Effects, Glassmorphism, Animations
   ============================================ */

/* CSS Variables para sistema de temas */
:root {
  /* Brand colors - se sobreescriben dinámicamente */
  --brand-color: #00C9A7;
  --brand-color-soft: rgba(0, 201, 167, 0.1);
  --brand-color-muted: rgba(0, 201, 167, 0.05);
  --brand-color-strong: rgba(0, 201, 167, 0.9);
  
  /* Light theme (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;
  
  --border-primary: #e2e8f0;
  --border-secondary: #cbd5e1;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-brand: 0 10px 40px -10px var(--brand-color-soft);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Dark theme */
.dark {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-elevated: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;
  
  --border-primary: #334155;
  --border-secondary: #475569;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.7);
  
  /* Glassmorphism dark */
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Base transitions */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ============================================
   3D EFFECTS & TRANSFORMS
   ============================================ */

/* 3D Card Effect */
.card-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-3d:hover {
  transform: translateY(-8px) rotateX(2deg);
}

.card-3d-inner {
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-3d:hover .card-3d-inner {
  transform: translateZ(20px);
}

/* Floating Effect */
.floating {
  animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(1deg); }
}

.floating-slow {
  animation: floating 8s ease-in-out infinite;
}

.floating-delayed {
  animation: floating 6s ease-in-out infinite;
  animation-delay: -3s;
}

/* 3D Mockup Float */
.mockup-3d {
  transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
  transition: transform 0.5s ease;
  box-shadow: 
    20px 20px 60px rgba(0, 0, 0, 0.3),
    -5px -5px 20px rgba(255, 255, 255, 0.1);
}

.mockup-3d:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

/* ============================================
   GLASSMORPHISM
   ============================================ */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.dark .glass-strong {
  background: rgba(15, 23, 42, 0.85);
}

.glass-card {
  background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(255,255,255,0.3) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
}

/* ============================================
   GRADIENTS & BACKGROUNDS
   ============================================ */

.gradient-mesh {
  background: 
    radial-gradient(at 40% 20%, var(--brand-color-soft) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(236, 72, 153, 0.1) 0px, transparent 50%),
    radial-gradient(at 80% 50%, var(--brand-color-soft) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(99, 102, 241, 0.1) 0px, transparent 50%);
}

.gradient-hero {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand-color) 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated Gradient */
.gradient-animated {
  background: linear-gradient(-45deg, var(--brand-color), #6366f1, #ec4899, var(--brand-color));
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

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

/* ============================================
   BUTTONS & CTAs
   ============================================ */

.btn-primary {
  position: relative;
  background: var(--brand-color);
  color: white;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 201, 167, 0.3);
}

.btn-primary::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.5s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 201, 167, 0.4);
}

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

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

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 201, 167, 0.3); }
  50% { box-shadow: 0 0 40px rgba(0, 201, 167, 0.6); }
}

/* ============================================
   THEME TOGGLE
   ============================================ */

.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 50px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.theme-toggle-btn.active {
  background: var(--brand-color);
  color: white;
}

/* ============================================
   MODAL SYSTEM
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 9999;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-content {
  background: var(--bg-elevated);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-2xl);
  border: 1px solid var(--border-primary);
}

/* ============================================
   CAROUSEL
   ============================================ */

.carousel-container {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
  flex: 0 0 100%;
  padding: 0 16px;
}

.carousel-slide-md {
  flex: 0 0 50%;
}

.carousel-slide-lg {
  flex: 0 0 33.333%;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.carousel-btn:hover {
  background: var(--brand-color);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn-prev { left: -24px; }
.carousel-btn-next { right: -24px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: var(--brand-color);
  width: 32px;
  border-radius: 5px;
}

/* ============================================
   TESTIMONIAL CARDS
   ============================================ */

.testimonial-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-color-soft);
}

.testimonial-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand-color);
}

.testimonial-stars {
  color: #fbbf24;
}

/* ============================================
   PRICING CARDS
   ============================================ */

.pricing-card {
  background: var(--bg-elevated);
  border: 2px solid var(--border-primary);
  border-radius: 24px;
  padding: 32px;
  transition: all 0.3s ease;
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-8px);
  border-color: var(--brand-color);
  box-shadow: var(--shadow-brand);
}

.pricing-card.popular {
  border-color: var(--brand-color);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--brand-color-muted) 100%);
}

.pricing-card.popular::before {
  content: 'Más Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-color);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.pricing-feature-list {
  list-style: none;
  padding: 0;
}

.pricing-feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  color: var(--text-secondary);
}

.pricing-feature-list li svg {
  color: var(--brand-color);
  flex-shrink: 0;
}

/* ============================================
   SCROLL EFFECTS
   ============================================ */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animations */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* ============================================
   TYPING EFFECT
   ============================================ */

.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--brand-color);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================
   SHAPES & DECORATIONS
   ============================================ */

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: blob-morph 20s ease-in-out infinite;
}

@keyframes blob-morph {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50% { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
  75% { border-radius: 60% 40% 60% 30% / 60% 30% 40% 70%; }
}

.grid-pattern {
  background-image: 
    linear-gradient(var(--border-primary) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-primary) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-gradient {
  background: linear-gradient(135deg, var(--brand-color) 0%, #6366f1 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.border-gradient {
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-elevated), var(--bg-elevated)) padding-box,
              linear-gradient(135deg, var(--brand-color), #6366f1) border-box;
}

.shadow-brand {
  box-shadow: 0 10px 40px -10px var(--brand-color-soft);
}

.shadow-brand-lg {
  box-shadow: 0 20px 60px -15px var(--brand-color-soft);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .theme-toggle {
    bottom: 16px;
    right: 16px;
  }
  
  .carousel-btn {
    display: none;
  }
  
  .carousel-slide-md,
  .carousel-slide-lg {
    flex: 0 0 100%;
  }
  
  .mockup-3d {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .floating,
  .floating-slow,
  .floating-delayed {
    animation: none;
  }
  
  .gradient-animated {
    animation: none;
  }
}
