/* ==========================================================================
   HAMADA AQUA PURE — Fluid Motion & Scroll Choreography
   Water-Inspired Physics & Micro-Interactions
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Scroll Reveal Animations (IntersectionObserver-Driven)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  will-change: transform, opacity;
  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 {
  transform: translateY(36px);
}

.reveal-scale {
  transform: scale(0.94);
}

.reveal-fade {
  transform: none;
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger Delays */
.delay-100 { transition-delay: 100ms; }
.delay-150 { transition-delay: 150ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }

/* --------------------------------------------------------------------------
   2. Water Caustics & Glow Animations
   -------------------------------------------------------------------------- */
@keyframes waterPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 210, 180, 0.5);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(0, 210, 180, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 210, 180, 0);
  }
}

.pulse-indicator {
  animation: waterPulse 2.5s infinite var(--ease-smooth);
}

@keyframes waveFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

.float-animated {
  animation: waveFloat 6s ease-in-out infinite;
}

/* Subtle Shimmer for High-Purity Indicators */
@keyframes techShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer-text {
  background: linear-gradient(90deg, #FFFFFF 0%, #00D2B4 50%, #FFFFFF 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: techShimmer 8s infinite linear;
}

/* --------------------------------------------------------------------------
   3. Reduced Motion Access
   -------------------------------------------------------------------------- */
@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 {
    opacity: 1 !important;
    transform: none !important;
  }

  .water-preloader {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   4. Water Themed Precision Preloader
   -------------------------------------------------------------------------- */
.water-preloader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--page-bg);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.65s ease,
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.water-preloader.is-loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.03);
}

.water-preloader-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, rgba(0, 210, 180, 0.15) 0%, rgba(0, 158, 134, 0.05) 35%, transparent 70%);
  pointer-events: none;
}

[data-theme="light"] .water-preloader-backdrop {
  background: radial-gradient(circle at 50% 46%, rgba(0, 158, 134, 0.12) 0%, rgba(0, 210, 180, 0.04) 40%, transparent 70%);
}

.water-loader-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

/* Water Droplet Chamber & Expanding Waves */
.water-droplet-chamber {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Concentric Ripple Waves */
.water-ripple-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px solid var(--aqua);
  opacity: 0;
  pointer-events: none;
  animation: waterRippleExpand 3.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.water-ripple-ring.ring-1 {
  animation-delay: 0s;
}

.water-ripple-ring.ring-2 {
  animation-delay: 1.05s;
}

.water-ripple-ring.ring-3 {
  animation-delay: 2.1s;
}

@keyframes waterRippleExpand {
  0% {
    transform: scale(0.65);
    opacity: 0.8;
  }
  50% {
    opacity: 0.35;
  }
  100% {
    transform: scale(1.75);
    opacity: 0;
  }
}

/* Precision Droplet / Flask Vessel */
.water-flask {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border: 2px solid var(--aqua);
  box-shadow: 0 0 28px rgba(0, 210, 180, 0.35),
              inset 0 2px 8px rgba(255, 255, 255, 0.25),
              inset 0 -2px 8px rgba(0, 0, 0, 0.3);
  background: var(--card-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2;
}

/* Fluid Rising Water Column */
.water-fluid-fill {
  position: absolute;
  bottom: 0;
  left: -25%;
  width: 150%;
  height: 0%;
  background: linear-gradient(180deg, rgba(0, 210, 180, 0.85) 0%, rgba(0, 158, 134, 0.95) 100%);
  border-radius: 0;
  transition: height 0.12s ease-out;
  overflow: visible;
}

/* Undulating Wavy Crests */
.water-wave-layer {
  position: absolute;
  top: -12px;
  left: 0;
  width: 200%;
  height: 24px;
  background-repeat: repeat-x;
}

.water-wave-layer.wave-front {
  background: radial-gradient(circle at 10px 0, transparent 8px, rgba(0, 210, 180, 0.95) 9px);
  background-size: 24px 24px;
  opacity: 0.9;
  animation: waveScrollFront 2s linear infinite;
}

.water-wave-layer.wave-back {
  top: -10px;
  background: radial-gradient(circle at 10px 0, transparent 8px, rgba(0, 158, 134, 0.7) 9px);
  background-size: 20px 20px;
  opacity: 0.6;
  animation: waveScrollBack 2.8s linear infinite reverse;
}

@keyframes waveScrollFront {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes waveScrollBack {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Micro Floating Bubbles */
.water-bubbles-group {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.water-bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 4px #FFFFFF;
  animation: bubbleRise 2.5s infinite ease-in;
}

.water-bubble.b-1 { width: 4px; height: 4px; left: 30%; bottom: 10px; animation-duration: 2.2s; animation-delay: 0.2s; }
.water-bubble.b-2 { width: 3px; height: 3px; left: 55%; bottom: 15px; animation-duration: 1.8s; animation-delay: 0.7s; }
.water-bubble.b-3 { width: 5px; height: 5px; left: 70%; bottom: 8px; animation-duration: 2.6s; animation-delay: 1.1s; }
.water-bubble.b-4 { width: 3px; height: 3px; left: 40%; bottom: 12px; animation-duration: 2.0s; animation-delay: 1.5s; }
.water-bubble.b-5 { width: 4px; height: 4px; left: 60%; bottom: 5px; animation-duration: 2.4s; animation-delay: 0.4s; }

@keyframes bubbleRise {
  0% {
    transform: translateY(0) translateX(0) scale(0.6);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-70px) translateX(4px) scale(1.1);
    opacity: 0;
  }
}

/* Center Silhouette Icon inside Flask */
.water-flask-icon {
  position: relative;
  z-index: 4;
  color: var(--text-primary);
  opacity: 0.85;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  animation: dropGlow 2.5s infinite alternate ease-in-out;
}

@keyframes dropGlow {
  0% {
    transform: scale(0.95);
    filter: drop-shadow(0 0 4px rgba(0, 210, 180, 0.4));
  }
  100% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(0, 210, 180, 0.85));
  }
}

/* Loader Meta Typography & Bar */
.water-loader-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 290px;
}

.water-loader-brand {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--text-primary);
  text-transform: uppercase;
}

html[dir="rtl"] .water-loader-brand {
  letter-spacing: 0.05em;
}

.water-loader-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  gap: 16px;
}

.water-loader-status {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  text-align: left;
}

html[dir="rtl"] .water-loader-status {
  text-align: right;
}

.water-loader-percent {
  font-family: var(--font-mono);
  color: var(--aqua);
  font-weight: 700;
  font-size: 0.875rem;
}

/* High-Tech Glowing Progress Bar */
.water-loader-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 210, 180, 0.15);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.water-loader-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00A896, #00D2B4, #70FFF0);
  box-shadow: 0 0 10px var(--aqua);
  transition: width 0.1s ease-out;
}

