/*
SK Lanka Travel - Enhanced Animations
Modern, smooth animations for better user experience
*/

/* ===========================================
   SCROLL ANIMATIONS
   =========================================== */

/* Fade in from bottom */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in from left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in from right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Rotate and scale */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* Bounce animation */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide up with stagger */
@keyframes slideUpStagger {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================================
   HOVER ANIMATIONS
   =========================================== */

/* Smooth hover lift */
@keyframes hoverLift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-10px);
  }
}

/* Pulse effect */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Shake animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Glow effect */
@keyframes glow {
  from {
    box-shadow: 0 0 5px rgba(0, 113, 248, 0.5);
  }
  to {
    box-shadow: 0 0 20px rgba(0, 113, 248, 0.8), 0 0 30px rgba(0, 113, 248, 0.6);
  }
}

/* ===========================================
   LOADING ANIMATIONS
   =========================================== */

/* Spinning loader */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Wave loading animation */
@keyframes wave {
  0%, 40%, 100% {
    transform: scaleY(0.4);
  }
  20% {
    transform: scaleY(1.0);
  }
}

/* Dots loading animation */
@keyframes dots {
  0%, 20% {
    color: rgba(0, 0, 0, 0);
    text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);
  }
  40% {
    color: #0071f8;
    text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);
  }
  60% {
    text-shadow: 0.25em 0 0 #0071f8, 0.5em 0 0 rgba(0, 0, 0, 0);
  }
  80%, 100% {
    text-shadow: 0.25em 0 0 #0071f8, 0.5em 0 0 #0071f8;
  }
}

/* ===========================================
   PARALLAX EFFECTS
   =========================================== */

/* Parallax background */
@keyframes parallax {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-50px);
  }
}

/* Floating animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* ===========================================
   ANIMATION CLASSES
   =========================================== */

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transition: all 0.8s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
  animation: fadeInRight 0.8s ease-out forwards;
}

.scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

.rotate-in {
  animation: rotateIn 0.8s ease-out forwards;
}

.bounce-in {
  animation: bounceIn 0.8s ease-out forwards;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Hover effects */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  animation: hoverLift 0.3s ease forwards;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-pulse:hover {
  animation: pulse 0.6s ease-in-out;
}

.hover-glow:hover {
  animation: glow 0.3s ease-in-out;
}

.hover-shake:hover {
  animation: shake 0.5s ease-in-out;
}

/* Button animations */
.btn-animated {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-animated:hover::before {
  left: 100%;
}

.btn-animated:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 113, 248, 0.4);
}

/* Card animations */
.card-animated {
  transition: all 0.3s ease;
  transform: translateY(0);
}

.card-animated:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Image animations */
.img-zoom {
  transition: transform 0.3s ease;
  overflow: hidden;
}

.img-zoom:hover {
  transform: scale(1.05);
}

.img-zoom img {
  transition: transform 0.3s ease;
}

.img-zoom:hover img {
  transform: scale(1.1);
}

/* Text animations */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  animation: slideUpStagger 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}

/* Loading animations */
.loading-spinner {
  animation: spin 1s linear infinite;
}

.loading-wave {
  display: inline-block;
}

.loading-wave span {
  display: inline-block;
  width: 4px;
  height: 20px;
  background: #0071f8;
  margin: 0 2px;
  animation: wave 1.2s ease-in-out infinite;
}

.loading-wave span:nth-child(2) { animation-delay: 0.1s; }
.loading-wave span:nth-child(3) { animation-delay: 0.2s; }
.loading-wave span:nth-child(4) { animation-delay: 0.3s; }
.loading-wave span:nth-child(5) { animation-delay: 0.4s; }

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(5, end) infinite;
}

/* Floating elements */
.float {
  animation: float 3s ease-in-out infinite;
}

.float-delayed {
  animation: float 3s ease-in-out infinite;
  animation-delay: 1.5s;
}

/* Parallax elements */
.parallax-slow {
  animation: parallax 20s linear infinite;
}

.parallax-fast {
  animation: parallax 10s linear infinite;
}

/* ===========================================
   SPECIFIC COMPONENT ANIMATIONS
   =========================================== */

/* Header animations */
.header-slide-down {
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Banner text animations */
.banner-text {
  animation: fadeInUp 1s ease-out 0.5s both;
}

.banner-category {
  animation: fadeInLeft 0.8s ease-out 0.2s both;
}

/* Counter animations */
.counter-animated {
  animation: countUp 2s ease-out;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tab content animations */
.tab-content {
  animation: fadeInUp 0.5s ease-out;
}

/* Modal animations */
.modal-fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Form animations */
.form-group {
  animation: fadeInUp 0.6s ease-out;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }

/* Success message animation */
.success-message {
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===========================================
   RESPONSIVE ANIMATIONS
   =========================================== */

@media (max-width: 768px) {
  .animate-on-scroll {
    animation-duration: 0.6s;
  }
  
  .hover-lift:hover {
    transform: translateY(-5px);
  }
  
  .card-animated:hover {
    transform: translateY(-5px);
  }
}

/* ===========================================
   PERFORMANCE OPTIMIZATIONS
   =========================================== */

/* Use transform and opacity for better performance */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

