/* =================================================================
   MODERN UI/UX ENHANCEMENTS - 2025 Edition
   Compatible with vanilla HTML/CSS/JS, React-ready structure
   ================================================================= */

:root {
  /* Enhanced color system */
  --glow-primary: rgba(37, 99, 235, 0.3);
  --glow-success: rgba(34, 197, 94, 0.3);
  --glow-warning: rgba(245, 158, 11, 0.3);
  --gradient-primary: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  --gradient-success: linear-gradient(135deg, #22C55E 0%, #34D399 100%);
  --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 24px var(--glow-primary);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* =================================================================
   MICRO-ANIMATIONS & INTERACTIONS
   ================================================================= */

/* Smooth entrance animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

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

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px var(--glow-primary); }
  50% { box-shadow: 0 0 40px var(--glow-primary); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

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

/* Apply animations to elements with classes */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

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

/* Stagger children animations */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* =================================================================
   MODERN BUTTON STYLES
   ================================================================= */

.btn-modern-primary {
  background: var(--gradient-primary);
  border: none;
  color: white;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 12px;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.btn-modern-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;
}

.btn-modern-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

.btn-modern-primary:active {
  transform: translateY(0);
}

.btn-modern-glow {
  position: relative;
  background: var(--gradient-primary);
  animation: glow-pulse 2s ease-in-out infinite;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  transition: var(--transition-base);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: white;
}

/* =================================================================
   MODERN CARD STYLES
   ================================================================= */

.card-modern {
  background: rgba(18, 24, 26, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s;
}

.card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.card-hover-tilt {
  transition: transform 0.3s ease;
}

.card-hover-tilt:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-4px);
}

.card-glassmorphism {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* =================================================================
   INTERACTIVE ROI CALCULATOR STYLES
   ================================================================= */

.roi-calculator {
  background: var(--gradient-primary);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.roi-input-group {
  margin-bottom: 24px;
}

.roi-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  -webkit-appearance: none;
}

.roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.roi-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.roi-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.roi-result {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.roi-number {
  font-size: 3rem;
  font-weight: 800;
  color: #22C55E;
  text-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
  animation: countUp 0.8s ease-out;
}

/* =================================================================
   COUNTDOWN TIMER STYLES
   ================================================================= */

.countdown-timer {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 24px 0;
}

.countdown-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 80px;
  text-align: center;
}

.countdown-number {
  font-size: 2rem;
  font-weight: 800;
  color: #F59E0B;
  display: block;
  line-height: 1;
}

.countdown-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
}

/* =================================================================
   STATS COUNTER ANIMATION
   ================================================================= */

.stat-counter {
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--gradient-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-modern {
  background: var(--card-modern);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  transition: var(--transition-base);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card-modern:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.15);
}

/* =================================================================
   SOCIAL PROOF ELEMENTS
   ================================================================= */

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 999px;
  color: #22C55E;
  font-size: 0.875rem;
  font-weight: 600;
}

.trust-badge i {
  font-size: 1.25rem;
}

.customer-logo {
  filter: grayscale(100%) opacity(0.5);
  transition: var(--transition-base);
  height: 48px;
}

.customer-logo:hover {
  filter: grayscale(0%) opacity(1);
  transform: scale(1.1);
}

.testimonial-card {
  background: var(--card-glassmorphism);
  border-radius: 20px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: 4rem;
  color: rgba(37, 99, 235, 0.2);
  font-family: Georgia, serif;
  line-height: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* =================================================================
   FEATURE COMPARISON TABLE
   ================================================================= */

.comparison-table {
  background: rgba(18, 24, 26, 0.6);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.comparison-header {
  background: var(--gradient-primary);
  padding: 20px;
  text-align: center;
  font-weight: 700;
}

.comparison-row {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.comparison-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.comparison-check {
  color: #22C55E;
  font-size: 1.25rem;
}

.comparison-cross {
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.25rem;
}

/* =================================================================
   STICKY ELEMENTS
   ================================================================= */

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(11, 16, 17, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1020;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}

.sticky-cta.visible {
  transform: translateY(0);
}

/* =================================================================
   LOADING STATES & SKELETONS
   ================================================================= */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 32px;
  width: 60%;
  margin-bottom: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =================================================================
   PROGRESS INDICATORS
   ================================================================= */

.progress-modern {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-modern {
  height: 100%;
  background: var(--gradient-success);
  border-radius: 999px;
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar-modern::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* =================================================================
   TOOLTIP MODERN
   ================================================================= */

.tooltip-modern {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip-modern::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) scale(0);
  padding: 8px 12px;
  background: rgba(11, 16, 17, 0.95);
  color: white;
  border-radius: 8px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

.tooltip-modern:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* =================================================================
   RESPONSIVE UTILITIES
   ================================================================= */

@media (max-width: 768px) {
  .roi-calculator {
    padding: 24px;
  }
  
  .countdown-timer {
    flex-wrap: wrap;
  }
  
  .countdown-item {
    min-width: calc(50% - 8px);
  }
  
  .stat-counter {
    font-size: 2.5rem;
  }
  
  .comparison-row {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .stagger-children > * {
    animation-delay: 0s !important;
  }
}

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

.backdrop-blur {
  backdrop-filter: blur(20px);
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-on-hover:hover {
  box-shadow: var(--shadow-glow);
}

.scale-on-hover {
  transition: transform 0.3s ease;
}

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

.cursor-pointer {
  cursor: pointer;
}

/* Dark mode toggle (future-ready) */
[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f3f4f6;
  --ink: #111827;
  --muted: #6b7280;
  --line: rgba(0, 0, 0, 0.1);
}
