/* ═══════════════════════════════════════════════════════════
   DARK MODE – شطبلي مصر
   Professional dark theme with smooth transitions
   ═══════════════════════════════════════════════════════════ */

/* ── Global Transition ── */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition:
    background-color 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    fill 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

/* ── Dark Theme Variables ── */
[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-soft: #111827;
  --text: #e8ecf4;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.14);
  --glass: rgba(17, 24, 39, 0.78);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 18px 55px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 30px 90px rgba(135, 30, 53, 0.3);
  color-scheme: dark;
}

/* ── Body ── */
[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

/* ── Loader ── */
[data-theme="dark"] .loader {
  background: var(--bg);
}

/* ── Header / Nav ── */
[data-theme="dark"] .site-header.scrolled {
  background: rgba(11, 15, 26, 0.82);
  backdrop-filter: blur(22px);
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.08);
}

[data-theme="dark"] .nav-menu {
  border-color: rgba(148, 163, 184, 0.1);
  background: rgba(17, 24, 39, 0.85);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .nav-menu a {
  color: #cbd5e1;
}

[data-theme="dark"] .nav-menu a:hover,
[data-theme="dark"] .nav-menu a.active {
  background: var(--primary);
  color: #fff;
}

[data-theme="dark"] .nav-toggle span {
  background: #e2e8f0;
}

/* ── Buttons ── */
[data-theme="dark"] .btn-secondary {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.7);
}

[data-theme="dark"] .btn-primary {
  box-shadow: 0 16px 34px rgba(135, 30, 53, 0.35);
}

/* ── Hero ── */
[data-theme="dark"] .hero-bg {
  background:
    radial-gradient(
      circle at 80% 16%,
      rgba(135, 30, 53, 0.22),
      transparent 28%
    ),
    radial-gradient(
      circle at 16% 78%,
      rgba(34, 197, 94, 0.1),
      transparent 24%
    ),
    linear-gradient(180deg, #0d1117 0%, #0b0f1a 62%);
}

[data-theme="dark"] .hero-bg::after {
  background: linear-gradient(
    100deg,
    rgba(135, 30, 53, 0.12),
    rgba(184, 50, 79, 0.07),
    rgba(152, 30, 62, 0.06)
  );
}

[data-theme="dark"] .hero-trust span {
  border-color: rgba(148, 163, 184, 0.12);
  background: rgba(30, 41, 59, 0.55);
  color: var(--muted);
}

[data-theme="dark"] .hero-trust strong {
  color: #e2e8f0;
}

/* ── Float Cards ── */
[data-theme="dark"] .float-card {
  border-color: rgba(148, 163, 184, 0.1);
  background: rgba(17, 24, 39, 0.88);
  backdrop-filter: blur(22px);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .float-card strong {
  color: #e2e8f0;
}

[data-theme="dark"] .float-card small {
  color: #94a3b8;
}

[data-theme="dark"] .stars {
  background: rgba(251, 191, 36, 0.12);
}

/* ── Phone Shell ── */
[data-theme="dark"] .phone-shell,
[data-theme="dark"] .screen-phone {
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(148, 163, 184, 0.08);
}

/* ── Trusted Section ── */
[data-theme="dark"] .trusted {
  background: var(--bg);
}

[data-theme="dark"] .logo-strip span {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

[data-theme="dark"] .quick-stats {
  border-color: rgba(148, 163, 184, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .quick-stats article {
  background: rgba(17, 24, 39, 0.6);
  border-left-color: rgba(148, 163, 184, 0.08);
}

[data-theme="dark"] .quick-stats article:nth-child(-n+2) {
  border-bottom-color: rgba(148, 163, 184, 0.08);
}

/* ── Services ── */
[data-theme="dark"] .services {
  background: var(--bg-soft);
}

[data-theme="dark"] .service-card,
[data-theme="dark"] .step-card,
[data-theme="dark"] .compare-card,
[data-theme="dark"] .testimonial,
[data-theme="dark"] .faq-item {
  border-color: rgba(148, 163, 184, 0.08);
  background: rgba(30, 41, 59, 0.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .service-card:hover {
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
  border-color: rgba(135, 30, 53, 0.35);
}

[data-theme="dark"] .service-card h3,
[data-theme="dark"] .step-card h3,
[data-theme="dark"] .compare-card h3 {
  color: #e2e8f0;
}

[data-theme="dark"] .service-icon {
  filter: brightness(0.9) saturate(1.1);
}

/* ── Ads Slider ── */
[data-theme="dark"] .ads {
  background: var(--bg-soft);
}

[data-theme="dark"] .ad-slide img {
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
}

/* ── How / Steps ── */
[data-theme="dark"] .how {
  background: var(--bg);
}

/* ── Features (already dark, but enhance) ── */
[data-theme="dark"] .features {
  background: linear-gradient(180deg, #1a0a14, #2d0e1e);
}

[data-theme="dark"] .feature-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

/* ── Screens ── */
[data-theme="dark"] .screens {
  background: var(--bg-soft);
}

[data-theme="dark"] .slider-btn {
  border-color: rgba(148, 163, 184, 0.12);
  background: rgba(17, 24, 39, 0.9);
  color: #e2e8f0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ── Stats ── */
[data-theme="dark"] .stats {
  background:
    radial-gradient(
      circle at 80% 20%,
      rgba(135, 30, 53, 0.12),
      transparent 28%
    ),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

[data-theme="dark"] .stats-wrap {
  border-color: rgba(148, 163, 184, 0.08);
  background: rgba(17, 24, 39, 0.6);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(22px);
}

[data-theme="dark"] .stats-board article {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(45, 14, 30, 0.2));
  border-color: rgba(135, 30, 53, 0.15);
}

/* ── Why / Comparison ── */
[data-theme="dark"] .why {
  background: var(--bg);
}

[data-theme="dark"] .compare-card li {
  color: #94a3b8;
}

[data-theme="dark"] .compare-card li::before {
  background: #475569;
}

[data-theme="dark"] .compare-card.premium {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(45, 14, 30, 0.25));
  border-color: rgba(135, 30, 53, 0.3);
}

[data-theme="dark"] .compare-card.premium li::before {
  background: var(--success);
}

[data-theme="dark"] .compare-card.muted {
  background: rgba(30, 41, 59, 0.3);
}

[data-theme="dark"] .vs {
  box-shadow: 0 16px 34px rgba(152, 30, 62, 0.35);
}

/* ── Testimonials ── */
[data-theme="dark"] .testimonials {
  background: var(--bg-soft);
}

[data-theme="dark"] .testimonial p {
  color: #cbd5e1;
}

[data-theme="dark"] .testimonial-dots button {
  background: #334155;
}

[data-theme="dark"] .testimonial-dots button.active {
  background: var(--accent);
}

/* ── FAQ ── */
[data-theme="dark"] .faq {
  background: var(--bg);
}

[data-theme="dark"] .faq-item button {
  color: #e2e8f0;
}

[data-theme="dark"] .faq-item button span::before,
[data-theme="dark"] .faq-item button span::after {
  background: var(--accent);
}

/* ── Download / CTA ── */
[data-theme="dark"] .download {
  background:
    linear-gradient(135deg, rgba(15, 6, 10, 0.98), rgba(45, 14, 30, 0.95)),
    radial-gradient(
      circle at 20% 20%,
      rgba(135, 30, 53, 0.35),
      transparent 28%
    );
}

[data-theme="dark"] .cta {
  border-color: rgba(148, 163, 184, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .store-btn {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .store-btn small {
  color: #64748b;
}

/* ── Footer (already dark, subtle enhancements) ── */
[data-theme="dark"] .footer {
  background: #050810;
}

[data-theme="dark"] .copyright {
  border-top-color: rgba(148, 163, 184, 0.06);
}

/* ── Back to Top ── */
[data-theme="dark"] .back-to-top {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* ── Scroll Progress ── */
[data-theme="dark"] .scroll-progress {
  background: linear-gradient(90deg, var(--accent), var(--success));
}

/* ═══════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════ */

.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  overflow: hidden;
  transition: background 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] .theme-toggle {
  background: linear-gradient(135deg, #1e293b, #334155);
}

.theme-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 2;
}

[data-theme="dark"] .theme-toggle::before {
  transform: translateX(-24px);
  background: #fbbf24;
  box-shadow:
    0 2px 8px rgba(251, 191, 36, 0.3),
    0 0 12px rgba(251, 191, 36, 0.15);
}

/* Sun icon */
.theme-toggle .toggle-sun {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: #f59e0b;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1;
}

[data-theme="dark"] .theme-toggle .toggle-sun {
  opacity: 0;
  transform: translateY(-50%) rotate(90deg) scale(0.5);
}

/* Moon icon */
.theme-toggle .toggle-moon {
  position: absolute;
  top: 50%;
  left: 7px;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1;
}

[data-theme="dark"] .theme-toggle .toggle-moon {
  opacity: 1;
  color: #fbbf24;
  transform: translateY(-50%) rotate(0deg) scale(1);
}

/* ── Nav layout adjustment for toggle ── */
.nav {
  gap: 14px;
}

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

/* ── Mobile responsive for toggle ── */
@media (max-width: 860px) {
  .theme-toggle {
    order: -1;
  }
  
  .nav-actions {
    gap: 8px;
  }
  
  .nav-actions .nav-cta {
    display: none;
  }
}

/* ── Ambient glow in dark mode for visual richness ── */
[data-theme="dark"] .hero::after {
  content: "";
  position: absolute;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(135, 30, 53, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .services::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(135, 30, 53, 0.25), transparent);
}

[data-theme="dark"] .screens::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(135, 30, 53, 0.2), transparent);
}
