/* ================================================
   MALER BERLIN - Animation Styles
   AOS & Custom Animation Classes
   ================================================ */

/* ================================================
   TEXT REVEAL ANIMATIONS
   ================================================ */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
}

.text-reveal.revealed span {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s ease;
}

/* Split text animation */
.split-text .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(50px) rotate(10deg);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-text.animate .char {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

/* ================================================
   FADE ANIMATIONS
   ================================================ */
.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
}

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.fade-down {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.fade-left {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-right {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ================================================
   SCALE ANIMATIONS
   ================================================ */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scale-up {
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ================================================
   SLIDE ANIMATIONS
   ================================================ */
.slide-in-left {
  opacity: 0;
  transform: translateX(-100px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.slide-in-right {
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.slide-in-up {
  opacity: 0;
  transform: translateY(100px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ================================================
   ROTATE ANIMATIONS
   ================================================ */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate {
  animation: rotate 20s linear infinite;
}

.rotate-slow {
  animation: rotate 40s linear infinite;
}

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

.rotate-reverse {
  animation: rotateBack 30s linear infinite;
}

/* ================================================
   BOUNCE ANIMATIONS
   ================================================ */
@keyframes bounce {
  0%,
  20%,
  53%,
  100% {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translateY(0);
  }
  40%,
  43% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translateY(-15px);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translateY(-7px);
  }
  80% {
    transform: translateY(0);
  }
  90% {
    transform: translateY(-3px);
  }
}

.bounce {
  animation: bounce 2s ease infinite;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.bounce-in {
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ================================================
   PULSE ANIMATIONS
   ================================================ */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

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

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(255, 107, 53, 0);
  }
}

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

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

.shake {
  animation: shake 0.8s ease-in-out;
}

/* ================================================
   FLOAT ANIMATIONS
   ================================================ */
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(2deg);
  }
  75% {
    transform: translateY(5px) rotate(-2deg);
  }
}

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

@keyframes floatSlow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.float-slow {
  animation: floatSlow 8s ease-in-out infinite;
}

/* ================================================
   GLOW ANIMATIONS
   ================================================ */
@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(255, 107, 53, 0.5),
      0 0 10px rgba(255, 107, 53, 0.3), 0 0 15px rgba(255, 107, 53, 0.2);
  }
  50% {
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.8),
      0 0 20px rgba(255, 107, 53, 0.5), 0 0 30px rgba(255, 107, 53, 0.3);
  }
}

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

/* ================================================
   WAVE ANIMATIONS
   ================================================ */
@keyframes wave {
  0%,
  100% {
    transform: rotate(0deg);
  }
  20%,
  60% {
    transform: rotate(-25deg);
  }
  40%,
  80% {
    transform: rotate(10deg);
  }
}

.wave {
  animation: wave 2s ease-in-out infinite;
  transform-origin: 70% 70%;
}

/* ================================================
   TYPEWRITER EFFECT
   ================================================ */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCursor {
  0%,
  100% {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary);
  }
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--primary);
  animation: typing 3s steps(40, end), blinkCursor 0.75s step-end infinite;
}

/* ================================================
   UNDERLINE ANIMATIONS
   ================================================ */
.underline-hover {
  position: relative;
}

.underline-hover::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.underline-hover:hover::after {
  width: 100%;
}

.underline-center {
  position: relative;
}

.underline-center::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease, left 0.3s ease;
}

.underline-center:hover::after {
  width: 100%;
  left: 0;
}

/* ================================================
   IMAGE REVEAL ANIMATIONS
   ================================================ */
.img-reveal {
  position: relative;
  overflow: hidden;
}

.img-reveal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transform: translateX(-101%);
  z-index: 1;
}

.img-reveal.reveal::before {
  animation: imgReveal 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal img {
  transform: scale(1.3);
  transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal.reveal img {
  transform: scale(1);
}

@keyframes imgReveal {
  0% {
    transform: translateX(-101%);
  }
  50% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(101%);
  }
}

/* ================================================
   PARALLAX EFFECT CLASSES
   ================================================ */
.parallax {
  will-change: transform;
}

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

.parallax-medium {
  transition: transform 0.05s linear;
}

.parallax-fast {
  transition: transform 0.02s linear;
}

/* ================================================
   TILT CARD EFFECT
   ================================================ */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.tilt-card .tilt-content {
  transform: translateZ(30px);
}

/* ================================================
   GRADIENT ANIMATION
   ================================================ */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

/* ================================================
   BLUR ANIMATIONS
   ================================================ */
@keyframes blurIn {
  0% {
    opacity: 0;
    filter: blur(20px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

.blur-in {
  animation: blurIn 0.8s ease forwards;
}

/* ================================================
   STAGGER ANIMATION DELAYS
   ================================================ */
.stagger-1 {
  transition-delay: 0.1s;
}
.stagger-2 {
  transition-delay: 0.2s;
}
.stagger-3 {
  transition-delay: 0.3s;
}
.stagger-4 {
  transition-delay: 0.4s;
}
.stagger-5 {
  transition-delay: 0.5s;
}
.stagger-6 {
  transition-delay: 0.6s;
}
.stagger-7 {
  transition-delay: 0.7s;
}
.stagger-8 {
  transition-delay: 0.8s;
}
.stagger-9 {
  transition-delay: 0.9s;
}
.stagger-10 {
  transition-delay: 1s;
}

/* ================================================
   LOADING SKELETON
   ================================================ */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 0%,
    var(--gray-100) 50%,
    var(--gray-200) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ================================================
   CURSOR EFFECTS
   ================================================ */
.cursor-grow {
  transition: transform 0.3s ease;
}

.cursor-grow:hover {
  transform: scale(1.1);
  cursor: pointer;
}

/* ================================================
   MORPH ANIMATIONS
   ================================================ */
@keyframes morph {
  0%,
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
}

.morph {
  animation: morph 8s ease-in-out infinite;
}

/* ================================================
   CLIP PATH REVEAL
   ================================================ */
.clip-reveal {
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  transition: clip-path 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.clip-reveal.visible {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.clip-reveal-circle {
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.clip-reveal-circle.visible {
  clip-path: circle(100% at 50% 50%);
}

/* ================================================
   FLIP ANIMATIONS
   ================================================ */
@keyframes flipInX {
  0% {
    transform: perspective(400px) rotateX(90deg);
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotateX(-10deg);
  }
  70% {
    transform: perspective(400px) rotateX(10deg);
  }
  100% {
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
}

.flip-in-x {
  animation: flipInX 0.8s ease;
}

@keyframes flipInY {
  0% {
    transform: perspective(400px) rotateY(90deg);
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotateY(-10deg);
  }
  70% {
    transform: perspective(400px) rotateY(10deg);
  }
  100% {
    transform: perspective(400px) rotateY(0deg);
    opacity: 1;
  }
}

.flip-in-y {
  animation: flipInY 0.8s ease;
}

/* ================================================
   ATTENTION SEEKERS
   ================================================ */
@keyframes rubberBand {
  0% {
    transform: scaleX(1);
  }
  30% {
    transform: scale3d(1.25, 0.75, 1);
  }
  40% {
    transform: scale3d(0.75, 1.25, 1);
  }
  50% {
    transform: scale3d(1.15, 0.85, 1);
  }
  65% {
    transform: scale3d(0.95, 1.05, 1);
  }
  75% {
    transform: scale3d(1.05, 0.95, 1);
  }
  100% {
    transform: scaleX(1);
  }
}

.rubber-band {
  animation: rubberBand 1s ease;
}

@keyframes jello {
  0%,
  11.1%,
  100% {
    transform: none;
  }
  22.2% {
    transform: skewX(-12.5deg) skewY(-12.5deg);
  }
  33.3% {
    transform: skewX(6.25deg) skewY(6.25deg);
  }
  44.4% {
    transform: skewX(-3.125deg) skewY(-3.125deg);
  }
  55.5% {
    transform: skewX(1.5625deg) skewY(1.5625deg);
  }
  66.6% {
    transform: skewX(-0.78125deg) skewY(-0.78125deg);
  }
  77.7% {
    transform: skewX(0.390625deg) skewY(0.390625deg);
  }
  88.8% {
    transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
  }
}

.jello {
  animation: jello 1s ease;
}

/* ================================================
   COUNTER ANIMATION
   ================================================ */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ================================================
   SMOOTH SCROLL INDICATOR
   ================================================ */
@keyframes scrollIndicator {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  30% {
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(10px);
  }
}

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

/* ================================================
   BRUSH STROKE EFFECT
   ================================================ */
@keyframes brushStroke {
  0% {
    stroke-dashoffset: 1000;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.brush-stroke path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: brushStroke 2s ease forwards;
}

/* ================================================
   REDUCED MOTION SUPPORT
   ================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
