/**
 * Nikola Janjic - Visual Enhancements
 * Modern animations, glassmorphism, and improved UX
 */

/* ==========================================
   LIGHT MODE THEME VARIABLES
   ========================================== */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --gray-bg: #f1f5f9;
}

[data-theme="light"] .header {
  background: rgba(248, 250, 252, 0.9);
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .hero::before {
  background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
}

[data-theme="light"] .hero h1 {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .feature-card,
[data-theme="light"] .pricing-card,
[data-theme="light"] .blog-card,
[data-theme="light"] .testimonial-card,
[data-theme="light"] .faq-item {
  background: var(--bg-card);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .social-sidebar a {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .footer {
  background: #0f172a;
  color: #f8fafc;
}

[data-theme="light"] .footer h4,
[data-theme="light"] .footer-heading,
[data-theme="light"] .footer .logo-text {
  color: #f8fafc;
}

[data-theme="light"] .footer p,
[data-theme="light"] .footer-links a,
[data-theme="light"] .footer-bottom p,
[data-theme="light"] .footer-legal a {
  color: rgba(248, 250, 252, 0.7);
}

/* ==========================================
   THEME TOGGLE BUTTON
   ========================================== */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: 1rem;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

[data-theme="light"] .theme-toggle {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

@media (max-width: 768px) {
  .theme-toggle {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
  }

  .theme-toggle:hover {
    transform: translateY(-50%) scale(1.05);
  }
}

/* ==========================================
   ENHANCED SCROLL ANIMATIONS
   ========================================== */

/* Fade up with stagger */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for grid items */
[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }
[data-reveal-delay="5"] { transition-delay: 0.5s; }
[data-reveal-delay="6"] { transition-delay: 0.6s; }

/* Slide from left */
[data-reveal="left"] {
  transform: translateX(-60px);
}

[data-reveal="left"].revealed {
  transform: translateX(0);
}

/* Slide from right */
[data-reveal="right"] {
  transform: translateX(60px);
}

[data-reveal="right"].revealed {
  transform: translateX(0);
}

/* Scale up */
[data-reveal="scale"] {
  transform: scale(0.9);
}

[data-reveal="scale"].revealed {
  transform: scale(1);
}

/* Blur in */
[data-reveal="blur"] {
  filter: blur(10px);
  transform: translateY(20px);
}

[data-reveal="blur"].revealed {
  filter: blur(0);
  transform: translateY(0);
}

/* ==========================================
   CARD STYLES (simplified for performance)
   ========================================== */
.glass-card {
  background: rgba(26, 26, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ==========================================
   ENHANCED HOVER EFFECTS
   ========================================== */

/* Magnetic hover effect for buttons */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3),
              0 0 60px rgba(99, 102, 241, 0.2);
}

/* Card tilt effect on hover */
.feature-card,
.blog-card,
.pricing-card {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.blog-card:hover {
  transform: translateY(-8px);
}

/* Image zoom effect */
.blog-image img,
.feature-icon img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover .blog-image img,
.feature-card:hover .feature-icon img {
  transform: scale(1.08);
}

/* Link underline animation */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Testimonial card hover */
.testimonial-card {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.testimonial-card:hover {
  transform: translateY(-6px) scale(1.02);
  background: rgba(26, 26, 26, 0.8);
  border-color: rgba(99, 102, 241, 0.2);
}

/* ==========================================
   ENHANCED SHADOWS & DEPTH
   ========================================== */

/* Layered shadow for depth */
.pricing-card.featured {
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3),
              0 4px 12px rgba(99, 102, 241, 0.1),
              0 16px 40px rgba(99, 102, 241, 0.15),
              0 32px 80px rgba(99, 102, 241, 0.1);
}

/* Glow effects */
.hero-badge {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.live-badge {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* ==========================================
   IMPROVED SPACING & TYPOGRAPHY
   ========================================== */

/* Better section spacing */
.section {
  position: relative;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 1000px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

.section:first-of-type::before {
  display: none;
}

/* Section header improvements */
.section-header {
  position: relative;
}

.section-header h2 {
  position: relative;
  display: inline-block;
}

/* ==========================================
   ENHANCED MOBILE EXPERIENCE
   ========================================== */

@media (max-width: 768px) {
  /* Hide cookie banner on mobile */
  .cookie-banner {
    display: none !important;
  }

  /* Mobile menu - solid background for performance */
  .nav {
    background: rgba(10, 10, 10, 0.99);
  }

  [data-theme="light"] .nav {
    background: rgba(248, 250, 252, 0.99);
  }

  /* Better touch targets */
  .btn {
    min-height: 52px;
    padding: 1rem 1.5rem;
  }

  .nav-link {
    min-height: 56px;
    display: flex;
    align-items: center;
  }

  /* Improved card spacing on mobile */
  .feature-card,
  .pricing-card,
  .blog-card {
    margin-bottom: 1rem;
  }

  /* Disable heavy effects on mobile for performance */
  .feature-card:hover,
  .blog-card:hover,
  .testimonial-card:hover {
    transform: none;
  }

  /* Reduce animation distances on mobile */
  [data-reveal] {
    transform: translateY(20px);
  }

  [data-reveal="left"],
  [data-reveal="right"] {
    transform: translateY(20px);
  }
}

/* ==========================================
   SCROLL INDICATOR
   ========================================== */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.scroll-indicator:hover {
  opacity: 1;
}

.scroll-indicator span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.scroll-indicator-arrow {
  width: 24px;
  height: 24px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  position: relative;
  animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-indicator-arrow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translate(-50%, -70%) rotate(45deg);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (max-width: 768px) {
  .scroll-indicator {
    display: none;
  }
}

/* ==========================================
   GRADIENT TEXT EFFECTS
   ========================================== */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* Removed animation for performance - background-position is not compositor-friendly */
}

/* ==========================================
   CURSOR GLOW EFFECT (Desktop only)
   ========================================== */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: translate(-50%, -50%);
}

.cursor-glow.active {
  opacity: 1;
}

@media (max-width: 1024px) {
  .cursor-glow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-glow {
    display: none;
  }
}

/* ==========================================
   LOADING STATES
   ========================================== */
.skeleton {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  /* Simplified - removed background-position animation for performance */
}

/* ==========================================
   FOCUS STYLES (Accessibility)
   ========================================== */
.btn:focus-visible,
.nav-link:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
  .theme-toggle,
  .cursor-glow,
  .scroll-indicator {
    display: none !important;
  }
}
