/* ═══════════════════════════════════════════════
   Codexo — Shared Design System
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
  --bg:           #07080f;
  --bg2:          #0d0f1e;
  --bg3:          #0f1120;
  --surface:      rgba(255,255,255,0.04);
  --surface2:     rgba(255,255,255,0.07);
  --border:       rgba(255,255,255,0.08);
  --border2:      rgba(255,255,255,0.15);
  --accent:       #4f8ef7;
  --accent2:      #7c3aed;
  --accent3:      #06d6a0;
  --orange:       #f97316;
  --text:         #e8eaf0;
  --text-muted:   #8892a4;
  --text-faint:   #3a4259;
  --font:         'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ar:      'Noto Sans Arabic', 'Inter', sans-serif;
  --r:            14px;
  --r-lg:         22px;
  --r-xl:         32px;
  --nav-h:        64px;
  --ease:         0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 17px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body[dir="rtl"] { font-family: var(--font-ar); }

/* ─── BG GRID ─── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

/* ─── AMBIENT ORBS ─── */
.cx-orb {
  position: fixed; border-radius: 50%;
  filter: blur(140px); pointer-events: none; z-index: 0;
}
.cx-orb-1 { width: 700px; height: 700px; background: rgba(79,142,247,.1);  top: -200px; right: -200px; }
.cx-orb-2 { width: 500px; height: 500px; background: rgba(124,58,237,.08); bottom: 0; left: -200px; }

/* ─── LAYOUT ─── */
.cx-container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

main { position: relative; z-index: 1; padding-top: var(--nav-h); }

/* ─── NAV ─── */
#cx-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(7,8,15,.85);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.cx-nav-logo { display: flex; align-items: center; text-decoration: none; }
.cx-nav-logo img { height: 34px; width: auto; }

.cx-nav-items {
  display: flex; align-items: center; gap: 4px; list-style: none;
}

.cx-nav-items a {
  display: block; padding: 8px 14px; border-radius: 10px;
  text-decoration: none; color: var(--text-muted);
  font-size: 14px; font-weight: 500; transition: var(--ease);
  white-space: nowrap;
}
.cx-nav-items a:hover,
.cx-nav-items a.active { color: var(--text); background: var(--surface2); }

/* Products dropdown trigger */
.cx-nav-dropdown { position: relative; }

.cx-nav-dropdown-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: none;
  background: transparent; color: var(--text-muted);
  font-size: 14px; font-weight: 500; font-family: var(--font);
  cursor: pointer; transition: var(--ease); white-space: nowrap;
}
.cx-nav-dropdown-btn:hover { color: var(--text); background: var(--surface2); }
.cx-nav-dropdown-btn svg { transition: transform var(--ease); }
.cx-nav-dropdown.open .cx-nav-dropdown-btn svg { transform: rotate(180deg); }

/* Dropdown panel */
.cx-dropdown-panel {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 280px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
  /* invisible bridge fills the gap so mouse doesn't lose hover */
}
.cx-nav-dropdown.open .cx-dropdown-panel {
  opacity: 1; pointer-events: all; transform: translateY(0);
}

/* Invisible bridge between button and panel — prevents gap from breaking hover */
.cx-dropdown-panel::before {
  content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 12px;
}

[dir="rtl"] .cx-dropdown-panel { left: auto; right: 0; }

.cx-dropdown-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r);
  text-decoration: none; color: var(--text);
  transition: var(--ease); cursor: pointer;
}
.cx-dropdown-item:hover { background: var(--surface2); }

.cx-dropdown-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(79,142,247,.15), rgba(124,58,237,.15));
  border: 1px solid rgba(79,142,247,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.cx-dropdown-text-name { font-size: 14px; font-weight: 600; color: var(--text); }
.cx-dropdown-text-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Nav right group */
.cx-nav-right { display: flex; align-items: center; gap: 8px; }

/* Language switcher */
.cx-lang-menu { position: relative; }

.cx-lang-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  font-size: 13px; font-weight: 500; font-family: var(--font);
  cursor: pointer; transition: var(--ease);
}
.cx-lang-btn:hover { color: var(--text); border-color: var(--border2); }

.cx-lang-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 160px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 6px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 300;
}
[dir="rtl"] .cx-lang-panel { right: auto; left: 0; }

.cx-lang-menu.open .cx-lang-panel {
  opacity: 1; pointer-events: all; transform: translateY(0);
}

.cx-lang-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  cursor: pointer; transition: var(--ease);
  font-size: 13px; color: var(--text-muted);
}
.cx-lang-option:hover { background: var(--surface2); color: var(--text); }
.cx-lang-option.active { color: var(--accent); }
.cx-lang-flag { font-size: 16px; }

/* Mobile hamburger */
.cx-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 10px; cursor: pointer;
}
.cx-hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-muted); border-radius: 2px; transition: var(--ease);
}
.cx-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.cx-hamburger.open span:nth-child(2) { opacity: 0; }
.cx-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

/* ─── MOBILE NAV ─── */
@media (max-width: 768px) {
  #cx-nav { padding: 0 16px; }
  .cx-hamburger { display: flex; }
  .cx-nav-center {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: rgba(7,8,15,.98); backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch;
    padding: 16px; gap: 4px;
    transform: translateY(-100%); opacity: 0; pointer-events: none;
    transition: transform .3s ease, opacity .3s ease;
  }
  .cx-nav-center.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .cx-nav-items { flex-direction: column; align-items: stretch; gap: 2px; }
  .cx-nav-items a { padding: 12px 16px; }
  .cx-nav-dropdown-btn { padding: 12px 16px; width: 100%; }
  .cx-dropdown-panel { position: static; opacity: 1; pointer-events: all; transform: none; box-shadow: none; margin-top: 4px; }
  .cx-lang-panel { right: 0; }
}

/* ─── FOOTER ─── */
#cx-footer {
  border-top: 1px solid var(--border);
  padding: 40px 32px;
  position: relative; z-index: 1;
}
.cx-footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.cx-footer-logo img { height: 28px; width: auto; opacity: .65; }
.cx-footer-links { display: flex; flex-wrap: wrap; gap: 20px; list-style: none; }
.cx-footer-links a {
  color: var(--text-faint); text-decoration: none;
  font-size: 13px; transition: color var(--ease);
}
.cx-footer-links a:hover { color: var(--text-muted); }
.cx-footer-copy { color: var(--text-faint); font-size: 13px; }

@media (max-width: 640px) {
  #cx-footer { padding: 32px 16px; }
  .cx-footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
}

/* ─── COMMON COMPONENTS ─── */

/* Buttons */
.cx-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 12px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: var(--ease); cursor: pointer; border: none;
  font-family: var(--font);
}
.cx-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 6px 24px rgba(79,142,247,.25);
}
.cx-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(79,142,247,.35); }

.cx-btn-ghost {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text);
}
.cx-btn-ghost:hover { background: var(--surface2); border-color: var(--border2); transform: translateY(-2px); }

/* Section labels / headings */
.cx-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--accent); display: inline-block;
  margin-bottom: 12px; padding-bottom: 8px; position: relative;
}
.cx-label::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 28px; height: 2px; border-radius: 2px;
  background: var(--orange);
}
.cx-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700;
  letter-spacing: -1.5px; line-height: 1.15; margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, #99aec8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.cx-sub {
  color: var(--text-muted); font-size: 1.05rem;
  max-width: 500px; line-height: 1.75;
}

/* Card */
.cx-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 32px;
  transition: var(--ease); position: relative; overflow: hidden;
}
.cx-card:hover {
  background: var(--surface2); border-color: rgba(79,142,247,.2);
  transform: translateY(-4px);
}
.cx-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,142,247,.4), transparent);
  opacity: 0; transition: var(--ease);
}
.cx-card:hover::before { opacity: 1; }

/* Icon box */
.cx-icon-box {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: rgba(79,142,247,.08); border: 1px solid rgba(79,142,247,.15);
  margin-bottom: 20px;
}

/* Badge */
.cx-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 50px;
  background: rgba(79,142,247,.08); border: 1px solid rgba(79,142,247,.2);
  color: var(--accent); font-size: 13px; font-weight: 500;
  margin-bottom: 28px; letter-spacing: .3px;
}
.cx-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); animation: cx-blink 2s ease-in-out infinite;
}
@keyframes cx-blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Tag chips */
.cx-chip {
  padding: 5px 13px; border-radius: 50px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}

/* Divider */
.cx-sep {
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  margin: 0 32px;
  opacity: 0.35;
}

/* ─── FADE-UP ANIMATION ─── */
.cx-fade {
  opacity: 0; transform: translateY(24px);
  transition: opacity .65s ease, transform .65s ease;
}
.cx-fade.visible { opacity: 1; transform: none; }
.cx-fade:nth-child(2) { transition-delay: .08s; }
.cx-fade:nth-child(3) { transition-delay: .16s; }
.cx-fade:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .cx-fade { opacity: 1; transform: none; transition: none; }
}

/* ─── PHONE MOCKUP ─── */
.cx-phone {
  background: #1a1d2e; border-radius: 36px; padding: 12px;
  border: 1.5px solid rgba(255,255,255,.1);
  box-shadow: 0 40px 80px rgba(0,0,0,.6);
  transition: var(--ease);
}
.cx-phone:hover { transform: translateY(-8px) scale(1.02); border-color: rgba(79,142,247,.3); }
.cx-phone-notch {
  width: 70px; height: 20px; background: #07080f;
  border-radius: 12px; margin: 0 auto 8px;
}
.cx-phone-screen {
  border-radius: 26px; overflow: hidden;
  aspect-ratio: 9/19.5; background: #0d0f1e;
}
.cx-phone-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ─── PAGE HERO (inner pages) ─── */
.cx-page-hero {
  padding: 80px 0 60px; text-align: center;
}
.cx-hero-h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800;
  letter-spacing: -2.5px; line-height: 1.08; margin-bottom: 18px;
  background: linear-gradient(135deg, #fff 0%, #8899bb 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.cx-hero-h1 span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ─── STORE BUTTONS ─── */
.cx-store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 22px; border-radius: var(--r);
  text-decoration: none; transition: var(--ease);
  border: 1px solid var(--border); background: var(--surface);
  min-width: 175px;
}
.cx-store-btn:hover {
  background: var(--surface2); border-color: var(--border2);
  transform: translateY(-3px); box-shadow: 0 20px 40px rgba(0,0,0,.4);
}
.cx-store-icon { width: 36px; height: 36px; flex-shrink: 0; }
.cx-store-text { text-align: start; }
.cx-store-sub { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; line-height: 1; }
.cx-store-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }

[dir="rtl"] .cx-store-text { text-align: end; }

/* ─── CONTAINER RESPONSIVE ─── */
@media (max-width: 640px) {
  .cx-container { padding: 0 16px; }
  .cx-sep { margin: 0 16px; }
}
