/*
 * EvonDex Tailwind Custom Extensions
 * Custom utilities extending Tailwind CSS with glassmorphism, gradients, and animations
 * Compatible with Tailwind CDN
 */

/* =============================================
   CSS Custom Properties (Design Tokens)
   ============================================= */
:root {
  /* Reference Site Colors - Exact Hex Values */
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-blue-700: #1d4ed8;
  --color-violet-500: #8b5cf6;
  --color-pink-500: #ec4899;
  --color-cyan-500: #06b6d4;
  --color-slate-900: #0f172a;
  --color-slate-500: #64748b;

  /* Semantic Colors */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #06b6d4;
  --accent: #8b5cf6;
  --dark: #0f172a;
  --gray: #64748b;
  --light: #ffffff;
  --light-gray: #f8fafc;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-blue-500) 0%, var(--color-cyan-500) 100%);
  --gradient-accent: linear-gradient(135deg, var(--color-violet-500) 0%, var(--color-pink-500) 100%);
  --gradient-full: linear-gradient(135deg, var(--color-blue-500) 0%, var(--color-violet-500) 50%, var(--color-pink-500) 100%);
  --gradient-dark: linear-gradient(135deg, var(--color-slate-900) 0%, #1e293b 100%);

  /* Shadows */
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.3);
  --shadow-glow-accent: 0 0 40px rgba(139, 92, 246, 0.3);
  --shadow-glow-cyan: 0 0 40px rgba(6, 182, 212, 0.3);
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 20px 60px rgba(0, 0, 0, 0.15);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-dark: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-border-dark: rgba(255, 255, 255, 0.1);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* =============================================
   Gradient Text Utility
   ============================================= */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.gradient-text-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.gradient-text-full {
  background: var(--gradient-full);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* =============================================
   Glassmorphism Card
   ============================================= */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.glass-card-dark {
  background: var(--glass-bg-dark);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.glass-card-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
}

/* Enhanced Glass Variants */
.glass-card-strong {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-card-subtle {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =============================================
   Floating Animation
   ============================================= */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes float-slow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-slow {
  animation: float-slow 8s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 6s ease-in-out infinite;
  animation-delay: 2s;
}

/* =============================================
   Decorative Blobs
   ============================================= */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.blob-blue {
  background: var(--color-blue-500);
  width: 400px;
  height: 400px;
}

.blob-violet {
  background: var(--color-violet-500);
  width: 350px;
  height: 350px;
}

.blob-pink {
  background: var(--color-pink-500);
  width: 300px;
  height: 300px;
}

.blob-cyan {
  background: var(--color-cyan-500);
  width: 380px;
  height: 380px;
}

.blob-gradient {
  background: var(--gradient-primary);
  width: 450px;
  height: 450px;
}

.blob-small {
  width: 200px;
  height: 200px;
  filter: blur(40px);
}

.blob-large {
  width: 600px;
  height: 600px;
  filter: blur(80px);
}

/* =============================================
   Grid Pattern Background
   ============================================= */
.grid-pattern {
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(100, 116, 139, 0.15) 1px, transparent 0);
  background-size: 40px 40px;
}

.grid-pattern-light {
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.2) 1px, transparent 0);
  background-size: 24px 24px;
}

.grid-pattern-dark {
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
  background-size: 32px 32px;
}

/* Dot Pattern Alternative */
.dot-pattern {
  background-image: radial-gradient(rgba(100, 116, 139, 0.2) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* =============================================
   Timeline Line Gradients
   ============================================= */
.timeline-line {
  position: relative;
}

.timeline-line::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--color-blue-500) 0%,
    var(--color-violet-500) 50%,
    var(--color-pink-500) 100%
  );
  border-radius: 2px;
}

.timeline-line-vertical::before {
  top: 0;
  left: 24px;
  transform: none;
  width: 3px;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-blue-500);
  border: 3px solid white;
  box-shadow: 0 0 0 3px var(--color-blue-500);
  position: relative;
  z-index: 1;
}

.timeline-dot-violet {
  background: var(--color-violet-500);
  box-shadow: 0 0 0 3px var(--color-violet-500);
}

.timeline-dot-pink {
  background: var(--color-pink-500);
  box-shadow: 0 0 0 3px var(--color-pink-500);
}

/* =============================================
   Custom Shadow Utilities
   ============================================= */
.shadow-glow {
  box-shadow: var(--shadow-glow);
}

.shadow-glow-accent {
  box-shadow: var(--shadow-glow-accent);
}

.shadow-glow-cyan {
  box-shadow: var(--shadow-glow-cyan);
}

.shadow-card {
  box-shadow: var(--shadow-card);
}

.shadow-card-hover {
  box-shadow: var(--shadow-card-hover);
}

.shadow-inner-glow {
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

/* Soft Shadow Variants */
.shadow-soft {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.shadow-soft-lg {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.shadow-colored {
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.15);
}

/* =============================================
   Background Gradient Utilities
   ============================================= */
.bg-gradient-primary {
  background: var(--gradient-primary);
}

.bg-gradient-accent {
  background: var(--gradient-accent);
}

.bg-gradient-full {
  background: var(--gradient-full);
}

.bg-gradient-dark {
  background: var(--gradient-dark);
}

/* =============================================
   Border Gradient Utilities
   ============================================= */
.border-gradient {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
}

.border-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* =============================================
   Hover Effects
   ============================================= */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* =============================================
   Button Variants
   ============================================= */
.btn-gradient {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 14px 32px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.btn-gradient:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: var(--radius-full);
  padding: 14px 32px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* =============================================
   Text Utilities
   ============================================= */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-glow {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.text-balance {
  text-wrap: balance;
}

/* =============================================
   Scroll Animations
   ============================================= */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
}

.animate-fade-in {
  animation: fade-in 0.5s ease-out forwards;
}

.animate-scale-in {
  animation: scale-in 0.5s ease-out forwards;
}

.animate-slide-in-left {
  animation: slide-in-left 0.6s ease-out forwards;
}

.animate-slide-in-right {
  animation: slide-in-right 0.6s ease-out forwards;
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* =============================================
   Pulse Animation
   ============================================= */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* =============================================
   Shimmer Effect
   ============================================= */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* =============================================
   Noise Texture Overlay
   ============================================= */
.noise-overlay {
  position: relative;
}

.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
}

/* =============================================
   Gradient Border Button
   ============================================= */
.btn-border-gradient {
  position: relative;
  background: transparent;
  border: none;
  padding: 2px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
}

.btn-border-gradient span {
  display: block;
  background: white;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--color-blue-600);
  transition: all 0.3s ease;
}

.btn-border-gradient:hover span {
  background: transparent;
  color: white;
}

/* =============================================
   Card Variants
   ============================================= */
.card-feature {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.card-feature:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(59, 130, 246, 0.2);
}

.card-feature-icon {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  font-size: 1.8rem;
  color: var(--color-blue-600);
}

/* =============================================
   Decorative Elements
   ============================================= */
.line-decoration {
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.line-decoration-center {
  margin: 0 auto;
}

/* =============================================
   Z-Index Scale
   ============================================= */
.z-blob { z-index: 0; }
.z-content { z-index: 1; }
.z-card { z-index: 10; }
.z-nav { z-index: 100; }
.z-modal { z-index: 1000; }
.z-tooltip { z-index: 2000; }
.z-toast { z-index: 3000; }

/* =============================================
   Utility Classes
   ============================================= */
.backdrop-blur-sm {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.backdrop-blur-md {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.backdrop-blur-lg {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
  .blob,
  .noise-overlay::after {
    display: none;
  }
  
  .glass-card,
  .glass-card-dark {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: white;
    border: 1px solid #e2e8f0;
  }
}

/* =============================================
   Reduced Motion Support
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  .animate-float,
  .animate-float-slow,
  .animate-float-delayed,
  .animate-fade-in-up,
  .animate-fade-in,
  .animate-scale-in,
  .animate-slide-in-left,
  .animate-slide-in-right,
  .animate-pulse-glow,
  .shimmer {
    animation: none;
  }
  
  .hover-lift,
  .hover-scale,
  .card-feature,
  .btn-gradient {
    transition: none;
  }
}
