/* ================================================================
   ASHISH V52 — إخفاء الواجهة القديمة قبل تفعيل التصميم الجديد
   المشكلة: كانت شبكة #clientTabNav القديمة تظهر لثوانٍ قبل أن
   يفعّل ashish-client-redesign.js التصميم الحديث (وميض مزعج).
   الحل: إخفاء العناصر القديمة افتراضياً، وإظهارها فقط في وضع
   client-admin-mode، مع شاشة تحميل أنيقة.
   ================================================================ */

html body #clientTabNav {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

html body.client-admin-mode #clientTabNav {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  pointer-events: auto !important;
}

body #clientTabNav[data-legacy],
body:not(.client-admin-mode) .client-tab-grid {
  display: none !important;
}

html, body {
  background: #02122C !important;
}

body:not(.client-admin-mode):not(.ash-redesign-active) #mainContent > *:not(#ashApp):not(script):not(style) {
  visibility: hidden !important;
}

body.ash-redesign-active #mainContent > * {
  visibility: visible !important;
}

/* شاشة تحميل سريعة قبل تفعيل التصميم */
#ashBootScreen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: radial-gradient(circle at top, rgba(229,179,82,0.16), transparent 45%),
              linear-gradient(180deg, #02122C 0%, #051D44 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease, visibility .4s ease;
  direction: rtl;
}

body.ash-redesign-active #ashBootScreen,
body.client-admin-mode #ashBootScreen,
body.ash-splash-done #ashBootScreen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#ashBootScreen .ash-boot-card {
  text-align: center;
  padding: 30px 34px;
  background: rgba(15,42,85,0.85);
  border: 1px solid rgba(229,179,82,0.35);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  font-family: 'Noto Sans Arabic', 'Cairo', 'Tajawal', sans-serif;
  max-width: 320px;
  direction: rtl;
}

#ashBootScreen .ash-boot-logo {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 3px solid #E5B352;
  box-shadow: 0 8px 24px rgba(229,179,82,0.35);
  margin-bottom: 14px;
  object-fit: cover;
}

#ashBootScreen h3 {
  color: #E5B352;
  font-size: 1.18rem;
  font-weight: 900;
  margin: 6px 0;
}

#ashBootScreen p {
  color: #A9B8D6;
  font-size: 0.88rem;
  margin: 4px 0;
}

#ashBootScreen .ash-boot-spinner {
  width: 34px;
  height: 34px;
  margin: 16px auto 0;
  border: 3px solid rgba(229,179,82,0.25);
  border-top-color: #E5B352;
  border-radius: 50%;
  animation: ashBootSpin .9s linear infinite;
}

@keyframes ashBootSpin { to { transform: rotate(360deg); } }
