/**
 * Climax Berlin - Animations CSS
 * CSS animations to replace Framer Motion
 */

/* ============================================================================
   PAGE TRANSITIONS
   ============================================================================ */

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

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

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-left {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-right {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes rotate-360 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   HERO SLIDER
   ============================================================================ */
.hero-slider {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.5s ease, transform 12s ease;
  will-change: opacity, transform;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

/* ============================================================================
   PARALLAX EFFECT
   ============================================================================ */
/* Parallax effect for hero backgrounds - creates depth on scroll */
.hero-parallax-background {
  transform: translateY(0);
  filter: blur(0px);
  transition: transform 0.1s ease-out, filter 0.2s ease-out;
  will-change: transform, filter;
}

/* Smooth parallax scrolling for hero content */
.hero-parallax-content {
  transform: translateY(0);
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* Shared layer styling for additional parallax elements */
.hero-parallax-layer {
  transform: translate3d(0, 0, 0);
  transition: transform 0.2s ease-out;
  will-change: transform;
}

/* ============================================================================
   HERO VISUAL EFFECTS (v1.1.0)
   Author: Marco Nötzold (Hagalaz Design)
   ============================================================================ */

/* Ken Burns effect for static hero backgrounds */
@keyframes ken-burns {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.08) translate(1%, -1%);
  }
  100% {
    transform: scale(1) translate(0, 0);
  }
}

.hero-ken-burns {
  animation: ken-burns 30s ease-in-out infinite;
  will-change: transform;
}

/* Noise/Grain overlay - CSS-only using SVG data URI */
.hero-noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: overlay;
}

/* Particle layer - small fairy-like bubbles rising upward */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.hero-particle {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.3;
  will-change: transform;
}

/* Upward floating animation with slight horizontal drift */
@keyframes bubble-rise-1 {
  0% {
    transform: translate(0, 0) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translate(20px, -100vh) scale(1);
    opacity: 0;
  }
}

@keyframes bubble-rise-2 {
  0% {
    transform: translate(0, 0) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translate(-15px, -100vh) scale(1);
    opacity: 0;
  }
}

@keyframes bubble-rise-3 {
  0% {
    transform: translate(0, 0) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translate(10px, -100vh) scale(1);
    opacity: 0;
  }
}

/* Small fairy-like particle styles */
.hero-particle-1 {
  width: 15px;
  height: 15px;
  bottom: -20px;
  left: 15%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.8) 0%, transparent 70%);
  animation: bubble-rise-1 8s ease-in infinite;
}

.hero-particle-2 {
  width: 12px;
  height: 12px;
  bottom: -20px;
  left: 25%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.7) 0%, transparent 70%);
  animation: bubble-rise-2 10s ease-in infinite;
  animation-delay: 1s;
}

.hero-particle-3 {
  width: 18px;
  height: 18px;
  bottom: -20px;
  left: 45%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.6) 0%, transparent 70%);
  animation: bubble-rise-3 9s ease-in infinite;
  animation-delay: 2s;
}

.hero-particle-4 {
  width: 10px;
  height: 10px;
  bottom: -20px;
  left: 60%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.8) 0%, transparent 70%);
  animation: bubble-rise-1 11s ease-in infinite;
  animation-delay: 3s;
}

.hero-particle-5 {
  width: 14px;
  height: 14px;
  bottom: -20px;
  left: 75%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.7) 0%, transparent 70%);
  animation: bubble-rise-2 8.5s ease-in infinite;
  animation-delay: 4s;
}

.hero-particle-6 {
  width: 16px;
  height: 16px;
  bottom: -20px;
  left: 35%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.6) 0%, transparent 70%);
  animation: bubble-rise-3 10.5s ease-in infinite;
  animation-delay: 1.5s;
}

.hero-particle-7 {
  width: 11px;
  height: 11px;
  bottom: -20px;
  left: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.8) 0%, transparent 70%);
  animation: bubble-rise-1 9.5s ease-in infinite;
  animation-delay: 2.5s;
}

.hero-particle-8 {
  width: 13px;
  height: 13px;
  bottom: -20px;
  left: 68%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.7) 0%, transparent 70%);
  animation: bubble-rise-2 11.5s ease-in infinite;
  animation-delay: 3.5s;
}

.hero-particle-9 {
  width: 17px;
  height: 17px;
  bottom: -20px;
  left: 82%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.6) 0%, transparent 70%);
  animation: bubble-rise-3 10s ease-in infinite;
  animation-delay: 0.5s;
}

.hero-particle-10 {
  width: 12px;
  height: 12px;
  bottom: -20px;
  left: 90%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.8) 0%, transparent 70%);
  animation: bubble-rise-1 9s ease-in infinite;
  animation-delay: 4.5s;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-ken-burns {
    animation: none;
  }
  
  .hero-particle {
    animation: none;
  }
}

/* ============================================================================
   ANIMATION CLASSES
   ============================================================================ */

.animate-fade-in {
  animation: fade-in 0.8s ease-out both;
}

.animate-slide-up {
  animation: slide-up 0.6s ease-out both;
}

.animate-slide-down {
  animation: slide-down 0.6s ease-out both;
}

.animate-slide-left {
  animation: slide-left 0.6s ease-out both;
}

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

.animate-scale-in {
  animation: scale-in 0.5s ease-out both;
}

.animate-bounce {
  animation: bounce-subtle 2s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse-glow 2s ease-in-out infinite;
}

.animate-shimmer {
  animation: shimmer 3s linear infinite;
}

.animate-spin {
  animation: rotate-360 1s linear infinite;
}

/* ============================================================================
   ANIMATION DELAYS
   ============================================================================ */

.delay-100 {
  animation-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
}

.delay-400 {
  animation-delay: 400ms;
}

.delay-500 {
  animation-delay: 500ms;
}

.delay-600 {
  animation-delay: 600ms;
}

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

[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

[data-animate="fade"] {
  transform: none;
}

[data-animate="fade"].animate-in {
  opacity: 1;
}

[data-animate="slide-up"].animate-in {
  opacity: 1;
  transform: translateY(0);
}

[data-animate="slide-left"] {
  transform: translateX(50px);
}

[data-animate="slide-left"].animate-in {
  opacity: 1;
  transform: translateX(0);
}

[data-animate="slide-right"] {
  transform: translateX(-50px);
}

[data-animate="slide-right"].animate-in {
  opacity: 1;
  transform: translateX(0);
}

[data-animate="scale"] {
  transform: scale(0.95);
}

[data-animate="scale"].animate-in {
  opacity: 1;
  transform: scale(1);
}

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

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.3);
}

.hover-glow {
  position: relative;
  transition: all 0.3s ease;
}

.hover-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}

.hover-glow:hover::after {
  opacity: 1;
}

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

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

.hover-brightness {
  transition: filter 0.3s ease;
}

.hover-brightness:hover {
  filter: brightness(1.1);
}

/* ============================================================================
   MODAL ANIMATIONS
   ============================================================================ */

.modal-backdrop {
  transition: opacity 0.3s ease;
}

.modal-content {
  animation: scale-in 0.3s ease-out;
}

/* ============================================================================
   MOBILE MENU ANIMATIONS
   ============================================================================ */

.mobile-menu {
  transition: opacity 0.3s ease;
}

.mobile-menu-item {
  opacity: 0;
  transform: translateY(20px);
  animation: slide-up 0.4s ease-out forwards;
}

.mobile-menu-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-item:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu-item:nth-child(6) { animation-delay: 0.35s; }
.mobile-menu-item:nth-child(7) { animation-delay: 0.4s; }
.mobile-menu-item:nth-child(8) { animation-delay: 0.45s; }
.mobile-menu-item:nth-child(9) { animation-delay: 0.5s; }

/* ============================================================================
   ACCORDION ANIMATIONS
   ============================================================================ */

[data-accordion-content] {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out, opacity 0.2s ease-out;
}

[data-accordion-content].active {
  opacity: 1;
  padding-top: 0;
  padding-bottom: 1rem;
  transition: max-height 0.5s ease-in, padding 0.3s ease-in, opacity 0.2s ease-in;
}

[data-accordion-icon] {
  transition: transform 0.3s ease;
}

/* ============================================================================
   LOADING SPINNER
   ============================================================================ */

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

.spinner {
  border: 3px solid rgba(168, 85, 247, 0.1);
  border-top-color: rgba(168, 85, 247, 1);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spinner 0.6s linear infinite;
}

/* ============================================================================
   PARTICLE EFFECTS
   ============================================================================ */

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  33% {
    transform: translateY(-20px) translateX(10px);
  }
  66% {
    transform: translateY(-10px) translateX(-10px);
  }
}

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

.particle:nth-child(2) {
  animation-delay: 0.5s;
  animation-duration: 3.5s;
}

.particle:nth-child(3) {
  animation-delay: 1s;
  animation-duration: 4s;
}

/* ============================================================================
   GRADIENT ANIMATIONS
   ============================================================================ */

.gradient-animate {
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ============================================================================
   SCROLL INDICATOR
   ============================================================================ */

@keyframes scroll-down {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  80% {
    transform: translateY(12px);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.scroll-indicator {
  animation: scroll-down 2s ease-in-out infinite;
}

/* ============================================================================
   FORM ANIMATIONS
   ============================================================================ */

.form-field {
  transition: all 0.3s ease;
}

.form-field:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.form-field.error {
  animation: shake 0.5s ease-in-out;
  border-color: rgb(239, 68, 68);
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* ============================================================================
   SUCCESS/ERROR MESSAGES
   ============================================================================ */

.toast {
  animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================================
   IMAGE REVEAL
   ============================================================================ */

.image-reveal {
  overflow: hidden;
  position: relative;
}

.image-reveal img {
  transition: transform 0.6s ease;
}

.image-reveal:hover img {
  transform: scale(1.1);
}

/* ============================================================================
   BUTTON EFFECTS
   ============================================================================ */

.btn-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

/* ============================================================================
   GALLERY ANIMATIONS
   ============================================================================ */

.gallery-item {
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.gallery-item.opacity-0 {
  transform: translateY(20px) scale(0.95);
}

.gallery-item.opacity-100 {
  transform: translateY(0) scale(1);
}

/* ============================================================================
   RESPONSIVE ANIMATIONS
   ============================================================================ */

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