/**
 * Premium UI Effects - MyInvest24
 * Version: 1.0
 * 
 * Elegante, exklusive Micro-Interactions
 * - Subtil aber wirkungsvoll
 * - Nicht überladen, sondern premium
 */

/* ===========================================
   1. SMOOTH SCROLL REVEAL ANIMATIONS
   Elemente erscheinen sanft beim Scrollen
   =========================================== */

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

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal für Gruppen */
.reveal-group .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-group .reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal-group .reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal-group .reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal-group .reveal:nth-child(5) { transition-delay: 0.4s; }
.reveal-group .reveal:nth-child(6) { transition-delay: 0.5s; }

/* ===========================================
   2. MAGNETIC BUTTON EFFECT
   Buttons folgen leicht der Maus
   =========================================== */

.magnetic-btn {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.magnetic-btn:hover {
  /* JS steuert die genaue Position */
}

/* ===========================================
   3. GLASSMORPHISM EFFECT
   Elegante Transparenz + Blur
   =========================================== */

.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass--dark {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass--accent {
  background: rgba(3, 105, 161, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(3, 105, 161, 0.15);
}

/* ===========================================
   4. SUBTLE PARALLAX
   Tiefenwirkung beim Scrollen (via JS)
   =========================================== */

.parallax-slow {
  will-change: transform;
  transition: transform 0.1s linear;
}

.parallax-medium {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ===========================================
   5. CARD LIFT + GLOW HOVER
   Premium Hover-Effekt für Karten
   =========================================== */

.card-premium {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-premium:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 20px 40px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(3, 105, 161, 0.1),
    0 0 30px rgba(3, 105, 161, 0.08);
}

/* Für bestehende Feature-Cards */
.feature-card,
.service-card,
.process-step,
.stat-card {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease;
}

.feature-card:hover,
.service-card:hover,
.process-step:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 20px 40px rgba(15, 23, 42, 0.1),
    0 0 30px rgba(3, 105, 161, 0.08);
  border-color: rgba(3, 105, 161, 0.2);
}

.stat-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 12px 30px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(3, 105, 161, 0.06);
}

/* ===========================================
   6. ANIMATED LINK UNDERLINE
   Elegante Unterstreichung von links
   =========================================== */

.link-animated {
  position: relative;
  text-decoration: none;
  color: inherit;
}

.link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0369a1, #0284c7);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-animated:hover::after {
  width: 100%;
}

/* Footer und Nav Links */
.footer a:not(.btn),
.header__link {
  position: relative;
}

.footer a:not(.btn)::after,
.header__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer a:not(.btn):hover::after,
.header__link:hover::after {
  width: 100%;
}

/* ===========================================
   7. BUTTON RIPPLE EFFECT
   Sanfter Klick-Effekt
   =========================================== */

.btn,
.funnel-btn,
.header__cta {
  position: relative;
  overflow: hidden;
}

.btn::before,
.funnel-btn::before,
.header__cta::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
  opacity: 0;
}

.btn:active::before,
.funnel-btn:active::before,
.header__cta:active::before {
  width: 300px;
  height: 300px;
  opacity: 0;
}

/* Ripple Animation Keyframes */
@keyframes ripple {
  0% {
    width: 0;
    height: 0;
    opacity: 0.5;
  }
  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

/* ===========================================
   8. CONSISTENT BORDER-RADII SYSTEM
   8px, 16px, 24px System
   =========================================== */

:root {
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
}

/* ===========================================
   9. CONSISTENT SHADOW SYSTEM
   Subtle, Medium, Elevated
   =========================================== */

:root {
  /* Subtle - für flache Elemente */
  --shadow-subtle: 
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 2px 4px rgba(15, 23, 42, 0.04);
  
  /* Medium - für Cards */
  --shadow-medium: 
    0 4px 12px rgba(15, 23, 42, 0.06),
    0 8px 24px rgba(15, 23, 42, 0.06);
  
  /* Elevated - für Hover/Focus */
  --shadow-elevated: 
    0 12px 32px rgba(15, 23, 42, 0.1),
    0 20px 48px rgba(15, 23, 42, 0.08);
  
  /* Glow - für Accent-Elemente */
  --shadow-glow: 
    0 0 20px rgba(3, 105, 161, 0.15),
    0 0 40px rgba(3, 105, 161, 0.1);
}

/* ===========================================
   10. COLOR ACCENT DOTS
   Elegante blaue Punkte bei Überschriften
   =========================================== */

.section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section__eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, #0369a1, #0284c7);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
  }
  50% { 
    opacity: 0.7; 
    transform: scale(0.9);
  }
}

/* ===========================================
   SCROLL REVEAL JAVASCRIPT
   Füge dieses Script am Ende der Seite ein
   =========================================== */

/* 
<script>
// Scroll Reveal
const revealElements = document.querySelectorAll('.reveal, .feature-card, .stat-card, .process-step, .service-card, .faq-item');

const revealOnScroll = () => {
  revealElements.forEach(el => {
    const rect = el.getBoundingClientRect();
    const isVisible = rect.top < window.innerHeight - 100;
    if (isVisible) {
      el.classList.add('revealed');
    }
  });
};

// Initial check
revealOnScroll();

// Throttled scroll listener
let ticking = false;
window.addEventListener('scroll', () => {
  if (!ticking) {
    window.requestAnimationFrame(() => {
      revealOnScroll();
      ticking = false;
    });
    ticking = true;
  }
});

// Magnetic Button Effect
document.querySelectorAll('.btn--primary, .header__cta').forEach(btn => {
  btn.addEventListener('mousemove', (e) => {
    const rect = btn.getBoundingClientRect();
    const x = e.clientX - rect.left - rect.width / 2;
    const y = e.clientY - rect.top - rect.height / 2;
    btn.style.transform = `translate(${x * 0.15}px, ${y * 0.15}px)`;
  });
  
  btn.addEventListener('mouseleave', () => {
    btn.style.transform = 'translate(0, 0)';
  });
});

// Subtle Parallax
const parallaxElements = document.querySelectorAll('.hero__image, .page-hero__image');
window.addEventListener('scroll', () => {
  const scrolled = window.pageYOffset;
  parallaxElements.forEach(el => {
    el.style.transform = `translateY(${scrolled * 0.1}px)`;
  });
});
</script>
*/

/* ===========================================
   REDUCED MOTION SUPPORT
   Respektiert Benutzereinstellungen
   =========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
  }
}
