/* ==========================================================================
   ACT.7 Animations & Decorations
   ========================================================================== */

/* ========================================
   KEYFRAMES
   ======================================== */

/* Peldošā animācija (zvaigznēm) */
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(10deg);
  }
}

/* Lēna peldēšana (mākoņiem) */
@keyframes drift {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100vw);
  }
}

/* Pulss efekts */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Mirdzēšana */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Fade in up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Bounce */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

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

/* Twinkle (zvaigžņu mirdzēšana) */
@keyframes twinkle {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ========================================
   DEKORATĪVIE ELEMENTI
   ======================================== */

/* Dekorāciju konteiners */
.decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Zvaigznes */
.star {
  position: absolute;
  background: var(--star-yellow);
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 3px rgba(255, 217, 61, 0.5));
}

.star--sm {
  width: 15px;
  height: 15px;
}

.star--md {
  width: 20px;
  height: 20px;
}

.star--lg {
  width: 30px;
  height: 30px;
}

/* Zvaigžņu variācijas */
.star:nth-child(2) { animation-delay: 0.5s; }
.star:nth-child(3) { animation-delay: 1s; }
.star:nth-child(4) { animation-delay: 1.5s; }
.star:nth-child(5) { animation-delay: 2s; }

/* Mākoņi */
.cloud {
  position: absolute;
  background: var(--cloud-white);
  border-radius: var(--radius-full);
  filter: blur(2px);
  animation: drift 30s linear infinite;
}

.cloud--sm {
  width: 60px;
  height: 25px;
}

.cloud--md {
  width: 100px;
  height: 40px;
}

.cloud--lg {
  width: 150px;
  height: 60px;
}

/* Mākoņu variācijas */
.cloud:nth-child(2) {
  animation-duration: 35s;
  animation-delay: 5s;
}

.cloud:nth-child(3) {
  animation-duration: 40s;
  animation-delay: 10s;
}

/* ========================================
   ANIMATION UTILITY KLASES
   ======================================== */

/* Fade in */
.animate-fade-in {
  animation: fadeIn var(--transition-slow) ease forwards;
}

/* Fade in up */
.animate-fade-in-up {
  animation: fadeInUp var(--transition-slow) ease forwards;
}

/* Scale in */
.animate-scale-in {
  animation: scaleIn var(--transition-base) ease forwards;
}

/* Pulse */
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Bounce */
.animate-bounce {
  animation: bounce 1s ease infinite;
}

/* Spin */
.animate-spin {
  animation: spin 1s linear infinite;
}

/* Hover animations */
.hover-lift {
  transition: transform var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

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

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

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

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

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ========================================
   LOADING STATES
   ======================================== */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--card-white) 25%,
    rgba(255, 255, 255, 0.5) 50%,
    var(--card-white) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent-yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   REDUCED MOTION
   ======================================== */

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

  .decorations {
    display: none;
  }
}
