/* ==========================================================================
   N&B EDUCATIONAL ADVISORS - ANIMATIONS & INTERACTION STYLES
   Preloader, Custom Cursor, Keyframes, Reveals, Mouse Parallax & Glassmorphism
   ========================================================================== */

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--dark-navy);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.77, 0, 0.175, 1), visibility 0.8s ease;
}

#preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  position: relative;
}

.loader-logo-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 0.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(214, 168, 79, 0.15);
  border-top-color: var(--secondary-gold);
  border-right-color: var(--light-gold);
  animation: spinRing 1.5s linear infinite;
}

.loader-logo-img {
  width: 98px;
  height: 98px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(214, 168, 79, 0.55));
  animation: pulseLogo 2s ease-in-out infinite;
}

.loader-fill-text-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.loader-text-base {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(214, 168, 79, 0.35);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.loader-text-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  background: linear-gradient(90deg, #F5E096 0%, #D6A84F 35%, #B8860B 70%, #E8C97D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: width 0.15s ease-out;
  filter: drop-shadow(0 0 15px rgba(214, 168, 79, 0.65));
}

.loader-tagline-fill {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.loader-bar-wrap {
  width: 240px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto;
}

.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gold-gradient);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px var(--secondary-gold);
}

.loader-percent {
  font-size: 0.9rem;
  color: var(--secondary-gold);
  font-weight: 700;
  margin-top: 0.6rem;
  letter-spacing: 1px;
}

/* Custom Cursor */
.custom-cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--secondary-gold);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
}

.custom-cursor-circle {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(214, 168, 79, 0.6);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999998;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

body.cursor-hover .custom-cursor-circle {
  width: 54px;
  height: 54px;
  background: rgba(214, 168, 79, 0.12);
  border-color: var(--secondary-gold);
}

/* Hide Custom Cursor on Mobile & Touch Devices */
@media (max-width: 1024px), (pointer: coarse) {
  .custom-cursor-dot,
  .custom-cursor-circle {
    display: none !important;
  }
}

/* Scroll Progress Bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3.5px;
  background: var(--gold-gradient);
  z-index: 10000;
  box-shadow: 0 0 10px rgba(214, 168, 79, 0.8);
  transition: width 0.1s ease-out;
}

/* Fixed WhatsApp Floating CTA Button */
.whatsapp-float-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25D366;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  z-index: 99999;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: whatsappBounce 2s infinite ease-in-out;
}

.whatsapp-float-btn::before,
.whatsapp-float-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid #25D366;
  animation: whatsappRing 2.5s infinite ease-out;
  pointer-events: none;
}

.whatsapp-float-btn::after {
  animation-delay: 1.25s;
}

.whatsapp-float-btn i {
  animation: whatsappWiggle 3s infinite ease-in-out;
}

.whatsapp-float-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 12px 35px rgba(37, 211, 102, 0.75);
  color: #FFFFFF;
  animation-play-state: paused;
}

.whatsapp-float-btn:hover i {
  animation-play-state: paused;
}

/* Ring ripple expanding outward */
@keyframes whatsappRing {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* Subtle bounce up-down */
@keyframes whatsappBounce {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-6px);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(-3px);
  }
}

/* Icon wiggle rotation */
@keyframes whatsappWiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(12deg);
  }
  30% {
    transform: rotate(-8deg);
  }
  45% {
    transform: rotate(5deg);
  }
  60% {
    transform: rotate(0deg);
  }
}

/* Scroll To Top Button with Scroll Progress Ring & Percentage Indicator */
.scroll-top-btn {
  position: fixed;
  bottom: 95px;
  right: 30px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--dark-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  box-shadow: var(--shadow-gold);
  overflow: visible;
  cursor: pointer;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Circular SVG Progress Ring */
.scroll-progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  pointer-events: none;
  transform: rotate(-90deg);
}

.scroll-progress-bg {
  fill: none;
  stroke: rgba(7, 26, 61, 0.18);
  stroke-width: 3.5;
}

.scroll-progress-circle {
  fill: none;
  stroke: var(--dark-navy);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 138.23; /* 2 * PI * 22 */
  stroke-dashoffset: 138.23;
  transition: stroke-dashoffset 0.1s linear;
}

/* Scroll Percentage Text */
.scroll-percent-text {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--dark-navy);
  letter-spacing: -0.3px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  line-height: 1;
  z-index: 2;
}

/* Scroll Top Arrow Icon (Hidden by default, shown on hover) */
.scroll-top-icon {
  position: absolute;
  font-size: 1.15rem;
  color: var(--dark-navy);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2;
}

/* Hover & at-bottom state: Swap percentage text with chevron arrow */
.scroll-top-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(214, 168, 79, 0.65);
}

.scroll-top-btn:hover .scroll-percent-text,
.scroll-top-btn.at-bottom .scroll-percent-text {
  opacity: 0;
  transform: scale(0.5);
}

.scroll-top-btn:hover .scroll-top-icon,
.scroll-top-btn.at-bottom .scroll-top-icon {
  opacity: 1;
  transform: scale(1);
}

/* Ripple Button Effect */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}

/* Animation Keyframes */
@keyframes spinRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(214, 168, 79, 0.3)); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 15px rgba(214, 168, 79, 0.7)); }
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes floatAnim {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

.floating-elem {
  animation: floatAnim 4s ease-in-out infinite;
}

/* Scroll Reveal Classes */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}
