/* Sabah Professional 3D Animations v5.0 - Inspired by Synthesis Capital & Strawberry Group */
:root {
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-glass: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ========== 3D PERSPECTIVE CARDS (Synthesis Capital Style) ========== */
.card-3d-wrap {
  perspective: 1500px;
}
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.8s var(--transition-expo);
  will-change: transform;
}
.card-3d:hover {
  transform: rotateY(6deg) rotateX(-3deg) translateZ(30px);
}

/* 3D Card with Glow Border */
.card-3d-glow {
  position: relative;
  isolation: isolate;
}
.card-3d-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--sabah-secondary), transparent 40%, var(--sabah-gold) 70%, transparent);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.6s var(--transition-smooth);
}
.card-3d-glow:hover::before { opacity: 1; }

/* ========== 3D TILT (Strawberry Group Style) ========== */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1200px;
}
.tilt-card-inner {
  transition: transform 0.5s var(--transition-expo);
  transform-style: preserve-3d;
}
.tilt-card:hover .tilt-card-inner {
  transform: rotateX(4deg) rotateY(6deg) translateZ(15px);
}

/* 3D Tilt with Shadow Depth */
.tilt-card-depth {
  transform-style: preserve-3d;
  perspective: 1000px;
}
.tilt-card-depth .tilt-face {
  transition: transform 0.6s var(--transition-expo), box-shadow 0.6s ease;
  transform-style: preserve-3d;
}
.tilt-card-depth:hover .tilt-face {
  transform: rotateX(5deg) rotateY(-5deg) translateZ(20px);
  box-shadow: 0 30px 60px rgba(7,59,58,0.15);
}

/* ========== CARD DEPTH SHADOW ========== */
.card-depth {
  transition: box-shadow 0.5s var(--transition-smooth), transform 0.5s var(--transition-bounce);
  box-shadow:
    0 2px 4px rgba(7,59,58,0.02),
    0 4px 8px rgba(7,59,58,0.04),
    0 8px 16px rgba(7,59,58,0.06),
    0 16px 32px rgba(7,59,58,0.04);
}
.card-depth:hover {
  transform: translateY(-10px) scale(1.01);
  box-shadow:
    0 4px 8px rgba(7,59,58,0.04),
    0 8px 16px rgba(7,59,58,0.06),
    0 16px 32px rgba(7,59,58,0.08),
    0 32px 64px rgba(7,59,58,0.12),
    0 64px 128px rgba(7,59,58,0.06);
}

/* ========== 3D IMAGE PERSPECTIVE ========== */
.img-3d-wrap {
  perspective: 800px;
  overflow: hidden;
}
.img-3d-wrap img {
  transition: transform 0.8s var(--transition-expo);
  transform-style: preserve-3d;
}
.img-3d-wrap:hover img {
  transform: rotateY(-6deg) rotateX(3deg) scale(1.08);
}
[dir="rtl"] .img-3d-wrap:hover img {
  transform: rotateY(6deg) rotateX(3deg) scale(1.08);
}

/* ========== IMAGE REVEAL ON SCROLL ========== */
.img-reveal {
  position: relative;
  overflow: hidden;
}
.img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sabah-bg);
  transform: translateX(0);
  transition: transform 1.2s var(--transition-expo);
  z-index: 2;
}
.img-reveal.revealed::after {
  transform: translateX(101%);
}
.img-reveal img {
  transform: scale(1.12);
  transition: transform 1.2s var(--transition-expo);
}
.img-reveal.revealed img {
  transform: scale(1);
}

/* ========== GLASSMORPHISM ========== */
.glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.glass-dark {
  background: rgba(7, 59, 58, 0.08);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid rgba(7,59,58,0.12);
}
.glass-card {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
  transition: all 0.5s var(--transition-bounce);
}
.glass-card:hover {
  background: rgba(255,255,255,0.85);
  box-shadow: 0 24px 64px rgba(0,0,0,0.12);
  transform: translateY(-6px);
}

/* ========== SCROLL REVEAL SYSTEM ========== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left {
  opacity: 0; transform: translateX(-60px);
  transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0; transform: translateX(60px);
  transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.8s var(--transition-bounce), transform 0.8s var(--transition-bounce);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

.reveal-3d {
  opacity: 0;
  transform: perspective(600px) rotateX(8deg) translateY(40px);
  transition: opacity 0.8s var(--transition-expo), transform 0.8s var(--transition-expo);
}
.reveal-3d.visible {
  opacity: 1;
  transform: perspective(600px) rotateX(0) translateY(0);
}

.reveal-clip {
  opacity: 0;
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  transition: opacity 0.8s ease, clip-path 0.8s var(--transition-expo);
}
.reveal-clip.visible {
  opacity: 1;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.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; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }
.reveal-delay-7 { transition-delay: 0.7s; }
.reveal-delay-8 { transition-delay: 0.8s; }

[dir="rtl"] .reveal-left { transform: translateX(60px); }
[dir="rtl"] .reveal-left.visible { transform: translateX(0); }
[dir="rtl"] .reveal-right { transform: translateX(-60px); }
[dir="rtl"] .reveal-right.visible { transform: translateX(0); }

/* ========== HERO 3D WORD REVEAL (Synthesis Capital Style) ========== */
.hero-word {
  display: inline-block;
  opacity: 0; transform: translateY(40px) scale(0.9);
  animation: wordReveal 0.8s var(--transition-spring) forwards;
}
.hero-word:nth-child(1) { animation-delay: 0.1s; }
.hero-word:nth-child(2) { animation-delay: 0.2s; }
.hero-word:nth-child(3) { animation-delay: 0.3s; }
.hero-word:nth-child(4) { animation-delay: 0.4s; }
.hero-word:nth-child(5) { animation-delay: 0.5s; }
.hero-word:nth-child(6) { animation-delay: 0.6s; }
.hero-word:nth-child(7) { animation-delay: 0.7s; }
.hero-word:nth-child(8) { animation-delay: 0.8s; }
.hero-word:nth-child(9) { animation-delay: 0.9s; }
.hero-word:nth-child(10) { animation-delay: 1.0s; }

@keyframes wordReveal {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hero letter split reveal */
.hero-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(40deg);
  animation: letterReveal 0.6s var(--transition-expo) forwards;
}
@keyframes letterReveal {
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* Hero subtitle fade */
.hero-subtitle {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.6s var(--transition-smooth) forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ========== FLOATING & AMBIENT (Strawberry Group Style) ========== */
.float-slow {
  animation: floatSlow 8s ease-in-out infinite;
}
.float-medium {
  animation: floatMedium 5s ease-in-out infinite;
}
.float-fast {
  animation: floatFast 3s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(3deg); }
}
@keyframes floatMedium {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}
@keyframes floatFast {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-3deg); }
}

/* 3D floating with perspective */
.float-3d {
  animation: float3D 6s ease-in-out infinite;
  transform-style: preserve-3d;
}
@keyframes float3D {
  0%, 100% { transform: translateY(0) rotateX(0) rotateY(0); }
  25% { transform: translateY(-15px) rotateX(4deg) rotateY(-4deg); }
  50% { transform: translateY(-8px) rotateX(-2deg) rotateY(6deg); }
  75% { transform: translateY(-18px) rotateX(3deg) rotateY(-2deg); }
}

/* ========== PULSE GLOW ========== */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(7,59,58,0.08); }
  50% { box-shadow: 0 0 50px rgba(7,59,58,0.2); }
}
.pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlowGold {
  0%, 100% { box-shadow: 0 0 20px rgba(201,168,118,0.1); }
  50% { box-shadow: 0 0 60px rgba(201,168,118,0.25); }
}
.pulse-glow-gold {
  animation: pulseGlowGold 4s ease-in-out infinite;
}

/* ========== GRADIENT TEXT SHIMMER ========== */
.text-shimmer {
  background: linear-gradient(135deg, var(--sabah-primary) 0%, var(--sabah-secondary) 25%, var(--sabah-gold) 50%, var(--sabah-secondary) 75%, var(--sabah-primary) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerGradient 4s ease-in-out infinite;
}
@keyframes shimmerGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ========== HOVER EFFECTS ========== */
.hover-lift {
  transition: all 0.4s var(--transition-smooth);
}
.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.1);
}

.hover-scale-img {
  overflow: hidden;
}
.hover-scale-img img {
  transition: transform 0.8s var(--transition-expo);
}
.hover-scale-img:hover img {
  transform: scale(1.08);
}

/* Image zoom with 3D perspective */
.img-zoom-3d {
  overflow: hidden;
  perspective: 600px;
}
.img-zoom-3d img {
  transition: transform 0.8s var(--transition-expo);
  transform-style: preserve-3d;
}
.img-zoom-3d:hover img {
  transform: scale(1.12) rotateX(-2deg) rotateY(3deg);
}

.shimmer-hover {
  position: relative;
  overflow: hidden;
}
.shimmer-hover::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.8s var(--transition-smooth);
}
.shimmer-hover:hover::after {
  transform: translateX(100%);
}

/* ========== COUNTER ========== */
.counter-value {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.counter-glow::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(90deg, transparent, var(--sabah-secondary), transparent);
  transform: scaleX(0);
  transition: transform 0.6s var(--transition-expo);
}
.counter-glow.visible::after {
  transform: scaleX(1);
}

/* ========== SECTION DIVIDERS ========== */
.divider-glow {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sabah-secondary), transparent);
  width: 80%; margin: 2rem auto; border-radius: 2px;
}
.divider-short {
  height: 3px; width: 60px;
  background: var(--sabah-secondary);
  border-radius: 2px; margin: 1rem auto 1rem 0;
  transition: width 0.5s var(--transition-smooth);
}
.divider-short:hover { width: 120px; }
[dir="rtl"] .divider-short { margin: 1rem 0 1rem auto; }

.divider-animated {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--sabah-secondary), var(--sabah-gold), var(--sabah-secondary), transparent);
  background-size: 200% 100%;
  animation: dividerSweep 3s ease-in-out infinite;
  border-radius: 2px;
  width: 60px;
  margin: 1.5rem auto;
}
@keyframes dividerSweep {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ========== GRADIENT BORDERS ========== */
.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: '';
  position: absolute; inset: 0;
  padding: 1px;
  background: linear-gradient(135deg, var(--sabah-secondary), var(--sabah-gold), var(--sabah-secondary));
  border-radius: inherit;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s var(--transition-smooth);
}
.gradient-border:hover::before { opacity: 1; }

/* ========== PARALLAX TILT ========== */
.parallax-tilt {
  transition: transform 0.3s var(--transition-expo);
  will-change: transform;
}

/* ========== STAGGERED LIST ========== */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s var(--transition-spring);
}
.stagger-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== BUTTON MAGNETIC & RIPPLE ========== */
.btn-magnetic {
  position: relative;
  transition: transform 0.3s var(--transition-expo);
}

.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.3), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.btn-ripple:hover::after {
  opacity: 1;
}

/* Button glow pulse */
.btn-glow {
  position: relative;
}
.btn-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--sabah-secondary), var(--sabah-gold));
  z-index: -1;
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.4s var(--transition-smooth);
}
.btn-glow:hover::before {
  opacity: 0.5;
}

/* Button press effect */
.btn-press:active {
  transform: scale(0.95);
}

/* ========== FORM FIELD ANIMATIONS ========== */
.field-float input,
.field-float textarea,
.field-float select {
  transition: all 0.3s var(--transition-smooth);
  border: 2px solid rgba(23,101,109,0.15);
}
.field-float input:focus,
.field-float textarea:focus,
.field-float select:focus {
  border-color: var(--sabah-secondary);
  box-shadow: 0 0 0 3px rgba(23,101,109,0.1);
  transform: translateY(-1px);
}

.field-glow:focus-within::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--sabah-secondary), transparent, var(--sabah-gold));
  z-index: -1;
  opacity: 0.4;
  animation: fieldGlow 2s ease-in-out infinite;
}
@keyframes fieldGlow {
  0%, 100% { opacity: 0.2; filter: blur(4px); }
  50% { opacity: 0.5; filter: blur(8px); }
}

/* ========== NAVIGATION ANIMATIONS ========== */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--sabah-secondary);
  transition: all 0.3s var(--transition-smooth);
  transform: translateX(-50%);
  border-radius: 1px;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link-3d {
  transition: all 0.3s var(--transition-spring);
  transform-style: preserve-3d;
}
.nav-link-3d:hover {
  transform: translateY(-2px) translateZ(4px);
  text-shadow: 0 4px 12px rgba(7,59,58,0.15);
}

/* Dropdown smooth 3D */
.dropdown-smooth {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px) scale(0.96) rotateX(-4deg);
  transform-origin: top center;
  transition: all 0.3s var(--transition-spring);
  perspective: 600px;
}
.dropdown-smooth.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1) rotateX(0);
}

/* ========== SECTION BACKGROUND EFFECTS ========== */
.section-bg-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.03;
  animation: bgShapeFloat 15s ease-in-out infinite;
}
@keyframes bgShapeFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.1); }
  50% { transform: translate(-20px, 10px) scale(0.9); }
  75% { transform: translate(10px, 30px) scale(1.05); }
}

/* ========== SOCIAL ICON HOVER 3D ========== */
.social-icon-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--transition-spring);
  transform-style: preserve-3d;
}
.social-icon-3d:hover {
  transform: translateY(-4px) rotateX(6deg) scale(1.12);
  box-shadow: 0 8px 24px rgba(7,59,58,0.15);
}

/* ========== KEYFRAME ANIMATIONS ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin-slow {
  animation: spinSlow 20s linear infinite;
}

/* ========== PARTICLE SYSTEM ========== */
.particle-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFloat var(--particle-dur, 6s) ease-in-out infinite;
  animation-delay: var(--particle-delay, 0s);
}
@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  25% { transform: translate(10px, -15px) scale(1.2); opacity: 0.6; }
  50% { transform: translate(-8px, -5px) scale(0.8); opacity: 0.4; }
  75% { transform: translate(15px, -20px) scale(1.1); opacity: 0.5; }
}

/* ========== CARD GRID STAGGER ========== */
.grid-card {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s var(--transition-spring);
}
.grid-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.grid-card:nth-child(1) { transition-delay: 0.05s; }
.grid-card:nth-child(2) { transition-delay: 0.1s; }
.grid-card:nth-child(3) { transition-delay: 0.15s; }
.grid-card:nth-child(4) { transition-delay: 0.2s; }
.grid-card:nth-child(5) { transition-delay: 0.25s; }
.grid-card:nth-child(6) { transition-delay: 0.3s; }
.grid-card:nth-child(7) { transition-delay: 0.35s; }
.grid-card:nth-child(8) { transition-delay: 0.4s; }

/* ========== NUMBER COUNTER STAGGER ========== */
.stat-item {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.6s var(--transition-spring);
}
.stat-item.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.stat-item:nth-child(1) { transition-delay: 0.1s; }
.stat-item:nth-child(2) { transition-delay: 0.2s; }
.stat-item:nth-child(3) { transition-delay: 0.3s; }

/* ========== PAGE-SPECIFIC ANIMATIONS ========== */

/* Home page */
.hero-parallax-layer {
  transition: transform 0.2s var(--transition-expo);
  will-change: transform;
}

/* Home 3D Logo Tilt */
.logo-3d-tilt {
  transform-style: preserve-3d;
  perspective: 800px;
}

/* About page */
.about-image-stagger {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: all 0.8s var(--transition-spring);
}
.about-image-stagger.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.about-text-line {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s var(--transition-smooth);
}
.about-text-line.visible {
  opacity: 1;
  transform: translateY(0);
}
.about-text-line:nth-child(1) { transition-delay: 0.1s; }
.about-text-line:nth-child(2) { transition-delay: 0.2s; }
.about-text-line:nth-child(3) { transition-delay: 0.3s; }
.about-text-line:nth-child(4) { transition-delay: 0.4s; }

/* Coaching page */
.coach-card {
  opacity: 0;
  transform: translateY(60px);
  transition: all 0.7s var(--transition-spring);
}
.coach-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.coach-card:nth-child(1) { transition-delay: 0.05s; }
.coach-card:nth-child(2) { transition-delay: 0.15s; }
.coach-card:nth-child(3) { transition-delay: 0.25s; }
.coach-card:nth-child(4) { transition-delay: 0.35s; }

/* Training page */
.training-card {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.6s var(--transition-bounce);
}
.training-card.visible {
  opacity: 1;
  transform: scale(1);
}

/* Book page */
.book-3d-cover {
  perspective: 1500px;
}
.book-3d-cover img {
  transition: transform 0.8s var(--transition-spring);
  transform-style: preserve-3d;
}
.book-3d-cover:hover img {
  transform: rotateY(-10deg) rotateX(3deg) translateZ(30px);
}

/* Contact page */
.contact-glass-field {
  transition: all 0.4s var(--transition-spring);
}
.contact-glass-field:focus-within {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(7,59,58,0.12);
}

.btn-submit-pulse {
  animation: submitPulse 2s ease-in-out infinite;
}
@keyframes submitPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(23,101,109,0.3); }
  50% { box-shadow: 0 4px 40px rgba(23,101,109,0.5); }
}

/* Services page */
.service-icon-float {
  animation: serviceOrbit 6s ease-in-out infinite;
}
.service-card-icon {
  transition: transform 0.4s var(--transition-bounce);
}
.service-card:hover .service-card-icon {
  transform: scale(1.15) rotate(6deg);
}
@keyframes serviceOrbit {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(3deg); }
  75% { transform: translateY(4px) rotate(-2deg); }
}

/* Testimonials page */
.testimony-card {
  opacity: 0;
  transform: perspective(600px) rotateY(8deg) translateX(20px);
  transition: all 0.6s var(--transition-spring);
}
.testimony-card.visible {
  opacity: 1;
  transform: perspective(600px) rotateY(0) translateX(0);
}
[dir="rtl"] .testimony-card {
  transform: perspective(600px) rotateY(-8deg) translateX(-20px);
}
[dir="rtl"] .testimony-card.visible {
  transform: perspective(600px) rotateY(0) translateX(0);
}

/* ========== FOOTER ANIMATIONS ========== */
.footer-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s var(--transition-smooth);
}
.footer-item.visible {
  opacity: 1;
  transform: translateY(0);
}
.footer-item:nth-child(1) { transition-delay: 0.05s; }
.footer-item:nth-child(2) { transition-delay: 0.1s; }
.footer-item:nth-child(3) { transition-delay: 0.15s; }
.footer-item:nth-child(4) { transition-delay: 0.2s; }

.footer-social-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--transition-spring);
  transform-style: preserve-3d;
}
.footer-social-3d:hover {
  transform: translateY(-6px) rotateY(12deg) scale(1.15);
  box-shadow: 0 8px 24px rgba(7,59,58,0.2);
}

/* ========== CURSOR EFFECTS ========== */
.sabah-cursor-dot {
  pointer-events: none;
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--sabah-secondary);
  border-radius: 50%;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
  mix-blend-mode: difference;
}
.sabah-cursor-ring {
  pointer-events: none;
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(7,59,58,0.3);
  border-radius: 50%;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: all 0.15s ease-out;
}
.sabah-cursor-ring.hover {
  width: 60px;
  height: 60px;
  border-color: var(--sabah-secondary);
  background: rgba(7,59,58,0.05);
}

/* ========== MAGNETIC BUTTON ========== */
.btn-magnetic-wrap {
  display: inline-block;
}

/* ========== TEXT REVEAL ========== */
.text-line-reveal {
  overflow: hidden;
  display: block;
}
.text-line-reveal span {
  display: block;
  transform: translateY(100%);
  transition: transform 0.8s var(--transition-expo);
}
.text-line-reveal.revealed span {
  transform: translateY(0);
}

/* ========== HOME PAGE - RECOVERY SECTIONS ========== */

/* Butterfly float */
.butterfly-float {
  animation: butterflyFloat 8s ease-in-out infinite;
  transform-origin: center;
}
@keyframes butterflyFloat {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-12px) rotate(3deg) scale(1.02); }
  50% { transform: translateY(-6px) rotate(-2deg) scale(0.98); }
  75% { transform: translateY(-18px) rotate(4deg) scale(1.01); }
}

/* Lotus spin slow */
.lotus-spin {
  animation: lotusSpin 30s linear infinite;
  transform-origin: center;
}
@keyframes lotusSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Pulse circles */
.pulse-circle {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(211,195,167,0.3);
  animation: pulseRing 3s ease-out infinite;
  pointer-events: none;
}
.pulse-circle:nth-child(2) { animation-delay: 1s; }
.pulse-circle:nth-child(3) { animation-delay: 2s; }
@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 0.2; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Recovery path line animation */
.path-line-dash {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: pathDraw 3s ease-out forwards;
}
.path-line-dash.animated {
  stroke-dashoffset: 0;
}
@keyframes pathDraw {
  to { stroke-dashoffset: 0; }
}

/* Timeline steps */
.timeline-step {
  position: relative;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.7s var(--transition-spring);
}
.timeline-step.visible {
  opacity: 1;
  transform: translateX(0);
}
.timeline-step:nth-child(even) {
  transform: translateX(20px);
}
.timeline-step:nth-child(even).visible {
  transform: translateX(0);
}
.timeline-step:nth-child(1) { transition-delay: 0.05s; }
.timeline-step:nth-child(2) { transition-delay: 0.15s; }
.timeline-step:nth-child(3) { transition-delay: 0.25s; }
.timeline-step:nth-child(4) { transition-delay: 0.35s; }
.timeline-step:nth-child(5) { transition-delay: 0.45s; }
.timeline-step:nth-child(6) { transition-delay: 0.55s; }

.timeline-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sabah-secondary);
  border: 3px solid var(--sabah-bg);
  box-shadow: 0 0 0 3px rgba(23,101,109,0.3);
  transition: all 0.5s var(--transition-bounce);
  flex-shrink: 0;
}
.timeline-step:hover .timeline-dot {
  transform: scale(1.3);
  box-shadow: 0 0 0 6px rgba(23,101,109,0.2);
  background: var(--sabah-gold);
}

.timeline-line {
  position: absolute;
  left: 8px;
  top: 28px;
  bottom: -28px;
  width: 2px;
  background: linear-gradient(to bottom, var(--sabah-secondary), var(--sabah-gold));
  opacity: 0.3;
}
.timeline-step:last-child .timeline-line {
  display: none;
}

/* Recovery path cards */
.recovery-path-card {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: all 0.6s var(--transition-spring);
}
.recovery-path-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.recovery-path-card:nth-child(1) { transition-delay: 0.05s; }
.recovery-path-card:nth-child(2) { transition-delay: 0.15s; }
.recovery-path-card:nth-child(3) { transition-delay: 0.25s; }
.recovery-path-card:nth-child(4) { transition-delay: 0.35s; }

.recovery-path-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(7,59,58,0.15);
}

/* DNA helix card */
.dna-card {
  position: relative;
  overflow: hidden;
  transition: all 0.6s var(--transition-spring);
}
.dna-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 24px 64px rgba(7,59,58,0.18);
}
.dna-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(211,195,167,0.05), transparent, rgba(201,168,118,0.05), transparent);
  animation: dnaRotate 10s linear infinite;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.dna-card:hover::before {
  opacity: 1;
}
@keyframes dnaRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Healing glow effect */
.healing-glow {
  position: relative;
}
.healing-glow::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(ellipse at center, rgba(201,168,118,0.06), transparent 70%);
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Section wave divider */
.section-wave-top {
  position: relative;
}
.section-wave-top::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40'%3E%3Cpath d='M0,20 Q150,0 300,20 Q450,40 600,20 Q750,0 900,20 Q1050,40 1200,20 L1200,40 L0,40 Z' fill='%23d3c3a7' opacity='0.15'/%3E%3C/svg%3E") repeat-x top;
  background-size: 1200px 40px;
  pointer-events: none;
}

/* Recovery stat counter */
.recovery-stat {
  text-align: center;
  padding: 1.5rem;
}
.recovery-stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--sabah-primary);
  line-height: 1;
}
.recovery-stat-label {
  font-size: 0.85rem;
  color: var(--sabah-secondary);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* DNA test preview card */
.dna-preview-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  transition: all 0.5s var(--transition-spring);
  cursor: pointer;
}
.dna-preview-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 48px rgba(7,59,58,0.15);
}
.dna-preview-card img {
  transition: transform 0.6s var(--transition-expo);
}
.dna-preview-card:hover img {
  transform: scale(1.08);
}

/* RTL support for timeline */
[dir="rtl"] .timeline-step {
  transform: translateX(20px);
}
[dir="rtl"] .timeline-step.visible {
  transform: translateX(0);
}
[dir="rtl"] .timeline-step:nth-child(even) {
  transform: translateX(-20px);
}
[dir="rtl"] .timeline-step:nth-child(even).visible {
  transform: translateX(0);
}
[dir="rtl"] .timeline-line {
  left: auto;
  right: 8px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .card-3d:hover { transform: none; }
  .tilt-card:hover .tilt-card-inner { transform: none; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-3d { opacity: 1; transform: none; }
  .hero-word { opacity: 1; transform: none; animation: none; }
  .glass { background: rgba(255,255,255,0.5); backdrop-filter: blur(8px); }
  .parallax-tilt { transform: none !important; }
  .img-3d-wrap:hover img { transform: none; }
  .book-3d-cover:hover img { transform: none; }
  .footer-item { opacity: 1; transform: none; }
  .grid-card { opacity: 1; transform: none; }
  .stat-item { opacity: 1; transform: none; }
  .sabah-cursor-dot, .sabah-cursor-ring { display: none; }
  .img-reveal::after { display: none; }
  .img-reveal img { transform: scale(1); }
  .timeline-step { opacity: 1; transform: none !important; }
  .recovery-path-card { opacity: 1; transform: none !important; }
  .butterfly-float { animation: none; }
  .lotus-spin { animation: none; }
  .pulse-circle { display: none; }
  .dna-card::before { display: none; }
  .recovery-stat-number { font-size: 2rem; }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-word { opacity: 1; transform: none; animation: none; }
  .hero-letter { opacity: 1; transform: none; animation: none; }
  .hero-subtitle { opacity: 1; transform: none; animation: none; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-3d { opacity: 1; transform: none; }
  .float-slow, .float-medium, .float-fast, .float-3d { animation: none; }
  .card-3d:hover { transform: none; }
  .parallax-tilt { transform: none !important; }
  .img-3d-wrap:hover img { transform: none; }
  .pulse-glow, .pulse-glow-gold { animation: none; }
  .spin-slow { animation: none; }
  .service-icon-float { animation: none; }
  .sabah-cursor-dot, .sabah-cursor-ring { display: none; }
  .img-reveal::after { display: none; }
  .img-reveal img { transform: scale(1); }
  .butterfly-float { animation: none; }
  .lotus-spin { animation: none; }
  .pulse-circle { display: none; }
  .dna-card::before { display: none; }
  .recovery-path-card { opacity: 1; transform: none !important; }
  .timeline-step { opacity: 1; transform: none !important; }
  .healing-glow::after { animation: none; }
}
