/* ==========================================================================
   AMUTHA SIDDHA - MODERN ANIMATIONS CSS
   ========================================================================== */

/* 1. Page Loader */
#page-loader {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out, visibility 0.5s;
}
#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.spinner {
  width: 50px; height: 50px;
  border: 4px solid rgba(18, 61, 49, 0.2);
  border-top-color: #123d31;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 2. Scroll Progress */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%; height: 4px;
  background: linear-gradient(90deg, #28a745, #123d31);
  z-index: 10000;
  transition: width 0.1s ease-out;
}

/* 3. Back to Top */
#back-to-top {
  position: fixed;
  bottom: 24px;
  left: 20px;
  right: auto;
  width: 44px;
  height: 44px;
  background: #123d31;
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1020;
  cursor: pointer;
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover {
  background: #0c2b22;
  transform: translateY(-4px) scale(1.05);
}
@media (max-width: 767px) {
  #back-to-top {
    bottom: 16px;
    left: 14px;
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

/* 4. Reveal Animations (Intersection Observer) */
.reveal-up { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); }
.reveal-down { opacity: 0; transform: translateY(-40px); transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); }
.reveal-scale { opacity: 0; transform: scale(0.9); transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); }

.reveal-up.active, .reveal-down.active, .reveal-left.active, .reveal-right.active {
  opacity: 1; transform: translate(0);
}
.reveal-scale.active {
  opacity: 1; transform: scale(1);
}

/* Staggered Cards */
.reveal-stagger { opacity: 0; transform: translateY(30px); transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); }
.reveal-stagger.active { opacity: 1; transform: translateY(0); }

/* 5. Button Ripple & Hover */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}
.btn:active { transform: translateY(0); }
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  background: rgba(255, 255, 255, 0.4);
}
@keyframes ripple-effect {
  to { transform: scale(4); opacity: 0; }
}

/* 6. Navbar Hover — text pops forward (no underline) */
.navbar .nav-link {
  position: relative;
  transition: color 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 0.25s ease;
  display: inline-block;
  text-decoration: none !important;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  transform: translateY(-2px) scale(1.10);
  text-shadow: 0 2px 12px rgba(27, 99, 72, 0.25);
  text-decoration: none !important;
}

.navbar { transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease; }
.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* 7. Floating & Parallax Elements */
.floating { animation: float 6s ease-in-out infinite; }
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

/* 8. Image Zoom Hover */
.img-hover-zoom {
  overflow: hidden;
}
.img-hover-zoom img {
  transition: transform 0.8s ease;
}
.img-hover-zoom:hover img {
  transform: scale(1.05);
}

/* 9. Form Input Focus */
.form-control, .form-select {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
.form-control:focus, .form-select:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(18, 61, 49, 0.1) !important;
}

/* Reduce Motion Accessibility */
@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;
  }
  .reveal-up, .reveal-down, .reveal-left, .reveal-right, .reveal-scale, .reveal-stagger {
    opacity: 1 !important; transform: none !important;
  }
}
