/* 
 * Ultra Premium Landing Page CSS (Rebuild v1)
 * Direction: RTL Native
 * Design System: Deep Void / Crisp Light
 */

:root {
  /* --- Palette: Light Mode --- */
  --bg: #ffffff;
  --bg-alt: #f8faff;
  --surface: #ffffff;
  --surface-strong: #f3f0ff;

  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-muted: #94a3b8;

  /* Brand Accents */
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-dark: #5b21b6;
  --accent-glow: rgba(124, 58, 237, 0.4);
  --accent-pink: #d946ef;
  --accent-cyan: #06b6d4;

  /* Structural */
  --border: rgba(148, 163, 184, 0.2);
  --glass: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.5);

  /* Shadows */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);

  /* Radii */
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --trans-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  /* --- Palette: Dark Mode --- */
  --bg: #030014;
  --bg-alt: #0a051e;
  --surface: #110a26;
  --surface-strong: #1c1038;

  --ink: #f8fafc;
  --ink-soft: #cbd5e1;
  --ink-muted: #64748b;

  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(17, 10, 38, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 60px rgba(124, 58, 237, 0.2);
}

/* --- Reset & Base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Tajawal', sans-serif;
  scroll-behavior: smooth;
  direction: rtl;
  /* Enforce RTL at root */
}

body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background Gradients */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 50%, rgba(217, 70, 239, 0.08) 0%, transparent 40%);
  z-index: -2;
  pointer-events: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Layout Utilities --- */
.container {
  width: min(1280px, 92%);
  margin: 0 auto;
}

.section {
  padding: 80px 0;
  position: relative;
}

/* --- Typography --- */
h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

p {
  font-size: 1.125rem;
  color: var(--ink-soft);
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 24px;
}

/* --- Navbar (RTL Native) --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .navbar {
  background: rgba(3, 0, 20, 0.85);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
}

/* Desktop Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links-wrapper {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.btn.primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.btn.outline {
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn.outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Hero Section (RTL Grid) --- */
.hero {
  padding-top: 60px;
  overflow: hidden;
  /* Critical for floating elements */
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* RTL: First column is Right, Second is Left */
  align-items: center;
  gap: 60px;
}

.hero-content {
  z-index: 10;
  position: relative;
}

.hero-visual {
  position: relative;
  height: 500px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(217, 70, 239, 0.1));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* Floating Cards - Explicit RTL Positioning */
.msg-card {
  position: absolute;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 280px;
  animation: float 6s ease-in-out infinite;
}

.msg-icon {
  width: 40px;
  height: 40px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msg-text strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
}

.msg-text span {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* Explicit Positions inside .hero-visual container */
.msg-card.one {
  top: 15%;
  right: 20px;
  /* Right side in container */
  left: auto;
  animation-delay: 0s;
}

.msg-card.two {
  bottom: 20%;
  left: 20px;
  /* Left side in container */
  right: auto;
  animation-delay: 2s;
}

.msg-card.three {
  top: 50%;
  left: 10%;
  /* Closer to center-left */
  right: auto;
  animation-delay: 4s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* --- Mobile Responsiveness --- */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-visual {
    order: -1;
    /* Visual on top */
    height: 400px;
  }

  .msg-card {
    transform: scale(0.9);
  }

  .nav-menu {
    position: absolute;
    top: 80px;
    right: 0;
    left: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: none;
    /* JS toggle required */
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-links-wrapper {
    flex-direction: column;
    width: 100%;
    gap: 16px;
  }

  .mobile-toggle {
    display: block;
  }
}
/* --- Phase 3: Components --- */

/* Bento Grid (RTL Grid) */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.bento-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
  position: relative;
  overflow: hidden;
  transition: all var(--trans-smooth);
}
.bento-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.bento-card.span-2 { grid-column: span 2; }
.bento-card.span-3 { grid-column: span 3; }

.card-icon {
  width: 56px; height: 56px;
  background: var(--surface);
  color: var(--accent);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

/* Feature Stack */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
  transition: all 0.2s;
}
.stack-card:hover { border-color: var(--accent); }

.stack-list {
  list-style: none;
  margin-top: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.stack-list li {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-soft);
}
.stack-list i { color: var(--accent); }

/* Marketplace Section */
.marketplace-box {
  background: var(--surface-strong);
  border-radius: var(--radius-lg);
  padding: 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.marketplace-box::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.marketplace-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.marketplace-stat strong { display: block; font-size: 2rem; color: var(--accent); line-height: 1; }
.marketplace-stat span { font-size: 0.9rem; color: var(--ink-muted); }

/* --- Phase 4: Trust & Visuals --- */
.trust-strip {
  padding: 40px 0;
  border-block: 1px solid var(--border);
  background: var(--bg-alt);
  margin: 60px 0;
}
.trust-logos {
  display: flex; justify-content: center; gap: 60px;
  flex-wrap: wrap;
  opacity: 0.6; filter: grayscale(1);
  transition: all 0.4s;
}
.trust-logos:hover { opacity: 1; filter: grayscale(0); }
.trust-logo-item {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.2rem;
}

/* Footer (Grid) */
.footer {
  padding: 80px 0 40px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr; /* RTL aware */
  gap: 40px;
  margin-bottom: 60px;
}
.footer-col h4 { margin-bottom: 24px; color: var(--ink); }
.footer-col a { display: block; color: var(--ink-muted); margin-bottom: 12px; text-decoration: none; }
.footer-col a:hover { color: var(--accent); }

/* --- Phase 5: Mobile Support (Additional) --- */
@media (max-width: 960px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-card.span-2, .bento-card.span-3 { grid-column: span 1; }
  
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .marketplace-stats { gap: 20px; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .nav-header { width: 100%; display: flex; justify-content: space-between; align-items: center; }
}

/* Animations Utility */
.reveal { opacity: 0; transform: translateY(20px); animation: reveal 0.8s forwards; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }


/* --- Additional Components & Fixes --- */

/* Hero Stats */
.stats-grid {
  display: flex;
  gap: 24px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.stat-card {
  flex: 1;
}
.stat-card strong { display: block; font-size: 1.25rem; color: var(--ink); line-height: 1; margin-bottom: 4px; }
.stat-card span { font-size: 0.85rem; color: var(--ink-muted); }

/* Ticker (Hero) */
.ticker {
  margin-top: 24px;
  overflow: hidden;
  white-space: nowrap;
  background: var(--bg-alt);
  padding: 10px 0;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.ticker-track {
  display: inline-flex;
  gap: 32px;
  animation: scroll 30s linear infinite;
}
.ticker-track span { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

/* Store Persona Styles */
.store-persona {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 60px;
  border: 1px solid var(--border);
}
.store-persona-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}
.store-persona-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}
.store-persona-item i { color: var(--accent); }

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 60px;
}
.step-card {
  text-align: center;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: relative;
}
.step-number {
  width: 44px; height: 44px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  margin: 0 auto 20px;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

/* CTA Section */
.cta {
  background: var(--accent);
  color: white;
  padding: 100px 0;
  text-align: center;
  border-radius: var(--radius-lg);
  margin: 80px 0;
  position: relative;
  overflow: hidden;
}
.cta h2 { color: white; margin-bottom: 20px; }
.cta p { color: rgba(255, 255, 255, 0.8); max-width: 600px; margin: 0 auto 40px; }
.cta .btn.primary { background: white; color: var(--accent); }

/* Persona Shell Positioning */
.persona-shell {
  z-index: 5;
  pointer-events: none;
}
.persona-hero-figure {
  position: absolute;
  bottom: 0;
  left: 20px;
  max-width: 200px;
}
.persona-inline { margin: 40px auto; max-width: 240px; text-align: center; }
.persona-cta { position: absolute; bottom: -20px; right: 20px; max-width: 180px; opacity: 0.3; }

/* Mobile refinement */
@media (max-width: 960px) {
  .store-persona { grid-template-columns: 1fr; padding: 40px 20px; }
  .steps-grid { grid-template-columns: 1fr; }
  .cta { padding: 60px 20px; margin: 40px 0; }
  .persona-hero-figure { position: relative; left: auto; margin: 20px auto; }
}


/* --- Refinements --- */
.marketplace-stat strong { font-size: 1.25rem; } /* Adjusted for text content */
.marketplace-stat strong i { margin-inline-end: 8px; }

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.impact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 30px;
  border-radius: var(--radius-md);
}
.impact-card h4 { margin-bottom: 12px; color: var(--accent); }

/* Ensure persona images don't hide text on mobile */
@media (max-width: 600px) {
  .persona-shell img { max-height: 150px; width: auto; margin: 0 auto; }
  .stat-card { text-align: center; }
}

