/* Sarh landing page — animations and overrides */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #navbar .nav-logo {
    animation: none !important;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(221, 157, 3, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(221, 157, 3, 0);
  }
}

.hero-animate-1 {
  animation: fadeInUp 0.7s ease-out forwards;
}

.hero-animate-2 {
  animation: fadeInUp 0.7s ease-out 0.15s forwards;
  opacity: 0;
}

.hero-animate-3 {
  animation: fadeInUp 0.7s ease-out 0.3s forwards;
  opacity: 0;
}

.hero-animate-4 {
  animation: fadeIn 1s ease-out 0.45s forwards;
  opacity: 0;
}

.phone-mockup {
  animation: float 4s ease-in-out infinite;
}

.cta-pulse {
  animation: pulseGlow 2s ease-in-out infinite;
}

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

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

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

#navbar.is-scrolled {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(10, 100, 159, 0.12);
}

#navbar.is-scrolled .nav-link {
  color: #0a649f;
}

.nav-brand-line1,
.nav-brand-line2 {
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.3s ease;
}

.nav-brand-sub {
  color: #f0b82e;
  transition: color 0.3s ease;
}

#navbar.is-scrolled .nav-brand-line1 {
  color: #0a649f;
}

#navbar.is-scrolled .nav-brand-line2 {
  color: #0a649f;
}

#navbar.is-scrolled .nav-brand-line2 .text-secondary {
  color: #dd9d03;
}

#navbar.is-scrolled .nav-brand-sub {
  color: #084d78;
}

#navbar.is-scrolled .hamburger-line {
  background-color: #0a649f;
}

@keyframes logoPulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.22));
  }
  50% {
    transform: scale(1.07);
    filter: drop-shadow(0 4px 18px rgba(221, 157, 3, 0.5));
  }
}

#navbar .nav-logo {
  animation: logoPulse 2.8s ease-in-out infinite;
  transition: transform 0.25s ease, filter 0.25s ease;
}

#navbar .group:hover .nav-logo {
  animation-play-state: paused;
  transform: scale(1.1);
  filter: drop-shadow(0 6px 20px rgba(221, 157, 3, 0.55));
}

.nav-logo {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
  transition: transform 0.25s ease, filter 0.25s ease;
}

html[dir="rtl"] .hero-arrow {
  transform: scaleX(-1);
}

#navbar.is-scrolled .lang-btn {
  border-color: rgba(10, 100, 159, 0.35);
  color: #0a649f;
}

#navbar.is-scrolled .lang-btn:hover {
  border-color: #dd9d03;
  color: #dd9d03;
}

#mobile-menu.is-open {
  max-height: 420px;
  opacity: 1;
}

#mobile-menu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease;
}

.feature-card {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(10, 100, 159, 0.15);
}

.social-link {
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.social-link:hover {
  transform: scale(1.1);
}

.hamburger-line {
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

#menu-toggle.is-active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#menu-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

#menu-toggle.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── XP Intro Splash ─── */
body.xp-intro-active {
  overflow: hidden;
}

.xp-intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #0d7ab8 0%, #084d78 45%, #052a42 100%);
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.xp-intro--hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.xp-intro-skip {
  position: absolute;
  top: 1.25rem;
  inset-inline-end: 1.25rem;
  z-index: 10;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease;
}

.xp-intro-skip:hover {
  background: rgba(255, 255, 255, 0.2);
}

.xp-intro-inner {
  position: relative;
  width: min(94vw, 480px);
  text-align: center;
  padding: 2rem 1rem 2.5rem;
}

.xp-intro-burst {
  position: absolute;
  top: 28%;
  left: 50%;
  width: clamp(18rem, 78vw, 26rem);
  height: clamp(18rem, 78vw, 26rem);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(221, 157, 3, 0.4) 0%, transparent 68%);
  animation: xpBurst 2s ease-out infinite;
  pointer-events: none;
}

@keyframes xpBurst {
  0% {
    transform: translate(-50%, -50%) scale(0.55);
    opacity: 0.85;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.35);
    opacity: 0;
  }
}

.xp-intro-logo {
  position: relative;
  z-index: 2;
  width: clamp(12.5rem, 55vw, 18rem);
  height: clamp(12.5rem, 55vw, 18rem);
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 40px rgba(221, 157, 3, 0.45));
  animation: xpLogoPop 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes xpLogoPop {
  0% {
    transform: scale(0) rotate(-18deg);
    opacity: 0;
    filter: drop-shadow(0 0 0 transparent);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
    filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.35))
      drop-shadow(0 0 40px rgba(221, 157, 3, 0.45));
  }
}

.xp-intro-levelup {
  position: relative;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  color: #f0b82e;
  text-shadow: 0 0 30px rgba(221, 157, 3, 0.8), 0 4px 0 #b8860b;
  animation: xpLevelUp 0.6s ease-out 0.5s both;
}

@keyframes xpLevelUp {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  70% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.xp-intro-rank {
  position: relative;
  margin-top: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  animation: fadeInUp 0.5s ease-out 0.9s both;
}

.xp-intro-bar-wrap {
  position: relative;
  margin: 1.75rem auto 0;
  max-width: 280px;
  animation: fadeInUp 0.5s ease-out 1.1s both;
}

.xp-intro-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.35rem;
}

.xp-intro-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.xp-intro-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #dd9d03, #f0b82e, #ffe566);
  box-shadow: 0 0 12px rgba(221, 157, 3, 0.6);
  animation: xpBarFill 1.8s ease-out 1.3s forwards;
}

@keyframes xpBarFill {
  to {
    width: 78%;
  }
}

.xp-intro-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.xp-particle {
  position: absolute;
  font-size: 0.875rem;
  font-weight: 800;
  color: #f0b82e;
  text-shadow: 0 0 8px rgba(221, 157, 3, 0.8);
  animation: xpParticleFly 2.5s ease-out forwards;
}

@keyframes xpParticleFly {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-120px) scale(1.3);
  }
}

.xp-intro-sub {
  position: relative;
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  animation: fadeIn 0.5s ease-out 1.6s both;
}

/* ─── Gamification section + game phone ─── */
.game-phone-wrap {
  perspective: 800px;
}

#game-phone {
  position: relative;
  margin-inline: auto;
  width: min(100%, 260px);
  height: 500px;
  border-radius: 2.5rem;
  border: 4px solid rgba(10, 100, 159, 0.15);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6fc 100%);
  box-shadow: 0 24px 48px rgba(10, 100, 159, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  overflow: hidden;
  transition: transform 0.4s ease;
}

#game-phone.is-animating {
  animation: gamePhoneTilt 6s ease-in-out infinite;
}

@keyframes gamePhoneTilt {
  0%,
  100% {
    transform: rotateY(-4deg) rotateX(2deg);
  }
  50% {
    transform: rotateY(4deg) rotateX(-2deg);
  }
}

.game-phone-notch {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 5rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #0a649f;
  opacity: 0.15;
}

.game-phone-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.5rem 1.25rem 1.5rem;
}

.game-level-card {
  position: relative;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #0a649f, #084d78);
  padding: 1rem 1.1rem;
  color: white;
  box-shadow: 0 8px 24px rgba(10, 100, 159, 0.35);
  overflow: hidden;
}

.game-level-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(221, 157, 3, 0.25) 0%, transparent 70%);
  animation: gameShine 3s ease-in-out infinite;
}

@keyframes gameShine {
  0%,
  100% {
    opacity: 0.5;
    transform: translate(0, 0);
  }
  50% {
    opacity: 1;
    transform: translate(-10%, 10%);
  }
}

.game-level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.game-level-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #dd9d03, #f0b82e);
  font-size: 1.25rem;
  font-weight: 900;
  color: white;
  box-shadow: 0 4px 12px rgba(221, 157, 3, 0.5);
  animation: gameBadgePulse 2s ease-in-out infinite;
}

@keyframes gameBadgePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(221, 157, 3, 0.5);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(221, 157, 3, 0.7);
  }
}

.game-rank-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.game-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #f0b82e;
  position: relative;
  z-index: 1;
}

.game-xp-block {
  margin-top: 1.25rem;
  position: relative;
  z-index: 1;
}

.game-xp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.game-xp-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.game-xp-value {
  font-size: 1.35rem;
  font-weight: 900;
  color: #f0b82e;
  font-variant-numeric: tabular-nums;
}

.game-xp-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.game-xp-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #dd9d03, #ffe566);
  box-shadow: 0 0 10px rgba(221, 157, 3, 0.6);
  transition: width 1.8s cubic-bezier(0.34, 1.2, 0.64, 1);
  position: relative;
}

.game-xp-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  animation: xpShimmer 2s ease-in-out infinite;
}

@keyframes xpShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(200%);
  }
}

.game-xp-next {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.65);
}

.game-xp-floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.game-xp-bubble {
  position: absolute;
  bottom: 30%;
  font-size: 0.8rem;
  font-weight: 800;
  color: #dd9d03;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
  animation: gameBubbleRise 2.5s ease-out forwards;
  z-index: 5;
}

@keyframes gameBubbleRise {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.6);
  }
  15% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(1.1);
  }
}

.game-mini-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
}

.game-mini-card {
  border-radius: 0.75rem;
  background: white;
  border: 1px solid rgba(10, 100, 159, 0.1);
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #0a649f;
  box-shadow: 0 2px 8px rgba(10, 100, 159, 0.08);
  animation: gameMiniPop 0.5s ease-out both;
}

.game-mini-card:nth-child(1) {
  animation-delay: 0.2s;
}
.game-mini-card:nth-child(2) {
  animation-delay: 0.35s;
}
.game-mini-card:nth-child(3) {
  animation-delay: 0.5s;
}
.game-mini-card:nth-child(4) {
  animation-delay: 0.65s;
}

@keyframes gameMiniPop {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.game-mini-card span {
  display: block;
  font-size: 0.85rem;
  font-weight: 900;
  color: #dd9d03;
  margin-top: 0.15rem;
}

.level-pill {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 0.5rem 0.35rem;
  border-radius: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: white;
  border: 2px solid rgba(10, 100, 159, 0.12);
  color: #0a649f;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.level-pill.is-active {
  border-color: #dd9d03;
  background: linear-gradient(135deg, #fff8e7, #fff);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(221, 157, 3, 0.25);
}

.level-pill .level-num {
  display: block;
  font-size: 0.6rem;
  opacity: 0.7;
  margin-bottom: 0.1rem;
}

@media (prefers-reduced-motion: reduce) {
  .xp-intro,
  #game-phone.is-animating,
  .game-level-badge,
  .game-xp-fill::after {
    animation: none !important;
  }

  .xp-intro-bar-fill {
    width: 78% !important;
    animation: none !important;
  }
}

/* FAQ accordion */
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  color: #dd9d03;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  content: '−';
}

.faq-item[open] .faq-question {
  border-bottom: 1px solid rgba(10, 100, 159, 0.08);
}

.faq-item {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.faq-item[open] {
  border-color: rgba(221, 157, 3, 0.35);
  box-shadow: 0 4px 16px rgba(10, 100, 159, 0.08);
}
