:root {
  /* خلفية خفيفة وناعمة */
  --boot-bg1: #33c35a; /* كحلي فاتح */
  --boot-bg2: #1b4644; /* كحلي أفتح */

  /* ألوان */
  --boot-text: #ffffff;
  --boot-muted: rgba(255, 255, 255, 0.75);
  --boot-muted2: rgba(255, 255, 255, 0.58);

  --boot-accent: #60a5fa; /* أزرق ناعم */
  --boot-accent2: #a78bfa; /* بنفسجي ناعم */
  --boot-danger: #fb7185;
}

/* الخلفية */
#boot-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--boot-text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  overflow: hidden;

  background: radial-gradient(
      900px 520px at 18% 18%,
      rgba(96, 165, 250, 0.16),
      transparent 60%
    ),
    radial-gradient(
      820px 520px at 82% 62%,
      rgba(167, 139, 250, 0.14),
      transparent 60%
    ),
    linear-gradient(135deg, var(--boot-bg1), var(--boot-bg2));
}

/* نقاط/Noise خفيف جداً (يعطي فخامة بدون إزعاج) */
#boot-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 1px
  );
  background-size: 22px 22px;
  opacity: 0.1;
  pointer-events: none;
}

/* Glow يتحرك بهدوء */
#boot-splash::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: radial-gradient(
      circle at 30% 30%,
      rgba(96, 165, 250, 0.18),
      transparent 48%
    ),
    radial-gradient(
      circle at 70% 70%,
      rgba(167, 139, 250, 0.16),
      transparent 48%
    );
  filter: blur(18px);
  animation: bootGlow 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes bootGlow {
  0%,
  100% {
    transform: translate3d(-2%, -2%, 0) scale(1.02);
    opacity: 0.85;
  }
  50% {
    transform: translate3d(2%, 2%, 0) scale(1.05);
    opacity: 1;
  }
}

/* ===== Glass Card ===== */
.boot-card {
  position: relative;
  width: min(420px, 92vw);
  padding: 26px 22px;
  border-radius: 22px;
  text-align: center;

  /* زجاجي */
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.008);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);

  transform: translateY(10px);
  opacity: 0;
  overflow: hidden;
  animation: bootIn 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

/* لمعان خفيف فوق الزجاج */
.boot-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    120deg,
    transparent 40%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 60%
  );
  transform: translateX(-30%) translateY(-10%) rotate(10deg);
  opacity: 0.55;
  pointer-events: none;
}

/* لمعة صغيرة أعلى البوكس */
.boot-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: radial-gradient(
    600px 220px at 30% 0%,
    rgba(255, 255, 255, 0.12),
    transparent 60%
  );
  pointer-events: none;
}

@keyframes bootIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* أيقونة بالوسط */
.boot-logo {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  display: block;
  margin: 0 auto;

  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  animation: bootFloat 2.4s ease-in-out infinite;
}

@keyframes bootFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

/* عنوان فخم */
.boot-title {
  margin-top: 14px;
  font-weight: 950;
  letter-spacing: 1.4px;
  font-size: 18px;

  background: linear-gradient(
    90deg,
    #ffffff,
    var(--boot-accent),
    var(--boot-accent2)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.boot-sub {
  margin-top: 6px;
  color: var(--boot-muted);
  font-size: 13px;
}

/* ===== Progress: يبدي من اليسار وينتهي باليمين ===== */
.boot-progress {
  margin: 16px auto 0;
  width: 85%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  position: relative;
}

.boot-progress > div {
  height: 100%;
  width: 100%;
  border-radius: 999px;

  /* ✅ من اليسار إلى اليمين */
  transform: scaleX(0);
  transform-origin: left center;

  background: linear-gradient(
    90deg,
    rgba(96, 165, 250, 0.25),
    rgba(96, 165, 250, 1),
    rgba(167, 139, 250, 1)
  );

  animation: bootFillLTR 1.35s ease-in-out infinite;
  position: relative;
}

/* Shine متحرك فوق الشريط */
.boot-progress > div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  transform: translateX(-140%);
  animation: bootShine 1.35s ease-in-out infinite;
  opacity: 0.55;
  mix-blend-mode: overlay;
}

@keyframes bootFillLTR {
  0% {
    transform: scaleX(0);
    opacity: 0.55;
  }
  70% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

@keyframes bootShine {
  0% {
    transform: translateX(-140%);
    opacity: 0;
  }
  20% {
    opacity: 0.55;
  }
  70% {
    opacity: 0.65;
  }
  100% {
    transform: translateX(140%);
    opacity: 0;
  }
}

/* Status */
.boot-status {
  margin-top: 14px;
  font-size: 13px;
  min-height: 20px;
  color: var(--boot-muted2);
}

/* Offline */
.boot-status.offline {
  color: #fff;
  display: inline-block;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.12);
}

.boot-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.boot-btn {
  display: none;
  padding: 10px 14px;
  border-radius: 12px;

  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);

  color: #fff;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.boot-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.boot-btn:active {
  transform: scale(0.99);
}

/* خروج سموذي */
.boot-exit {
  opacity: 0;
  transform: translateY(-10px) scale(1.02);
  filter: blur(8px);
  transition: opacity 0.42s ease, transform 0.42s ease, filter 0.42s ease;
}

.boot-overlay-exit {
  opacity: 0;
  transition: opacity 0.42s ease;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  #boot-splash::after,
  .boot-logo,
  .boot-progress > div,
  .boot-progress > div::after {
    animation: none !important;
  }
  .boot-exit,
  .boot-overlay-exit {
    transition: none !important;
  }
}
