/**
 * Animations & Micro-interactions
 * Bora Akü Website Modernization
 */

/* ============================================
   PAGE LOAD ANIMATIONS
   ============================================ */

@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: pageFadeIn 0.5s ease-out;
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================ */

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

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Delays for Multiple Elements */
.animate-on-scroll:nth-child(1).animate-in { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2).animate-in { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3).animate-in { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4).animate-in { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5).animate-in { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(6).animate-in { transition-delay: 0.6s; }

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Float In - For Banner Logo */
@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide Up */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide Down */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Rotate In */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */

/* Icon Bounce on Hover */
@keyframes iconBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.icon-bounce:hover {
  animation: iconBounce 0.6s ease-in-out;
}

/* Icon Spin */
@keyframes iconSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.icon-spin:hover {
  animation: iconSpin 0.8s ease-in-out;
}

/* Icon Shake */
@keyframes iconShake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.icon-shake:hover {
  animation: iconShake 0.4s ease-in-out;
}

/* Icon Pulse */
@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

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

/* ============================================
   SHIMMER / LOADING EFFECT
   ============================================ */

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer-loading {
  background: linear-gradient(
    90deg,
    var(--color-bg-secondary) 0%,
    var(--color-bg-tertiary) 50%,
    var(--color-bg-secondary) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ============================================
   FLOATING ANIMATION
   ============================================ */

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

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

/* ============================================
   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 3s ease infinite;
}

/* ============================================
   GLOW EFFECT
   ============================================ */

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.6);
  }
}

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

/* ============================================
   RIPPLE EFFECT (for buttons)
   ============================================ */

@keyframes ripple {
  0% {
    width: 0;
    height: 0;
    opacity: 0.5;
  }
  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

/* ============================================
   PROGRESS BAR ANIMATION
   ============================================ */

@keyframes progressBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.progress-animate {
  animation: progressBar 2s ease-in-out;
}

/* ============================================
   TYPEWRITER EFFECT
   ============================================ */

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

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

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

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
  position: relative;
  overflow: hidden;
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ============================================
   COUNTER ANIMATION (for numbers)
   ============================================ */

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

.count-up {
  animation: countUp 0.8s ease-out;
}

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

/* Lift Effect */
.card-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-2xl);
}

/* Tilt Effect */
@keyframes tilt {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-2deg);
  }
  75% {
    transform: rotate(2deg);
  }
}

.card-tilt:hover {
  animation: tilt 0.3s ease-in-out;
}

/* ============================================
   TEXT EFFECTS
   ============================================ */

/* Gradient Text Animation */
@keyframes gradientText {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.gradient-text {
  background: var(--gradient-primary);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientText 3s ease infinite;
}

/* Text Reveal Animation */
@keyframes textReveal {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}

.text-reveal {
  animation: textReveal 1s cubic-bezier(0.77, 0, 0.175, 1);
}

/* ============================================
   SCROLL INDICATORS
   ============================================ */

@keyframes scrollIndicator {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(10px);
    opacity: 0.5;
  }
}

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

/* ============================================
   PARALLAX EFFECT (lightweight)
   ============================================ */

.parallax {
  transform: translateZ(0);
  will-change: transform;
}

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

.scale-hover {
  transition: transform var(--transition-base);
}

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

.scale-hover-sm:hover {
  transform: scale(1.02);
}

.scale-hover-lg:hover {
  transform: scale(1.1);
}

/* ============================================
   SLIDE REVEAL
   ============================================ */

@keyframes slideReveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.slide-reveal {
  animation: slideReveal 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

/* ============================================
   ACCESSIBILITY - Reduced Motion
   ============================================ */

@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;
  }

  .float,
  .icon-pulse,
  .gradient-animate,
  .glow {
    animation: none !important;
  }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Will-change for animations */
.animate-on-scroll,
.card,
.btn,
.choose-icon,
.icon-bounce,
.icon-spin {
  will-change: transform, opacity;
}

/* GPU Acceleration */
.banner,
.choose-icon,
.card,
.btn {
  transform: translateZ(0);
  backface-visibility: hidden;
}
