/**
 * Haul Abah ke-06 - Motion System Stylesheet
 * High-performance GPU accelerated animations & cinematic styling
 */

/* 0. Instant Responsive Native Scroll (Eliminates mouse wheel delay/lag) */
html {
  scroll-behavior: auto !important;
}

/* 1. Global Scroll Progress Bar */
#motionProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #d4a317, #f2df00, #ffef46, #e0ce00);
  z-index: 999999;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(242, 223, 0, 0.7);
  transition: width 0.08s ease-out;
}

/* 2. Global Page Loader (Majestic Islamic Noor & Golden Curtain) */
#globalLoader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: -webkit-fill-available;
  z-index: 9999999;
  background-color: #001a0b;
  background-image: 
    radial-gradient(circle at 50% 40%, rgba(242, 223, 0, 0.12) 0%, rgba(0, 45, 20, 0.85) 50%, #001509 100%),
    radial-gradient(rgba(242, 223, 0, 0.1) 1.2px, transparent 0);
  background-size: 100% 100%, 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: transform, opacity;
  border-bottom: 3px solid rgba(242, 223, 0, 0.75);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9);
}

#globalLoader .loader-content {
  text-align: center;
  max-width: 90%;
  width: 440px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  position: relative;
  z-index: 10;
}

#globalLoader .loader-visual-center {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

#globalLoader .loader-aura-glow {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 223, 0, 0.45) 0%, rgba(255, 239, 70, 0.15) 50%, transparent 72%);
  filter: blur(14px);
  pointer-events: none;
  will-change: transform, opacity;
}

#globalLoader .loader-ring-ornament {
  position: absolute;
  width: 136px;
  height: 136px;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 0 10px rgba(242, 223, 0, 0.35));
}

#globalLoader .loader-logo-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  z-index: 2;
}

#globalLoader .loader-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(242, 223, 0, 0.65));
}

#globalLoader .loader-bismillah {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.6rem;
  background: linear-gradient(135deg, #ffffff 0%, #ffef46 45%, #f2df00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(242, 223, 0, 0.35));
  line-height: 1.45;
  letter-spacing: 0.03em;
}

#globalLoader .loader-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(0, 54, 24, 0.85);
  border: 1px solid rgba(242, 223, 0, 0.45);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #ffef46;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(0, 36, 16, 0.5);
}

#globalLoader .loader-subtext {
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  color: #dce8df;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.95;
}

#globalLoader .loader-beam-container {
  width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

#globalLoader .loader-beam-track {
  width: 100%;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

#globalLoader .loader-beam-fill {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4a317, #f2df00, #ffffff, #f2df00, #d4a317);
  box-shadow: 0 0 14px 2px rgba(242, 223, 0, 0.95);
  border-radius: 999px;
  will-change: width;
}

#globalLoader .loader-status-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffef46;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 2px;
}

#globalLoader .loader-line-track {
  width: 180px;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
  position: relative;
}

#globalLoader .loader-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4a317, #f2df00, #ffef46);
  box-shadow: 0 0 8px rgba(242, 223, 0, 0.8);
  border-radius: 999px;
}

/* 3. Ambient Particle Canvas */
#ambientCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 5;
  opacity: 0.85;
}

/* 4. Desktop Custom Gold Cursor */
.motion-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: #f2df00;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999998;
  mix-blend-mode: screen;
  box-shadow: 0 0 14px 2px rgba(242, 223, 0, 0.8);
  transform: translate(-50%, -50%);
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              height 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.2s ease,
              opacity 0.2s ease;
  opacity: 0;
}

.motion-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(242, 223, 0, 0.55);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999997;
  transform: translate(-50%, -50%);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              height 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.25s ease,
              opacity 0.25s ease;
  opacity: 0;
}

.motion-cursor.hovering {
  width: 24px;
  height: 24px;
  background: rgba(242, 223, 0, 0.5);
  box-shadow: 0 0 20px 4px rgba(242, 223, 0, 0.9);
}

.motion-cursor-follower.hovering {
  width: 48px;
  height: 48px;
  border-color: rgba(255, 239, 70, 0.85);
  background: rgba(242, 223, 0, 0.08);
}

@media (pointer: coarse), (max-width: 1023px) {
  .motion-cursor, .motion-cursor-follower {
    display: none !important;
  }
}

/* 5. Cinematic Warm Ambient Light Glow */
.cinematic-glow {
  position: relative;
}
.cinematic-glow::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 600px;
  height: 260px;
  background: radial-gradient(ellipse at center, rgba(242, 223, 0, 0.12) 0%, rgba(0, 54, 24, 0.02) 65%, transparent 75%);
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
}

/* 6. Page Transition Overlay */
#pageTransitionOverlay {
  position: fixed;
  inset: 0;
  z-index: 999995;
  background: #00220f;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
}

/* 7. Animated Countdown Digits */
.flip-counter-wrapper {
  overflow: hidden;
  height: 2.2rem;
  display: inline-block;
  vertical-align: middle;
  position: relative;
}
@media (min-width: 640px) {
  .flip-counter-wrapper {
    height: 2.75rem;
  }
}

.digit-slide-box {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.digit-slide-num {
  height: 2.2rem;
  line-height: 2.2rem;
  text-align: center;
}
@media (min-width: 640px) {
  .digit-slide-num {
    height: 2.75rem;
    line-height: 2.75rem;
  }
}

/* Countdown minute glow pulse */
@keyframes goldMinutePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(242, 223, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 35px 8px rgba(242, 223, 0, 0.7);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(242, 223, 0, 0);
  }
}
.minute-glow-pulse {
  animation: goldMinutePulse 1.8s ease-out;
}

/* 8. Ticket Moving Shine Animation */
.ticket-shine-container {
  position: relative;
  overflow: hidden;
}

.ticket-shine-effect {
  position: absolute;
  top: 0;
  left: -140%;
  width: 80%;
  height: 100%;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(242, 223, 0, 0.45) 50%,
    rgba(255, 255, 255, 0.08) 75%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 25;
}

/* 9. Timeline Vertical Line & Glowing Dots */
.timeline-track-wrap {
  position: relative;
  padding-left: 1.75rem; /* 28px on mobile - keeps cards fully to the right of the timeline */
}
@media (min-width: 640px) {
  .timeline-track-wrap {
    padding-left: 2.25rem; /* 36px on tablet & desktop */
  }
}

.timeline-line-bg {
  position: absolute;
  top: 24px;
  bottom: 30px;
  left: 8px;
  width: 3px;
  background: rgba(0, 83, 34, 0.22);
  border-radius: 999px;
  z-index: 1;
  pointer-events: none;
}
@media (min-width: 640px) {
  .timeline-line-bg {
    left: 11px;
  }
}

.timeline-line-active {
  position: absolute;
  top: 24px;
  left: 8px;
  width: 3px;
  height: 0%;
  background: linear-gradient(180deg, #f2df00 0%, #ffef46 60%, #e0ce00 100%);
  box-shadow: 0 0 10px rgba(242, 223, 0, 0.75);
  border-radius: 999px;
  z-index: 2;
  will-change: height;
  pointer-events: none;
}
@media (min-width: 640px) {
  .timeline-line-active {
    left: 11px;
  }
}

.timeline-dot {
  position: absolute;
  left: -26.5px;
  top: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #003618;
  border: 2px solid #005322;
  z-index: 3;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 0 3px #f7faf8;
  pointer-events: none;
}
@media (min-width: 640px) {
  .timeline-dot {
    left: -31px;
    width: 13px;
    height: 13px;
  }
}

.timeline-dot.active {
  background: #f2df00;
  border-color: #003618;
  box-shadow: 0 0 14px 4px rgba(242, 223, 0, 0.85), 0 0 0 3px #f7faf8;
  transform: scale(1.25);
}

/* Puncak Acara pulse on entrance */
@keyframes puncakGoldPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(242, 223, 0, 0.8);
  }
  60% {
    box-shadow: 0 0 40px 14px rgba(242, 223, 0, 0.6);
  }
  100% {
    box-shadow: 0 10px 30px rgba(0, 54, 24, 0.45);
  }
}
.puncak-pulse-once {
  animation: puncakGoldPulse 2.2s ease-out forwards;
}

/* 10. 3D Tilt Wrapper */
.tilt-card-wrapper {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.tilt-card-inner {
  transition: transform 0.15s ease-out, box-shadow 0.25s ease-out;
  will-change: transform;
}

/* 11. Button Microinteractions */
.btn-motion {
  position: relative;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .btn-motion:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(242, 223, 0, 0.35);
  }
  .btn-motion:hover i.fa-arrow-right,
  .btn-motion:hover .motion-arrow {
    transform: translateX(4px);
  }
}

.btn-motion:active {
  transform: translateY(0) scale(0.97) !important;
}

/* Arrow transition */
.motion-arrow {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Copy checkmark animation */
.salin-check-active {
  background: #00451d !important;
  color: #ffef46 !important;
  border-color: #ffef46 !important;
  transform: scale(1.04);
}

/* 12. Video Documentary Custom Play Overlay */
.video-docu-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.video-poster-img {
  transition: transform 12s cubic-bezier(0.25, 1, 0.5, 1);
}
.video-docu-wrapper:hover .video-poster-img {
  transform: scale(1.05);
}

.play-pulse-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(242, 223, 0, 0.7);
  animation: pulseRingAnim 2.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRingAnim {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.4;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

/* 13. Wall of Prayers Cards Hover & Organic Offsets */
.prayer-card-motion {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .prayer-card-motion:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 54, 24, 0.12);
  }
}

/* 14. Abah Cup Filter Active Pill */
.filter-tab-pill {
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 15. Sticky Navbar Blur & Shrink */
.header-glass-scrolled {
  background-color: rgba(0, 54, 24, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 8px 30px rgba(0, 36, 16, 0.45) !important;
  border-bottom: 1px solid rgba(242, 223, 0, 0.25) !important;
}

.header-glass-scrolled .brand-logo-img {
  transform: scale(0.92);
}

/* 16. 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-behavior: auto !important;
  }
  #ambientCanvas,
  .motion-cursor,
  .motion-cursor-follower,
  .ticket-shine-effect,
  .play-pulse-ring {
    display: none !important;
  }
}
