/* Apple-Style Animationen für ProfiAI Website */

/* Parallax Effekte */
.parallax-section {
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  will-change: transform;
}

/* Smooth Scroll Effekt */
html.smooth-scroll {
  scroll-behavior: smooth;
}

/* Fade-In Animationen */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Fade-In für Listen */
.stagger-fade-in > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-fade-in.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-fade-in.visible > *:nth-child(1) { transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s; }
.stagger-fade-in.visible > *:nth-child(2) { transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s; }
.stagger-fade-in.visible > *:nth-child(3) { transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s; }
.stagger-fade-in.visible > *:nth-child(4) { transition: opacity 0.5s ease 0.4s, transform 0.5s ease 0.4s; }
.stagger-fade-in.visible > *:nth-child(5) { transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s; }
.stagger-fade-in.visible > *:nth-child(6) { transition: opacity 0.5s ease 0.6s, transform 0.5s ease 0.6s; }
.stagger-fade-in.visible > *:nth-child(7) { transition: opacity 0.5s ease 0.7s, transform 0.5s ease 0.7s; }
.stagger-fade-in.visible > *:nth-child(8) { transition: opacity 0.5s ease 0.8s, transform 0.5s ease 0.8s; }
.stagger-fade-in.visible > *:nth-child(9) { transition: opacity 0.5s ease 0.9s, transform 0.5s ease 0.9s; }
.stagger-fade-in.visible > *:nth-child(n+10) { transition: opacity 0.5s ease 1s, transform 0.5s ease 1s; }

/* Scale-In Animation */
.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 1s ease, transform 1s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Slide-In Animationen */
.slide-in-left {
  opacity: 0;
  transform: translateX(-100px);
  transition: opacity 1s ease, transform 1s ease;
}

.slide-in-right {
  opacity: 0;
  transform: translateX(100px);
  transition: opacity 1s ease, transform 1s ease;
}

.slide-in-left.visible,
.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Rotate-In Animation */
.rotate-in {
  opacity: 0;
  transform: rotate(-10deg) scale(0.8);
  transition: opacity 1s ease, transform 1s ease;
}

.rotate-in.visible {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Blur-In Animation */
.blur-in {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 1s ease, filter 1s ease;
}

.blur-in.visible {
  opacity: 1;
  filter: blur(0);
}

/* Sticky Header Animation */
.header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.header.scrolled {
  background-color: rgba(28, 28, 30, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header.hidden {
  transform: translateY(-100%);
}

/* Hero Animationen */
.hero-title-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-title.visible .hero-title-char {
  opacity: 1;
  transform: translateY(0);
}

/* Floating Animation für Hero Image */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0px);
  }
}

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

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

/* Gradient Text Animation - Apple Style */
@keyframes gradient-text {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-text {
  background: linear-gradient(90deg,
    var(--primary-color),
    var(--secondary-color),
    var(--info-color),
    var(--primary-color));
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-text 8s ease infinite;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Hover Effekte für Karten */
.feature-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
}

.feature-card.animate {
  opacity: 1;
  transform: translateY(0);
  animation: card-fade-in 0.6s forwards;
}

@keyframes card-fade-in {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-card:hover, .pricing-card:hover, .testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Scroll-Triggered Animation für Bilder */
.scroll-image {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-image.visible {
  opacity: 1;
  transform: scale(1);
}

/* Pulse Animation */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(74, 20, 140, 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(74, 20, 140, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(74, 20, 140, 0);
  }
}

.pulse-on-hover:hover {
  animation: pulse 2s infinite;
}

/* Für Elemente, die nur bei Sichtbarkeit pulsieren sollen */
.pulse-on-visible.visible {
  animation: pulse 2s infinite;
}

/* Shine Effect für Buttons */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  transition: transform 0.7s;
  opacity: 0;
}

.btn-shine:hover::after {
  transform: rotate(30deg) translate(100%, 100%);
  opacity: 1;
}

/* 3D Tilt Effect */
.tilt-element {
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Scroll Progress Bar */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1000;
}

.scroll-progress {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transition: width 0.1s;
}

/* Reveal Animation */
.reveal-container {
  position: relative;
  overflow: hidden;
}

.reveal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  transform: translateX(-100%);
  z-index: 1;
}

.reveal-content {
  opacity: 0;
}

.reveal-container.visible .reveal-overlay {
  transform: translateX(100%);
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.reveal-container.visible .reveal-content {
  opacity: 1;
  transition: opacity 0.5s ease 0.5s;
}

/* Magnetic Buttons */
.magnetic-button {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  will-change: transform;
}

/* Scroll-to-Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, background-color 0.2s;
  z-index: 90;
}

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

.scroll-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.scroll-to-top:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Image Animations */
.animated-image, .feature-image, .benefit-image {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animated-image.visible, .feature-image.visible, .benefit-image.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Button Hover Animation */
.btn, .btn-primary, .btn-secondary, .pricing-button {
  position: relative;
  overflow: hidden;
}

.btn::after, .btn-primary::after, .btn-secondary::after, .pricing-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:hover::after, .btn-primary:hover::after, .btn-secondary:hover::after, .pricing-button:hover::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* Highlight animation */
.highlight {
  position: relative;
  z-index: 1;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background-color: rgba(74, 20, 140, 0.2);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.highlight.visible::after {
  transform: scaleX(1);
}

/* Background Shapes Animation */
.background-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.shape {
  position: absolute;
  opacity: 0.05;
  animation: shape-float 15s infinite alternate;
  background: var(--primary-color);
}

.shape:nth-child(2n) {
  background: var(--accent-color);
  animation-duration: 17s;
}

.shape:nth-child(3n) {
  animation-duration: 19s;
  animation-delay: 2s;
}

@keyframes shape-float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(20px, 20px) rotate(360deg);
  }
}

/* Mobile Animation Optimization */
@media (prefers-reduced-motion) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }
  
  .floating, .pulse {
    animation: none;
  }
  
  .fade-in, .stagger-fade-in, .reveal-section {
    transition-duration: 0.4s;
  }
}
