/*
 * Modern UX Enhancements
 * Animations, micro-interactions, and visual polish
 * To rollback: Remove this file and references to it
 */

/* ========================================
   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 PROGRESS INDICATOR
   ======================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #FFCC00, #F68C14);
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* ========================================
   HERO GRADIENT MESH & PARTICLE SHIMMER
   ======================================== */

/* Gradient mesh overlay - vibrant animated background */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(at 20% 30%, rgba(42, 92, 161, 0.45) 0%, transparent 50%),
    radial-gradient(at 32% 28%, rgba(255, 204, 0, 0.5) 0%, transparent 40%),
    radial-gradient(at 60% 20%, rgba(246, 140, 20, 0.35) 0%, transparent 40%);
  mix-blend-mode: screen;
  opacity: 0.75;
  animation: meshShift 18s ease-in-out infinite alternate;
}

@keyframes meshShift {
  0% {
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(15deg);
  }
  100% {
    filter: hue-rotate(-10deg);
  }
}

/* Particle shimmer canvas container */
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Ensure hero content stays above overlays */
header .container,
header nav,
header .scroll {
  position: relative;
  z-index: 10;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-overlay {
    animation: none;
    opacity: 0.35;
  }
  .hero-particles {
    display: none;
  }
}

/* ========================================
   NAVIGATION ANIMATIONS
   ======================================== */

/* Navigation fade-in animation */
header nav {
  opacity: 0;
  animation: fadeInDown 0.5s ease-out 0.2s forwards;
}

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

/* Enhanced nav link hover */
header nav ul li a {
  position: relative;
  transition: all 0.3s ease;
}

header nav ul li a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #FFCC00;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

header nav ul li a:hover::after,
header nav ul li a.active::after {
  width: 100%;
}

/* ========================================
   HERO CONTENT ANIMATIONS
   ======================================== */

/* Hero content animation */
#home h1 {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

#home .action,
#home .action-second {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

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

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

/* Button micro-interactions */
header nav ul li.btn {
  transition: all 0.2s ease;
}

header nav ul li.btn:hover {
  transform: scale(1.02);
}

.btn-lite,
#action .action a,
footer #offer a {
  transition: all 0.3s ease;
}

.btn-lite:hover {
  transform: translateY(-2px);
}

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

/* Card hover effects for sections */
#sections .well {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#sections .well::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #FFCC00, #F68C14);
  transition: left 0.4s ease;
}

#sections .well:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

#sections .well:hover::before {
  left: 0;
}

#sections .well i {
  transition: transform 0.3s ease;
}

#sections .well:hover i {
  transform: scale(1.1);
}

/* ========================================
   CONTENT REVEAL ANIMATIONS
   ======================================== */

/* Content reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ========================================
   TABLE OF CONTENTS HOVER
   ======================================== */

/* Table of contents hover */
#contents ul li {
  transition: all 0.2s ease;
  padding-left: 0;
}

#contents ul li:hover {
  padding-left: 8px;
  color: #F68C14;
}

/* ========================================
   FOOTER ENHANCEMENTS
   ======================================== */

/* Language selector enhanced */
footer .language-selector ul li {
  transition: all 0.2s ease;
}

footer .language-selector ul li:hover {
  transform: translateY(-2px);
}

/* Social icons pulse on hover */
footer .social ul li {
  transition: all 0.2s ease;
}

footer .social ul li:hover {
  transform: scale(1.1);
}

footer .social ul li i {
  transition: all 0.2s ease;
}

footer .social ul li:hover i {
  color: #2A5CA1 !important;
}

/* ========================================
   MISC ANIMATIONS
   ======================================== */

/* Star rating shimmer */
.action .fa-star,
.action .fa-star-half-o {
  animation: starShimmer 2s ease-in-out infinite;
}

.action .fa-star:nth-child(2) { animation-delay: 0.1s; }
.action .fa-star:nth-child(3) { animation-delay: 0.2s; }
.action .fa-star:nth-child(4) { animation-delay: 0.3s; }
.action .fa-star-half-o { animation-delay: 0.4s; }

@keyframes starShimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Scroll indicator bounce */
.scroll a i {
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* Header language selector animation */
header nav ul li.header-lang-selector select {
  transition: all 0.2s ease;
}

header nav ul li.header-lang-selector select:focus {
  border-color: #FFCC00;
  box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.3);
}

/* Testimonial slide transitions - smoother */
.fadeslider .slide {
  transition: opacity 0.5s ease-in-out;
}

/* Book image subtle float */
#book {
  animation: float 6s ease-in-out infinite;
}

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

/* Author image hover */
#author .slide img {
  transition: all 0.3s ease;
}

#author .slide:hover img {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
