/* ==========================================================================
   CodeMe Marketing Site - Production CSS
   Author: CodeMe Team
   ========================================================================== */

:root {
  --primary: #0066ff;
  --primary-dark: #0052cc;
  --secondary: #6b46ff;
  --accent: #ffd700;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-dark: #0a0e27;
  --text: #1a1a1a;
  --text-light: #6b7280;
  --text-on-dark: #f5f5f7;
  --border: #e5e7eb;
  --green: #10b981;
  --pink: #ec4899;
  --orange: #f59e0b;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 24px 48px rgba(0,0,0,.12);
  --shadow-glow: 0 0 60px rgba(107,70,255,.3);
  --container: 1180px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body[lang="en"] {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
@media (max-width: 768px) { .section { padding: 64px 0; } }

/* ===== Typography ===== */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(40px, 6vw, 72px); }
h2 { font-size: clamp(32px, 4vw, 48px); }
h3 { font-size: clamp(20px, 2.5vw, 28px); }
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(0,102,255,.1), rgba(107,70,255,.1));
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  margin-bottom: 16px;
  border: 1px solid rgba(0,102,255,.2);
}
.section-title {
  text-align: center;
  margin-bottom: 16px;
}
.section-sub {
  text-align: center;
  font-size: 18px;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto 48px;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
}
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: grid;
  place-items: center;
  color: white;
  font-size: 18px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a { font-weight: 500; color: var(--text-light); }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--text);
  color: white !important;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}
.nav-cta:hover { background: var(--primary); transform: translateY(-1px); }
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-alt);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; font-size: 24px; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 140px 0 96px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 400px at 20% -10%, rgba(0,102,255,.18), transparent 60%),
    radial-gradient(700px 400px at 100% 10%, rgba(107,70,255,.18), transparent 60%),
    radial-gradient(600px 300px at 50% 100%, rgba(236,72,153,.10), transparent 60%);
  z-index: -1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  margin-bottom: 20px;
  line-height: 1.05;
}
.hero-sub {
  font-size: 19px;
  color: var(--text-light);
  margin-bottom: 32px;
  max-width: 540px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  transition: var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 10px 30px rgba(0,102,255,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,102,255,.5); }
.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
}
.btn-secondary:hover { background: var(--border); }
.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: black;
  color: white;
  padding: 12px 24px;
  border-radius: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.app-store-badge:hover { transform: translateY(-2px); }
.app-store-badge svg { width: 36px; height: 36px; }
.app-store-badge .badge-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.app-store-badge .badge-text small { font-size: 11px; opacity: .8; font-weight: 400; }
.app-store-badge .badge-text strong { font-size: 20px; font-weight: 700; }

.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.stat-num {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 13px; color: var(--text-light); }

/* iPhone mockup (CSS only) */
.hero-phone {
  position: relative;
  display: grid;
  place-items: center;
  perspective: 1000px;
}
.phone {
  width: 320px;
  height: 640px;
  background: #1a1a1a;
  border-radius: 50px;
  padding: 14px;
  box-shadow:
    0 50px 100px rgba(0,0,0,.3),
    0 0 0 2px #2a2a2a,
    inset 0 0 0 2px #3a3a3a;
  position: relative;
  transform: rotateY(-8deg) rotateX(2deg);
  animation: float 6s ease-in-out infinite;
}
.phone::before {
  content: '';
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 30px;
  background: #000;
  border-radius: 999px;
  z-index: 2;
}
.phone-screen {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #f8f8ff 0%, #eef0ff 100%);
  border-radius: 38px;
  overflow: hidden;
  position: relative;
  padding: 56px 16px 20px;
}
.phone-screen h4 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
}
.phone-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.phone-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: white;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
}
.phone-pill.active {
  background: var(--primary);
  color: white;
}
.phone-card {
  background: white;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  animation: cardSlide 0.6s ease-out backwards;
}
.phone-card:nth-child(1) { animation-delay: 0.4s; }
.phone-card:nth-child(2) { animation-delay: 0.6s; }
.phone-card-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.phone-card-content {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 10px;
}
.phone-card-btn {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.phone-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle, rgba(107,70,255,.3), transparent 60%);
  z-index: -1;
  filter: blur(40px);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: rotateY(-8deg) rotateX(2deg) translateY(0); }
  50% { transform: rotateY(-8deg) rotateX(2deg) translateY(-16px); }
}
@keyframes pulse {
  0%, 100% { opacity: .6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes cardSlide {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-cta, .hero-stats { justify-content: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .phone { width: 260px; height: 520px; }
}

/* ===== Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.feature::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--feature-color, var(--primary)), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.feature:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.feature:hover::before { opacity: 0.05; }
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: white;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--feature-color, var(--primary)), var(--feature-color-dark, var(--secondary)));
  box-shadow: 0 8px 20px var(--feature-shadow, rgba(0,102,255,.3));
}
.feature h3 { font-size: 20px; margin-bottom: 8px; }
.feature p { color: var(--text-light); font-size: 15px; }

/* ===== Showcase (alternating sections) ===== */
.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 96px;
}
.showcase:last-child { margin-bottom: 0; }
.showcase.reverse { direction: rtl; }
body[dir="rtl"] .showcase.reverse { direction: ltr; }
.showcase.reverse > * { direction: ltr; }
body[dir="rtl"] .showcase.reverse > * { direction: rtl; }

.showcase-visual {
  position: relative;
  border-radius: var(--radius);
  padding: 48px;
  min-height: 380px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.showcase-visual.gradient-1 { background: linear-gradient(135deg, #dbeafe, #ddd6fe); }
.showcase-visual.gradient-2 { background: linear-gradient(135deg, #fef3c7, #fce7f3); }
.showcase-visual.gradient-3 { background: linear-gradient(135deg, #d1fae5, #cffafe); }
.showcase-visual.gradient-4 { background: linear-gradient(135deg, #ede9fe, #fae8ff); }
.showcase-icon {
  font-size: 120px;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.15));
}
.showcase h2 { margin-bottom: 16px; }
.showcase p { font-size: 17px; color: var(--text-light); margin-bottom: 20px; }
.showcase-list { margin-top: 24px; }
.showcase-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: 16px;
}
.check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .showcase, .showcase.reverse { grid-template-columns: 1fr; direction: inherit; }
}

/* ===== Stats Bar ===== */
.stats-bar {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 64px 0;
  color: white;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  text-align: center;
}
.stat-big {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1;
}
.stat-desc { font-size: 16px; opacity: 0.9; }

/* ===== CTA Section ===== */
.cta-section {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  text-align: center;
  border-radius: 32px;
  padding: 80px 32px;
  margin: 0 24px;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(0,102,255,.3), transparent 60%),
    radial-gradient(500px 300px at 80% 100%, rgba(107,70,255,.3), transparent 60%);
}
.cta-section > * { position: relative; z-index: 1; }
.cta-section h2 { color: white; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,.7); margin-bottom: 32px; font-size: 18px; }

/* ===== Footer ===== */
.footer {
  background: #fafafa;
  padding: 64px 0 32px;
  margin-top: 96px;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand { max-width: 320px; }
.footer-brand p { color: var(--text-light); margin-top: 12px; font-size: 15px; }
.footer h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-links li { padding: 6px 0; }
.footer-links a { color: var(--text-light); font-size: 15px; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--text-light);
}
.made-with {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.flag-sa {
  width: 22px;
  height: 14px;
  background: linear-gradient(180deg, #006C35 50%, #006C35 50%);
  border-radius: 2px;
  display: inline-block;
  position: relative;
}
.heart { color: #ef4444; animation: heartbeat 1.5s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ===== Animation Helpers ===== */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-up.delay-1 { transition-delay: 0.1s; }
.fade-up.delay-2 { transition-delay: 0.2s; }
.fade-up.delay-3 { transition-delay: 0.3s; }

/* ===== Privacy / Terms Pages ===== */
.legal-page {
  padding-top: 140px;
  padding-bottom: 96px;
}
.legal-content {
  max-width: 800px;
  margin: 0 auto;
}
.legal-content h1 { margin-bottom: 12px; }
.legal-meta { color: var(--text-light); margin-bottom: 48px; font-size: 14px; }
.legal-content h2 { font-size: 24px; margin: 40px 0 16px; }
.legal-content h3 { font-size: 19px; margin: 24px 0 12px; }
.legal-content p { margin-bottom: 16px; color: var(--text); line-height: 1.8; }
.legal-content ul { margin-bottom: 16px; padding-inline-start: 24px; }
.legal-content li { padding: 4px 0; line-height: 1.8; list-style: disc; }
.legal-content a { color: var(--primary); text-decoration: underline; }
.legal-toc {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 48px;
}
.legal-toc h3 { font-size: 16px; margin-bottom: 12px; }
.legal-toc ol { padding-inline-start: 20px; }
.legal-toc li { padding: 4px 0; }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .phone { animation: none; }
  .phone-glow { animation: none; }
  .heart { animation: none; }
}
