/* style.css */

:root {
  --accent-red: #ff4d4d;
  --accent-blue: #4da3ff;
  --accent-purple: #b16cff;
  --accent-mint: #2ee6a6;
  --accent-amber: #ffb84d;

  /* LIGHT THEME */
  --page-bg-1: #ffffff;
  --page-bg-2: #eef2f3;
  --page-solid: #ffffff; /* مهم: خلفية سادة */

  --text: #2d3436;
  --text-muted: rgba(45, 52, 54, 0.80);

  --glass-bg: rgba(255, 255, 255, 0.16);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.58);
  --glass-border-strong: rgba(255, 255, 255, 0.75);

  --blur-strong: 26px;
  --blur-max: 46px;

  --shadow-soft: 0 16px 60px rgba(31, 38, 135, 0.16);
  --shadow-hover: 0 26px 90px rgba(31, 38, 135, 0.24);

  --blob-opacity: 0.55;

  --burst-sun: rgba(255, 184, 77, 0.55);
  --burst-moon: rgba(120, 170, 255, 0.45);
}

/* DARK THEME: عند الضغط على القمر تتحول الخلفية "أسود" */
body.dark {
  --page-bg-1: #000000;
  --page-bg-2: #000000;
  --page-solid: #000000;

  --text: rgba(245, 247, 250, 0.92);
  --text-muted: rgba(245, 247, 250, 0.75);

  --glass-bg: rgba(18, 24, 33, 0.42);
  --glass-bg-strong: rgba(18, 24, 33, 0.34);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-strong: rgba(255, 255, 255, 0.22);

  --shadow-soft: 0 18px 70px rgba(0, 0, 0, 0.55);
  --shadow-hover: 0 28px 110px rgba(0, 0, 0, 0.70);

  --blob-opacity: 0.38;

  --burst-sun: rgba(255, 184, 77, 0.42);
  --burst-moon: rgba(120, 170, 255, 0.40);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

/* Cursor rules */
* { cursor: auto; }
@media (hover: hover) and (pointer: fine) {
  * { cursor: none; }
}

html, body { height: 100%; }

body {
  /* خلفية سادة تتحول أسود في الدارك */
  background: var(--page-solid);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  transition: background 520ms ease, color 350ms ease;
}

/* Background elements */
.bg-elements {
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  overflow: hidden;
}

/* wave */
.bg-elements .wave {
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 10% 20%, rgba(255,77,77,0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(77,163,255,0.20) 0%, transparent 46%),
    radial-gradient(circle at 65% 92%, rgba(177,108,255,0.18) 0%, transparent 52%),
    radial-gradient(circle at 18% 88%, rgba(46,230,166,0.16) 0%, transparent 55%),
    radial-gradient(circle at 50% 55%, rgba(255,184,77,0.12) 0%, transparent 60%);
  filter: blur(18px) saturate(1.3);
  opacity: 0.70;
  animation: spinWave 38s linear infinite;
}
@keyframes spinWave { to { transform: rotate(360deg); } }

/* blobs */
.bg-elements .blob {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(22px) saturate(1.25);
  opacity: var(--blob-opacity);
  animation: floatBlob 18s ease-in-out infinite;
}
.bg-elements .blob.red {
  background: radial-gradient(circle at 30% 30%, rgba(255,77,77,0.75), rgba(255,77,77,0.05) 60%, transparent 72%);
  top: -140px; left: -120px; animation-duration: 20s;
}
.bg-elements .blob.blue {
  background: radial-gradient(circle at 30% 30%, rgba(77,163,255,0.70), rgba(77,163,255,0.05) 60%, transparent 72%);
  top: 90px; right: -160px; animation-duration: 24s;
}
.bg-elements .blob.purple {
  background: radial-gradient(circle at 30% 30%, rgba(177,108,255,0.65), rgba(177,108,255,0.05) 60%, transparent 72%);
  bottom: -220px; left: 18%; animation-duration: 22s;
}
.bg-elements .blob.mint {
  background: radial-gradient(circle at 30% 30%, rgba(46,230,166,0.55), rgba(46,230,166,0.04) 60%, transparent 72%);
  bottom: -160px; right: 10%; animation-duration: 26s;
}
@keyframes floatBlob {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, -30px) scale(1.05); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Global frosted overlay (يبقى، لكنه يتكيف بصرياً) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  backdrop-filter: blur(var(--blur-max)) saturate(1.35) contrast(1.06);
  -webkit-backdrop-filter: blur(var(--blur-max)) saturate(1.35) contrast(1.06);
}
body.dark::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.40), rgba(0,0,0,0.10));
  backdrop-filter: blur(var(--blur-max)) saturate(1.15) contrast(1.05);
  -webkit-backdrop-filter: blur(var(--blur-max)) saturate(1.15) contrast(1.05);
}

/* Noise */
.noise-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.20;
}
body.dark .noise-layer {
  opacity: 0.12;
  background-image: radial-gradient(circle, rgba(255,255,255,0.020) 1px, transparent 1px);
}

/* Theme burst orb (sun/moon) */
#theme-burst {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.9);
  filter: blur(24px);
  transition: opacity 280ms ease;
}
#theme-burst::before {
  content: '';
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}
#theme-burst.show { opacity: 1; }
#theme-burst.show::before {
  opacity: 1;
  animation: burstPop 720ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#theme-burst.sun::before {
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,0.40), transparent 62%),
    radial-gradient(circle at 50% 50%, var(--burst-sun), transparent 70%);
  box-shadow: 0 0 160px rgba(255,184,77,0.10);
}

#theme-burst.moon::before {
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,0.22), transparent 62%),
    radial-gradient(circle at 50% 50%, var(--burst-moon), transparent 70%);
  box-shadow: 0 0 160px rgba(120,170,255,0.10);
}

@keyframes burstPop {
  0%   { transform: translate(-50%, -50%) scale(0.78); opacity: 0; }
  40%  { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.00); opacity: 0.0; }
}

/* Custom Cursor */
.cursor-dot, .cursor-outline {
  position: fixed;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}
.cursor-dot { width: 8px; height: 8px; background-color: var(--accent-red); }
.cursor-outline {
  width: 40px; height: 40px;
  border: 1px solid rgba(45, 52, 54, 0.18);
  transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
}
body.dark .cursor-outline { border-color: rgba(245,247,250,0.22); }
body.hovering .cursor-outline {
  width: 62px; height: 62px;
  background-color: rgba(255, 77, 77, 0.10);
  border-color: transparent;
}

/* GLASS all boxes */
.navbar, .mobile-nav, .hero-section .container, .stats-section, section.section-padding,
.stat-card, .service-box, .pricing-card, .img-placeholder, footer, .social-icons a {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur-strong)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(1.35);
  box-shadow: var(--shadow-soft);
  transition: background 420ms ease, border-color 420ms ease, box-shadow 420ms ease, color 300ms ease;
}

.hero-section .container {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(var(--blur-max)) saturate(1.45);
  -webkit-backdrop-filter: blur(var(--blur-max)) saturate(1.45);
}

.stats-section, section.section-padding, .stat-card, .service-box, .pricing-card, .img-placeholder, footer {
  border-radius: 26px;
}

section.section-padding { margin: 22px auto; width: 92%; max-width: 1400px; }

.text-accent { color: var(--accent-red); }
.bg-darker { background: transparent; }

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 15px 5%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.10);
  border-bottom: 1px solid var(--glass-border-strong);
}

.nav-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.nav-logo { font-size: 1.8rem; font-weight: 900; letter-spacing: 2px; }

.nav-links { display: flex; list-style: none; gap: 30px; }

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  position: relative;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--accent-red);
  transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }

/* Theme toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
  transition: transform 220ms ease, background 420ms ease, border-color 420ms ease;
  cursor: pointer;
  flex: 0 0 auto;
}
body.dark .theme-toggle {
  background: rgba(18, 24, 33, 0.28);
  border-color: rgba(255,255,255,0.18);
}
.theme-toggle:hover { transform: translateY(-2px); }
.theme-toggle:active { transform: translateY(0px) scale(0.98); }
.toggle-icon {
  font-size: 1.1rem;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease;
}
.theme-toggle.switching .toggle-icon { transform: rotate(140deg) scale(0.85); opacity: 0.7; }

.burger-menu { display: none; font-size: 1.5rem; cursor: pointer; }

/* Hero */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 110px;
  position: relative;
  width: 100%;
}

.hero-section .container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 46px 22px;
}

.logo-placeholder {
  width: 150px;
  height: 150px;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.60);
  box-shadow: 0 0 35px rgba(255, 77, 77, 0.20), 0 0 60px rgba(77, 163, 255, 0.12);
  animation: floatLogo 6s ease-in-out infinite;
}
@keyframes floatLogo { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-20px)} }

.hero-title {
  font-size: clamp(2.2rem, 4vw + 1rem, 4rem);
  margin-bottom: 1rem;
  background: linear-gradient(90deg, rgba(45,52,54,1) 0%, rgba(99,110,114,1) 55%, rgba(45,52,54,1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.dark .hero-title {
  background: linear-gradient(90deg, rgba(245,247,250,0.95) 0%, rgba(245,247,250,0.70) 55%, rgba(245,247,250,0.95) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-title .highlight {
  color: var(--accent-red);
  -webkit-text-fill-color: var(--accent-red);
  text-shadow: 0 12px 45px rgba(255, 77, 77, 0.20);
}

.hero-desc {
  max-width: 650px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 1vw + 0.8rem, 1.1rem);
  padding: 0 10px;
}

.hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

.btn {
  padding: 12px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: rgba(45, 52, 54, 0.92);
  color: white;
  box-shadow: 0 16px 40px rgba(0,0,0,0.14);
  border: 1px solid rgba(255,255,255,0.12);
}
body.dark .btn-primary {
  background: rgba(245,247,250,0.92);
  color: rgba(15, 22, 32, 0.95);
  border: 1px solid rgba(255,255,255,0.10);
}

.btn-outline {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(45,52,54,0.28);
  color: var(--text);
  backdrop-filter: blur(var(--blur-strong)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(1.35);
}
body.dark .btn-outline {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(18, 24, 33, 0.22);
}

.btn:hover { transform: translateY(-3px); box-shadow: 0 22px 55px rgba(0,0,0,0.16); }

/* Stats */
.stats-section { padding: 40px 0; margin: -35px auto 0 auto; position: relative; z-index: 2; width: 92%; max-width: 1400px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.stat-card { padding: 30px; text-align: center; }
.stat-card h3 { font-size: 2.5rem; color: var(--accent-red); margin-bottom: 5px; }

.section-padding { padding: clamp(60px, 8vw, 100px) 0; }

.container { width: 90%; max-width: 1200px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: clamp(1.8rem, 2.2vw + 1rem, 2.5rem); margin-bottom: 10px; }
.section-header p { color: var(--text-muted); }

/* Services */
.services-grid-large { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.service-box { padding: 40px; position: relative; overflow: hidden; }
.service-box::before {
  content: '';
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(circle at 10% 15%, rgba(255,77,77,0.16) 0%, transparent 55%),
    radial-gradient(circle at 90% 20%, rgba(77,163,255,0.14) 0%, transparent 55%),
    radial-gradient(circle at 60% 90%, rgba(177,108,255,0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.service-box:hover::before { opacity: 1; }
.service-box .icon { font-size: 2.5rem; color: var(--accent-red); margin-bottom: 20px; display: inline-block; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; align-items: center; }
.pricing-card { padding: 40px; text-align: center; position: relative; }
.pricing-card.featured { transform: scale(1.05); border: 2px solid rgba(255,77,77,0.80); background: var(--glass-bg-strong); }
.tag {
  position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--accent-red), var(--accent-purple));
  color: white; padding: 6px 22px; border-radius: 20px; font-size: 0.9rem; font-weight: bold;
  box-shadow: 0 14px 40px rgba(255,77,77,0.22);
}
.price { font-size: 2rem; font-weight: 900; margin: 20px 0; color: var(--text); }
.features-list { list-style: none; text-align: right; margin: 30px 0; }
.features-list li { margin-bottom: 15px; color: var(--text-muted); }
.features-list i { color: var(--accent-red); margin-left: 10px; }
.full-width { display: block; width: 100%; }

/* Why */
.why-us-container { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.benefits-list { list-style: none; margin-top: 30px; }
.benefits-list li { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 30px; }
.benefits-list i {
  font-size: 2rem; color: var(--accent-red);
  background: rgba(255, 77, 77, 0.14);
  padding: 15px; border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.img-placeholder {
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: bold;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(77,163,255,0.16) 0%, transparent 60%),
    radial-gradient(circle at 80% 30%, rgba(255,77,77,0.14) 0%, transparent 60%),
    radial-gradient(circle at 55% 85%, rgba(177,108,255,0.12) 0%, transparent 60%),
    var(--glass-bg-strong);
}

/* Footer */
footer { padding-top: 80px; border-top: 1px solid rgba(255,255,255,0.45); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 50px; }
.social-icons { margin-top: 20px; display: flex; gap: 15px; }
.social-icons a { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; }
.copyright { text-align: center; padding: 20px; border-top: 1px solid rgba(255,255,255,0.40); color: var(--text-muted); }

/* Mobile Nav */
.mobile-nav { position: fixed; top: 0; right: -100%; width: 80%; height: 100vh; z-index: 2000; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 30px; transition: 0.5s ease; box-shadow: -12px 0 60px rgba(31,38,135,0.18); }
.mobile-nav.active { right: 0; }
.mobile-nav a { text-decoration: none; color: var(--text); font-size: 1.5rem; font-weight: bold; }
.close-menu { position: absolute; top: 30px; right: 30px; font-size: 2rem; cursor: pointer; }

.burger-menu { display: none; font-size: 1.5rem; cursor: pointer; }

/* Reveal sections */
section { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }

/* Responsive */
@media (max-width: 1024px) {
  .why-us-container { gap: 30px; }
  section.section-padding { width: 94%; }
  .stats-section { width: 94%; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .burger-menu { display: block; }
  .why-us-container { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cursor-dot, .cursor-outline { display: none; }
  .pricing-card.featured { transform: none; }
  .hero-section { padding-top: 100px; }
  .hero-section .container { padding: 34px 14px; }
  .bg-elements .blob { width: 380px; height: 380px; }
}
@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; gap: 12px; }
  .btn { width: 100%; text-align: center; }
  .services-grid-large { grid-template-columns: 1fr; gap: 16px; }
  .pricing-grid { grid-template-columns: 1fr; gap: 16px; }
  .grid-4 { grid-template-columns: 1fr; gap: 14px; }
  .logo-placeholder { width: 120px; height: 120px; }
  section.section-padding { width: 95%; }
  .stats-section { width: 95%; }
}

/* Touch adjustments */
@media (hover: none), (pointer: coarse) {
  body.hovering .cursor-outline { display: none; }
}
