/* DrawAFish Animation Library - Ocean-themed Animations */

/* ========================================
   Basic Animations
   ======================================== */

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

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.fade-in-slow {
  animation: fadeIn 1s ease forwards;
}

/* Fade Out */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

/* Slide Animations */
@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-in-up {
  animation: slideInUp 0.5s ease forwards;
}

@keyframes slideInDown {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-in-down {
  animation: slideInDown 0.5s ease forwards;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-left {
  animation: slideInLeft 0.5s ease forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.5s ease forwards;
}

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

.scale-in {
  animation: scaleIn 0.3s ease forwards;
}

@keyframes scaleUp {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

.scale-up-hover:hover {
  animation: scaleUp 0.2s ease forwards;
}

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

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

.bounce-once {
  animation: bounce 0.5s ease;
}

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

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

/* Shake Animation */
@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.5s ease;
}

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

.spin {
  animation: spin 1s linear infinite;
}

.spin-slow {
  animation: spin 3s linear infinite;
}

/* ========================================
   Ocean-Themed Animations
   ======================================== */

/* Swimming Fish Animation */
@keyframes swim {
  0%, 100% {
    transform: translateX(0) rotateY(0);
  }
  25% {
    transform: translateX(10px) rotateY(5deg);
  }
  75% {
    transform: translateX(-10px) rotateY(-5deg);
  }
}

.swim {
  animation: swim 3s ease infinite;
}

/* Fish Wiggle */
@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(3deg);
  }
  75% {
    transform: rotate(-3deg);
  }
}

.wiggle {
  animation: wiggle 0.5s ease infinite;
}

/* Float Animation (for bubbles) */
@keyframes float-up {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

.float-up {
  animation: float-up 10s infinite;
}

/* Bubble Animation */
@keyframes bubble {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-50vh) scale(1.2);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100vh) scale(0.8);
    opacity: 0;
  }
}

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

/* Wave Animation */
@keyframes wave {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.wave {
  animation: wave 4s linear infinite;
}

/* Sway Animation (for seaweed) */
@keyframes sway {
  0%, 100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

.sway {
  transform-origin: bottom center;
  animation: sway 3s ease-in-out infinite;
}

/* Shimmer Animation (for water surface) */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

/* Ripple Animation */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  animation: ripple 0.6s ease-out;
}

/* Dive Animation */
@keyframes dive {
  0% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(30px) rotate(10deg);
  }
  100% {
    transform: translateY(0) rotate(0);
  }
}

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

/* ========================================
   Loading Animations
   ======================================== */

/* Dots Loading */
@keyframes dots-loading {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.dots-loading {
  display: inline-flex;
  gap: 4px;
}

.dots-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-ocean);
  animation: dots-loading 1.4s infinite ease-in-out;
}

.dots-loading span:nth-child(1) {
  animation-delay: -0.32s;
}

.dots-loading span:nth-child(2) {
  animation-delay: -0.16s;
}

/* Water Loading */
@keyframes water-loading {
  0% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(-20px) scaleY(0.5);
  }
  100% {
    transform: translateY(0) scaleY(1);
  }
}

.water-loading {
  display: inline-flex;
  gap: 4px;
  align-items: flex-end;
  height: 40px;
}

.water-loading span {
  width: 4px;
  height: 100%;
  background: var(--primary-ocean);
  border-radius: var(--radius-sm);
  animation: water-loading 1s infinite ease-in-out;
}

.water-loading span:nth-child(1) {
  animation-delay: 0s;
}

.water-loading span:nth-child(2) {
  animation-delay: 0.1s;
}

.water-loading span:nth-child(3) {
  animation-delay: 0.2s;
}

.water-loading span:nth-child(4) {
  animation-delay: 0.3s;
}

.water-loading span:nth-child(5) {
  animation-delay: 0.4s;
}

/* ========================================
   Interactive Animations
   ======================================== */

/* Hover Float */
@keyframes hover-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.hover-float:hover {
  animation: hover-float 0.5s ease;
}

/* Click Shrink */
@keyframes click-shrink {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
}

.click-shrink:active {
  animation: click-shrink 0.2s ease;
}

/* Glow Animation */
@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(0, 119, 190, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 119, 190, 0.8), 0 0 30px rgba(0, 119, 190, 0.6);
  }
  100% {
    box-shadow: 0 0 5px rgba(0, 119, 190, 0.5);
  }
}

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

/* ========================================
   Sequential Animations
   ======================================== */

/* Staggered Fade In */
.stagger-fade-in > * {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

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

/* Cascade Slide */
.cascade-slide > * {
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.5s ease forwards;
}

.cascade-slide > *:nth-child(1) { animation-delay: 0.05s; }
.cascade-slide > *:nth-child(2) { animation-delay: 0.1s; }
.cascade-slide > *:nth-child(3) { animation-delay: 0.15s; }
.cascade-slide > *:nth-child(4) { animation-delay: 0.2s; }
.cascade-slide > *:nth-child(5) { animation-delay: 0.25s; }

/* ========================================
   Special Effects
   ======================================== */

/* Rainbow Animation */
@keyframes rainbow {
  0% { color: #FF6B6B; }
  16% { color: #FFD93D; }
  33% { color: #6BCF7F; }
  50% { color: #4ECDC4; }
  66% { color: #4E89AE; }
  83% { color: #836FFF; }
  100% { color: #FF6B6B; }
}

.rainbow-text {
  animation: rainbow 5s linear infinite;
}

/* Underwater Effect */
@keyframes underwater {
  0%, 100% {
    filter: brightness(1) blur(0px);
  }
  50% {
    filter: brightness(1.1) blur(1px);
  }
}

.underwater {
  animation: underwater 4s ease infinite;
}

/* Sparkle Effect */
@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.sparkle {
  position: relative;
}

.sparkle::before,
.sparkle::after {
  content: '✨';
  position: absolute;
  animation: sparkle 2s ease infinite;
}

.sparkle::before {
  top: -10px;
  left: -10px;
  animation-delay: 0s;
}

.sparkle::after {
  bottom: -10px;
  right: -10px;
  animation-delay: 1s;
}

/* ========================================
   Utility Classes
   ======================================== */

.animation-delay-1 { animation-delay: 0.1s; }
.animation-delay-2 { animation-delay: 0.2s; }
.animation-delay-3 { animation-delay: 0.3s; }
.animation-delay-4 { animation-delay: 0.4s; }
.animation-delay-5 { animation-delay: 0.5s; }
.animation-delay-6 { animation-delay: 0.6s; }
.animation-delay-7 { animation-delay: 0.7s; }
.animation-delay-8 { animation-delay: 0.8s; }
.animation-delay-9 { animation-delay: 0.9s; }
.animation-delay-10 { animation-delay: 1s; }

.animation-duration-fast { animation-duration: 0.3s; }
.animation-duration-normal { animation-duration: 0.5s; }
.animation-duration-slow { animation-duration: 1s; }
.animation-duration-slower { animation-duration: 2s; }

.animation-infinite { animation-iteration-count: infinite; }
.animation-once { animation-iteration-count: 1; }
.animation-twice { animation-iteration-count: 2; }

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}