/* ═══════════════════════════════════════════════
   Android App Store – Premium Dark Stylesheet
   ═══════════════════════════════════════════════ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Variables ── */
:root {
  --bg-primary: #020617;
  --bg-secondary: #0f172a;
  --bg-glass: rgba(255,255,255,0.03);
  --bg-glass-heavy: rgba(255,255,255,0.08);
  --accent: #0284c7;
  --accent-light: #38bdf8;
  --purple: #94a3b8;
  --pink: #e2e8f0;
  --success: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border: rgba(255,255,255,0.1);
  --border-accent: rgba(2,132,199,0.5);
  --shadow-glow: 0 0 40px rgba(2,132,199,0.25);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
  --ease: cubic-bezier(0.16,1,0.3,1);
  --font-en: 'Inter', system-ui, sans-serif;
  --font-ar: 'Cairo', 'Inter', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-en);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[dir='rtl'] body { font-family: var(--font-ar); }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input { font: inherit; color: inherit; border: none; outline: none; background: none; }
button { cursor: pointer; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: var(--radius-pill); }
html { scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg-secondary); }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Selection ── */
::selection { background: rgba(99,102,241,0.35); color: #fff; }

/* ═══════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  height: 72px; display: flex; align-items: center;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10,10,10,0.72);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.navbar.scrolled { background: rgba(10,10,10,0.92); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.logo {
  font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-accent { -webkit-text-fill-color: transparent; }

.nav-links {
  display: flex; gap: 4px;
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 4px;
}
.nav-link {
  padding: 8px 20px; border-radius: var(--radius-pill);
  font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
  transition: all 0.2s var(--ease);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-glass-heavy); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.hamburger {
  display: none; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer;
}
.hamburger span {
  display: block; width: 22px; height: 2px; background: var(--text-primary);
  border-radius: 2px; transition: all 0.2s var(--ease);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; font-size: 0.9rem; font-weight: 600;
  border-radius: var(--radius-pill); transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.btn-sm { padding: 8px 18px; font-size: 0.8rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}
.btn-primary:hover { box-shadow: 0 8px 32px rgba(99,102,241,0.45); transform: translateY(-2px); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}
.btn-accent:hover { box-shadow: 0 8px 32px rgba(99,102,241,0.45); transform: translateY(-2px); }

.btn-ghost {
  background: var(--bg-glass); border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-ghost:hover { background: var(--bg-glass-heavy); border-color: var(--border-accent); }

.btn-glass {
  background: var(--bg-glass); border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-glass:hover { color: var(--text-primary); border-color: var(--border-accent); background: var(--bg-glass-heavy); }

.btn-copy {
  background: var(--bg-glass); border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-copy:hover { color: var(--text-primary); border-color: var(--border-accent); }
.btn-copy.copied {
  background: rgba(16,185,129,0.15) !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
}

.btn-order {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; box-shadow: 0 4px 16px rgba(99,102,241,0.25);
}
.btn-order:hover { box-shadow: 0 6px 24px rgba(99,102,241,0.4); transform: translateY(-2px); }

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.hero {
  position: relative; min-height: calc(100vh - 72px);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px; overflow: hidden;
}
.hero-content { position: relative; z-index: 2; max-width: 720px; }
.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 900;
  line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 20px;
  background: linear-gradient(135deg, #fff, var(--text-secondary));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: slideUp 0.6s var(--ease) both;
}
.hero-subtitle {
  font-size: 1.15rem; color: var(--text-secondary);
  max-width: 540px; margin: 0 auto 36px; line-height: 1.8;
  animation: slideUp 0.6s var(--ease) 0.15s both;
}
.hero .btn { animation: slideUp 0.6s var(--ease) 0.3s both; }

/* ── Blobs ── */
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: 0.4; pointer-events: none;
}
.blob1 { width: 500px; height: 500px; background: var(--accent); top: -10%; left: -8%; animation: float 8s ease-in-out infinite; }
.blob2 { width: 400px; height: 400px; background: var(--purple); bottom: -10%; right: -6%; animation: float 10s ease-in-out infinite reverse; }
.blob3 { width: 300px; height: 300px; background: var(--pink); top: 50%; left: 50%; transform: translate(-50%,-50%); animation: float 12s ease-in-out infinite 2s; }

/* ═══════════════════════════════════════════════
   STORE
   ═══════════════════════════════════════════════ */
.store { padding: 80px 0; }
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800;
  text-align: center; margin-bottom: 48px; letter-spacing: -0.02em;
}
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ═══════════════════════════════════════════════
   APP CARD
   ═══════════════════════════════════════════════ */
.app-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: all 0.4s var(--ease);
  animation: fadeIn 0.5s var(--ease) both;
  transform-style: preserve-3d;
  perspective: 1000px;
}
.app-card:hover {
  transform: translateY(-10px) scale(1.02) rotateX(2deg) rotateY(-2deg);
  border-color: var(--accent);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 30px 60px rgba(2,132,199,0.25), 0 15px 30px rgba(0,0,0,0.5);
}

.card-image { position: relative; width: 100%; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-secondary); }

/* ── Slider ── */
.card-slider { position: relative; width: 100%; height: 100%; direction: ltr; }
.slider-track {
  display: flex; width: 100%; height: 100%;
  transition: transform 0.4s var(--ease);
}
.card-img {
  width: 100%; height: 100%; min-width: 100%;
  object-fit: contain; background: var(--bg-secondary);
  flex-shrink: 0;
}

/* ── Arrows ── */
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; z-index: 5;
  opacity: 0; transition: opacity 0.3s var(--ease), background 0.2s;
  border: 1px solid rgba(255,255,255,0.15);
}
.card-image:hover .slider-arrow { opacity: 1; }
.slider-arrow:hover { background: rgba(99,102,241,0.7); }
.slider-prev { left: 8px; }
.slider-next { right: 8px; }
[dir='rtl'] .slider-prev { left: auto; right: 8px; }
[dir='rtl'] .slider-next { right: auto; left: 8px; }

/* ── Dots ── */
.slider-dots {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 5;
}
.slider-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.35); border: none; cursor: pointer;
  transition: all 0.2s var(--ease); padding: 0;
}
.slider-dot.active { background: var(--accent); width: 20px; border-radius: 4px; }

/* ── Animated Background Particles ── */
.bg-particles {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
}
.bg-particle {
  position: absolute; width: 60px; height: 60px;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%230284c7" xmlns="http://www.w3.org/2000/svg"><path d="M17.523 15.3414C17.523 15.3414 17.523 15.3414 17.523 15.3414C17.523 16.0354 16.9602 16.5982 16.2661 16.5982C15.5721 16.5982 15.0093 16.0354 15.0093 15.3414C15.0093 14.6474 15.5721 14.0846 16.2661 14.0846C16.9602 14.0846 17.523 14.6474 17.523 15.3414ZM8.99065 15.3414C8.99065 16.0354 8.42784 16.5982 7.73383 16.5982C7.03983 16.5982 6.47701 16.0354 6.47701 15.3414C6.47701 14.6474 7.03983 14.0846 7.73383 14.0846C8.42784 14.0846 8.99065 14.6474 8.99065 15.3414ZM16.2081 9.77457L17.8427 6.94318C17.9254 6.79979 17.8767 6.61601 17.7333 6.53325C17.5899 6.45048 17.4061 6.49914 17.3234 6.64253L15.6568 9.52924C14.5422 9.02026 13.3106 8.73038 12.0003 8.73038C10.6899 8.73038 9.45832 9.02026 8.34375 9.52924L6.67715 6.64253C6.59438 6.49914 6.4106 6.45048 6.26721 6.53325C6.12382 6.61601 6.07516 6.79979 6.15793 6.94318L7.79248 9.77457C4.60623 11.5161 2.45781 14.7336 2.05191 18.5284H21.9486C21.5427 14.7336 19.3943 11.5161 16.2081 9.77457Z"/></svg>');
  background-size: contain; background-repeat: no-repeat;
  opacity: 0.05;
  animation: floatUp 20s linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.07; }
  90% { opacity: 0.07; }
  100% { transform: translateY(-20vh) rotate(360deg); opacity: 0; }
}

.details-modal-content {
  position: relative; max-width: 700px; width: 90%;
  transform: scale(0.9) translateY(20px); transition: all 0.4s var(--ease);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: 0 0 60px rgba(2,132,199,0.3), 0 20px 40px rgba(0,0,0,0.5);
  border: 1px solid var(--border); background: var(--bg-secondary);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-backdrop.active .details-modal-content { transform: scale(1) translateY(0); }
.details-body { padding: 30px; overflow-y: auto; line-height: 1.8; color: var(--text-secondary); font-size: 1.05rem; }

.card-body { padding: 20px; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ═══════════════════════════════════════════════
   MODAL (Order & Login)
   ═══════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden;
  transition: all 0.35s var(--ease);
}
.modal-backdrop.active { opacity: 1; visibility: visible; }

.modal-box {
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.45), var(--shadow-glow);
  padding: 32px;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s var(--ease);
}
.modal-backdrop.active .modal-box { transform: translateY(0) scale(1); }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.3rem; font-weight: 700; }
.modal-close {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: var(--radius-md); background: var(--bg-glass);
  border: 1px solid var(--border); font-size: 1.4rem;
  color: var(--text-secondary); transition: all 0.2s var(--ease);
}
.modal-close:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

.modal-appname { color: var(--accent-light); font-weight: 600; margin-bottom: 20px; }

.modal-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.option-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px; border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  background: var(--bg-glass); transition: all 0.2s var(--ease);
}
.option-card:hover { border-color: var(--border-accent); }
.option-card.selected { border-color: var(--accent); background: rgba(99,102,241,0.08); }
.option-card input { margin-top: 4px; accent-color: var(--accent); cursor: pointer; }
.option-body { display: flex; flex-direction: column; gap: 4px; }
.option-title { font-weight: 700; font-size: 1.05rem; }
.option-price { font-size: 1.3rem; font-weight: 800; color: var(--success); }
.option-note { font-size: 0.8rem; color: var(--text-muted); }

.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ── Login Modal ── */
.modal-login { max-width: 420px; }
.login-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 4px;
}
.login-tab {
  flex: 1; padding: 10px; border-radius: var(--radius-pill);
  font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
  transition: all 0.2s var(--ease); text-align: center;
}
.login-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.login-form { display: none; flex-direction: column; gap: 16px; }
.login-form.active { display: flex; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.form-group input {
  padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(0,0,0,0.3);
  color: var(--text-primary); font-size: 0.95rem;
  transition: border-color 0.2s var(--ease);
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text-muted); }

/* ═══════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary); border: 1px solid var(--success);
  color: var(--text-primary); padding: 14px 28px;
  border-radius: var(--radius-pill); font-size: 0.9rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(16,185,129,0.2);
  z-index: 3000; opacity: 0;
  transition: all 0.4s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
  padding: 40px 0; border-top: 1px solid var(--border);
  background: var(--bg-glass);
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer p { color: var(--text-muted); font-size: 0.85rem; }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--radius-md); background: var(--bg-glass);
  border: 1px solid var(--border); color: var(--text-secondary);
  transition: all 0.2s var(--ease);
}
.footer-socials a:hover {
  color: #fff; border-color: var(--border-accent);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float {
  0% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-50px) scale(1.1); }
  66% { transform: translate(-20px,20px) scale(0.9); }
  100% { transform: translate(0,0) scale(1); }
}

/* ═══════════════════════════════════════════════
   RTL OVERRIDES
   ═══════════════════════════════════════════════ */
[dir='rtl'] .card-actions { flex-direction: row-reverse; }
[dir='rtl'] .modal-actions { flex-direction: row-reverse; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; background: rgba(10,10,10,0.95);
    border-bottom: 1px solid var(--border); padding: 16px;
    border-radius: 0;
  }
  .nav-links.active { display: flex; }
  .hamburger { display: flex; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .store-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .modal-box { padding: 24px; }
  .modal-actions { flex-direction: column; }
  .btn-block-mobile { width: 100%; }
}

/* ═══════════════════════════════════════════════
   OFFER MODAL (POPUP)
   ═══════════════════════════════════════════════ */
#offerModal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  opacity: 0; visibility: hidden; transition: all 0.6s var(--ease);
}
#offerModal.active { opacity: 1; visibility: visible; }
.offer-modal-content {
  position: relative; max-width: 600px; width: 90%;
  transform: scale(0.75) translateY(50px); transition: all 0.6s var(--ease);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: 0 0 80px rgba(2,132,199,0.4), 0 20px 40px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  background: var(--bg-secondary);
}
#offerModal.active .offer-modal-content { transform: scale(1) translateY(0); }
.offer-modal-content img { width: 100%; display: block; object-fit: cover; max-height: 70vh; }
.offer-actions {
  display: flex; background: rgba(10,10,10,0.95); padding: 20px; gap: 15px; border-top: 1px solid var(--border);
}
.offer-actions .btn { flex: 1; font-size: 1.05rem; padding: 14px; }
