/*
  كادر - ستايل حديث (Dark + Glassmorphism)
  - RTL جاهز
  - متجاوب
*/

:root {
  --bg: #0b0f17;
  --bg-soft: #0f1420;
  --glass: rgba(255, 255, 255, 0.06);
  --card: rgba(255, 255, 255, 0.08);
  --text: #e7eaf3;
  --muted: #a8b0c3;
  --primary: #7c3aed; /* بنفسجي حديث */
  --primary-2: #06b6d4; /* تركواز */
  --accent: #22d3ee;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  /* إضافات بصرية */
  --neon1: #8b5cf6; /* violet */
  --neon2: #06b6d4; /* cyan */
  --ring: rgba(124,58,237,.55);
}

* { box-sizing: border-box; }
/* prevent directional overflow for RTL/LTR */
:where(body, .container, main) { overflow-x: clip; }
html { direction: rtl; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; height: -webkit-fill-available; background: var(--bg); overflow-x: clip; }
/* Reset / Normalize */
:where(html, body, div, span, applet, object, iframe,
 h1, h2, h3, h4, h5, h6, p, blockquote, pre,
 a, abbr, acronym, address, big, cite, code,
 del, dfn, em, img, ins, kbd, q, s, samp,
 small, strike, strong, sub, sup, tt, var,
 b, u, i, center,
 dl, dt, dd, ol, ul, li,
 fieldset, form, label, legend,
 table, caption, tbody, tfoot, thead, tr, th, td,
 article, aside, canvas, details, embed,
 figure, figcaption, footer, header, hgroup,
 menu, nav, output, ruby, section, summary,
 time, mark, audio, video) { margin: 0; padding: 0; border: 0; }
:where(*, *::before, *::after) { box-sizing: border-box; }
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; margin: 0; }
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  font-family: 'Cairo', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: clip; /* prevent horizontal scroll/gaps on mobile */
  /* Sticky footer layout + mobile fullscreen fix */
  height: -webkit-fill-available; /* iOS Safari */
  min-height: 100vh;  /* fallback for older browsers */
  min-height: 100svh; /* small viewport height (Android/iOS) */
  min-height: 100dvh; /* dynamic viewport height */
  display: flex;
  flex-direction: column;
}
/* طبقة إضاءة/نويز خفيفة لمزيد من العمق */
body::before {
  /* disabled heavy animated background for stability */
  content: none;
}
/* spotlight disabled by default */
#spotlight { display: none; }

.container { width: min(1200px, 92%); margin-inline: auto; position: relative; z-index: 1; padding-inline: 12px; }

main { flex: 1 0 auto; display: block; min-height: 1px; }

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(11,15,23,.85), rgba(11,15,23,.6));
  border-bottom: 1px solid rgba(255,255,255,.06);
}
/* Hamburger button */
.hamburger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.05); position: relative; }
.hamburger span { position: absolute; left: 50%; top: 50%; width: 22px; height: 2px; background: #e2e8f0; border-radius: 2px; transition: transform .22s ease, opacity .22s ease; transform-origin: center; }
.hamburger span:nth-child(1) { transform: translate(-50%, calc(-50% - 8px)); }
.hamburger span:nth-child(2) { transform: translate(-50%, -50%); }
.hamburger span:nth-child(3) { transform: translate(-50%, calc(-50% + 8px)); }
.hamburger.is-open span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translate(-50%, -50%) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav { position: fixed; inset: 0; background: rgba(11,15,23,.6); backdrop-filter: blur(8px); display: none; z-index: 999; overflow: hidden; }
.mobile-nav.open { display: block; }
.mobile-nav .mobile-nav-inner { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: min(86%, 360px); background: rgba(17,22,34,.92); border-inline-end: 1px solid rgba(255,255,255,.08); padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.45); overflow-y: auto; max-width: 100%; }
.mobile-nav .mobile-nav-inner a { display: block; padding: 12px 10px; color: #e2e8f0; text-decoration: none; border-radius: 10px; }
.mobile-nav .mobile-nav-inner a:hover { background: rgba(255,255,255,.06); }
#mobile-cta { width: 100%; display: inline-block; text-align: center; margin-top: 8px; }
.navbar::after {
  content: '';
  position: absolute; inset-inline: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon1), var(--neon2), transparent);
  opacity: .6;
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: .5px; }
.brand .brand-text.pro { font-family: 'Changa', 'Cairo', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; font-weight: 800; letter-spacing: .2px; }
.brand-badge {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 0 2px rgba(255,255,255,.06), 0 0 24px rgba(124,58,237,.35);
  color: white; font-weight: 900;
  animation: glowPulse 3.2s ease-in-out infinite;
}
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 600; position: relative; }
.nav-links a::after {
  content: ''; position: absolute; inset-inline: 0; bottom: -6px; height: 2px;
  background: linear-gradient(90deg, var(--neon1), var(--neon2));
  transform: scaleX(0); transform-origin: right; transition: transform .25s ease;
}
.nav-links a.active, .nav-links a:hover { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: left; }

.btn {
  padding: 10px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color: var(--text); text-decoration: none; font-weight: 700; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, filter .18s ease;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0; background:
    linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-120%);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(124,58,237,.22); filter: saturate(110%); }
.btn:hover::after { animation: shine .8s ease; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none; box-shadow: 0 10px 24px rgba(124,58,237,.28);
}
.btn-danger { background: linear-gradient(135deg, #ef4444, #f97316); border: none; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.12); }

/* Hero */
.hero { padding: 64px 0 24px; position: relative; }
.hero::before, .hero::after {
  /* disabled floating glows for stability */
  content: none;
}
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: center; }
.hero h1 { font-size: clamp(28px, 3.5vw, 46px); margin: 0 0 12px; background: linear-gradient(90deg, #fff, #c4b5fd 40%, #67e8f9 80%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 0 0 22px; font-size: 18px; }
.hero-card {
  background: transparent; border: none; border-radius: 0;
  box-shadow: none; padding: 0; overflow: visible; position: relative; isolation: isolate;
}

.hero-video { width: 100%; border-radius: 24px; aspect-ratio: 16/9; object-fit: cover; background: transparent; box-shadow: none; border: none; display: block; transform: translateZ(0); will-change: transform, filter; }

/* Hero video wrapper — no background layers */
.hero-video-wrap { position: relative; border-radius: 24px; isolation: isolate; overflow: visible; }
.hero-card { overflow: visible; }

/* Clean video with animated edge glow (no background behind) */
.hero-video {
  position: relative;
  z-index: 1;
  border-radius: 24px;
  background: #000;
  box-shadow:
    0 10px 28px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 0 18px rgba(124,58,237,.12),
    0 0 18px rgba(6,182,212,.08);
  animation: videoEdgeGlow 12s ease-in-out infinite alternate;
}

@keyframes videoEdgeGlow {
  0% {
    box-shadow:
      0 10px 28px rgba(0,0,0,.35),
      0 0 0 1px rgba(255,255,255,.06) inset,
      0 0 18px rgba(124,58,237,.12),
      0 0 18px rgba(6,182,212,.08);
  }
  50% {
    box-shadow:
      0 12px 34px rgba(0,0,0,.40),
      0 0 0 1px rgba(255,255,255,.08) inset,
      0 0 32px rgba(124,58,237,.20),
      0 0 28px rgba(6,182,212,.16);
  }
  100% {
    box-shadow:
      0 10px 28px rgba(0,0,0,.35),
      0 0 0 1px rgba(255,255,255,.06) inset,
      0 0 18px rgba(124,58,237,.12),
      0 0 18px rgba(6,182,212,.08);
  }
}


/* Brand logo styling */
.brand-logo { width: 36px; height: 36px; border-radius: 10px; display: block; object-fit: contain; filter: drop-shadow(0 0 8px rgba(124,58,237,.22)); }
@media (max-width: 480px) { .brand-logo { width: 32px; height: 32px; } }

/* Cookie banner */
.cookie-banner { position: fixed; inset-inline: 12px; bottom: 12px; z-index: 2000; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.10); background: rgba(17,22,34,.92); backdrop-filter: blur(10px); color: var(--text); box-shadow: var(--shadow); display: grid; gap: 10px; grid-template-columns: 1fr auto; align-items: center; max-width: 720px; margin-inline: auto; }
.cookie-banner p { margin: 0; color: var(--muted); font-size: 14px; }
.cookie-actions { display: flex; gap: 8px; }
.cookie-banner .btn { padding: 8px 12px; font-weight: 700; }
.cookie-banner .btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: none; }

/* remove neon embed artifacts entirely */
.neon-embed { border-radius: 0; overflow: visible; }
.neon-embed::before, .neon-embed::after { content: none; }

/* Overlay controls */
.hero-controls { position: absolute; inset-inline-start: 12px; inset-block-end: 12px; display: flex; gap: 8px; z-index: 5; }
.ctl {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  color: #eaf2ff; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px); box-shadow: 0 8px 20px rgba(0,0,0,.35), 0 0 20px rgba(124,58,237,.25) inset;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.ctl:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.45), 0 0 24px rgba(6,182,212,.3) inset; }
.ctl::after { font-size: 18px; line-height: 1; filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }
.ctl-play::after { content: '▶'; }
.ctl-play.is-playing::after { content: '⏸'; }
.ctl-mute::after { content: '🔇'; }
.ctl-mute.is-muted::after { content: '🔇'; }
.ctl-mute:not(.is-muted)::after { content: '🔊'; }

@keyframes neonSpin { to { transform: rotate(1turn); } }

@keyframes videoAura {
  0% { transform: rotate(0deg) scale(1); opacity: .55; }
  50% { transform: rotate(12deg) scale(1.03); opacity: .75; }
  100% { transform: rotate(22deg) scale(1.06); opacity: .6; }
}
.badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.badge { padding: 6px 10px; border-radius: 999px; font-size: 12px; background: rgba(124,58,237,.14); color: #c4b5fd; border: 1px solid rgba(124,58,237,.25); box-shadow: inset 0 0 14px rgba(124,58,237,.18); }

/* Sections */
.section { padding: 36px 0; position: relative; }
.section h2 { margin: 0 0 16px; font-size: 26px; background: none; color: var(--text); }
.section p.lead { color: var(--muted); margin-top: -4px; }
.section::after { content: none; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10); border-radius: 16px; padding: 14px;
  box-shadow: var(--shadow);
  position: relative; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card::before {
  content: '';
  position: absolute; inset: 0; border-radius: 16px; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(6,182,212,.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover {
  /* minimal hover to avoid motion issues */
  transform: none;
  box-shadow: var(--shadow);
  border-color: rgba(255,255,255,.12);
}
.card-media { border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; background: #0c0c0c; margin-bottom: 12px; position: relative; }
.card-media::after { display: none; }
.card-media video, .card-media img, .card-media model-viewer { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-title { font-weight: 800; margin-bottom: 6px; font-size: 18px; }
.card-desc { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* Shop */
.shop-grid { grid-template-columns: repeat(4, 1fr); }
.price { color: #a7f3d0; font-weight: 800; text-shadow: 0 0 18px rgba(16,185,129,.2); }
.old-price { text-decoration: line-through; color: #94a3b8; margin-inline-start: 6px; }

/* Forms */
.input, select {
  width: 100%; padding: 12px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04); color: var(--text); outline: none;
}
.label { font-weight: 700; margin-bottom: 8px; display: inline-block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Admin */
.admin-nav { display: flex; gap: 10px; margin: 12px 0 20px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: start; }
.table th { color: var(--muted); font-weight: 700; }

/* Footer */
.footer { padding: 24px 0; color: var(--muted); border-top: 1px solid rgba(255,255,255,.06); margin-top: auto; }
.footer .container { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.footer-extras { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.footer-extras .metrics { display: flex; gap: 14px; align-items: center; color: var(--text); }
.footer-extras .metrics strong { color: #a7f3d0; }
.footer-social { display: flex; gap: 10px; }
.footer-social .social { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #cbd5e1; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); transition: transform .2s ease, border-color .2s ease, color .2s ease; }
.footer-social .social:hover { color: #fff; transform: translateY(-3px); border-color: rgba(255,255,255,.18); }

/* Stats widget (unique, subtle, performant) */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stats .stat { position: relative; border: 1px solid rgba(255,255,255,.10); border-radius: 16px; padding: 14px 16px; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); overflow: hidden; isolation: isolate; }
.stats .stat-label { color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.stats .stat-value { font-size: clamp(22px, 4vw, 34px); font-weight: 900; letter-spacing: .5px; }

/* Orbital decoration */
.stat-orbits { position: absolute; inset: -20%; z-index: -1; filter: blur(0); pointer-events: none; }
.stat-orbits .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(124,58,237,.25); animation: none; }
.stat-orbits .r1 { transform: scale(.66); }
.stat-orbits .r2 { transform: scale(.9); border-color: rgba(6,182,212,.25); }
.stat-orbits .r3 { transform: scale(1.2); border-color: rgba(255,255,255,.12); }
.stat-orbits .planet { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-radius: 50%; box-shadow: 0 0 10px rgba(124,58,237,.5); transform: translate(-50%, -50%); }

/* Animations: reduced on mobile or when prefers-reduced-motion */
@media (prefers-reduced-motion: no-preference) {
  @media (min-width: 821px) {
    .stat-orbits .r1 { animation: orbit1 9s linear infinite; }
    .stat-orbits .r2 { animation: orbit2 12s linear infinite; }
    .stat-orbits .r3 { animation: orbit3 16s linear infinite; }
    .stat-orbits .planet { animation: planetPulse 2.6s ease-in-out infinite; }
  }
}

/* Number flip/roll (CSS-only) */
.stat-value { --val: attr(data-value number); position: relative; display: inline-block; padding-inline: 4px; }
.stat-value::before { content: attr(data-value); display: block; transform-origin: center;
  transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .6s, opacity .6s;
}
.stats.fancy .stat-value.bump::before { transform: translateY(-4px) scale(1.02); filter: drop-shadow(0 6px 16px rgba(124,58,237,.3)); }

@keyframes orbit1 { from { transform: rotate(0deg) scale(.66);} to { transform: rotate(360deg) scale(.66);} }
@keyframes orbit2 { from { transform: rotate(0deg) scale(.9);} to { transform: rotate(360deg) scale(.9);} }
@keyframes orbit3 { from { transform: rotate(0deg) scale(1.2);} to { transform: rotate(360deg) scale(1.2);} }
@keyframes planetPulse { 0%,100% { transform: translate(-50%,-50%) scale(1);} 50% { transform: translate(-50%,-50%) scale(1.2);} }

/* Utilities */
.row { display: flex; gap: 10px; align-items: center; }
.space { height: 18px; }
.center { text-align: center; }
.hide { display: none !important; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* 3D component polish */
model-viewer { background: #0b0f17; filter: none; }

/* Scrollbar (webkit) */
*::-webkit-scrollbar { height: 10px; width: 10px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,.04); }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--neon1), var(--neon2)); border-radius: 999px; }

/* Animations */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,.06), 0 0 16px rgba(124,58,237,.28); }
  50% { box-shadow: 0 0 0 2px rgba(255,255,255,.06), 0 0 28px rgba(6,182,212,.32); }
}
@keyframes shine { 100% { transform: translateX(120%); } }
@keyframes float { 0% { transform: translate3d(0,0,0); } 50% { transform: translate3d(0,-6px,0); } 100% { transform: translate3d(0,0,0); } }
@keyframes drift { 0% { transform: translate3d(0,0,0) rotate(0deg); } 100% { transform: translate3d(-2%, 2%, 0) rotate(1deg); } }

/***** Responsive breakpoints *****/
/* Large tablets / small laptops */
@media (max-width: 1200px) {
  .container { width: min(1040px, 94%); }
}

/* Tablets */
@media (max-width: 1024px) {
  .container { width: min(900px, 94%); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
}

/* Large phones */
@media (max-width: 820px) {
  .container { width: min(720px, 92%); }
  .grid, .shop-grid, .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero h1 { font-size: clamp(26px, 6vw, 36px); }
  .hamburger { display: inline-grid; }
}

/* Phones */
@media (max-width: 480px) {
  .container { width: min(420px, 92%); }
  .btn { padding: 14px 18px; min-height: 44px; } /* مساحة لمس مريحة */
  .brand { font-size: 20px; }
  .brand-badge { width: 34px; height: 34px; }
  .card { padding: 12px; border-radius: 14px; }
  .card-media { border-radius: 10px; }
  .section { padding: 28px 0; }
  .footer .container { gap: 10px; }
}

/***** Safe area for notches (iPhone) *****/
@supports (padding: max(0px)) {
  body { padding-left: max(env(safe-area-inset-left), 0px); padding-right: max(env(safe-area-inset-right), 0px); }
  .navbar { padding-top: max(env(safe-area-inset-top), 0px); }
  .footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}