/* =========================================================
   ASHISH V152 — الشريط السفلي الموحّد النهائي
   يستبدل: v14 / v25 / v108 (bottombar) / v147 / v151-hub / v151-final-mobile-fix
   ديناميكي بالكامل عبر متغيرات CSS يضبطها ashish-v48-dynamic.js
   ========================================================= */

:root{
  --v152-bg1:#0a2350;
  --v152-bg2:#02122c;
  --v152-gold:#e5b352;
  --v152-gold-2:#f4d47a;
  --v152-label:#cfd8ea;
  --v152-active:#f4d47a;
  --v152-radius:22px;
  --v152-opacity:.97;
  --v152-icon:22px;
  --v152-lsize:11px;
  --v152-border:.35;
  --v152-height:64px;
  --v152-shadow:0 12px 34px rgba(0,0,0,.34);
}

/* منع تجاوز الأفقي */
html,body{max-width:100%;overflow-x:hidden}

/* حجز مساحة أسفل الصفحة تكفي الشريط + safe-area */
html body:has(#v152BottomBar),
html body.ash-redesign-active,
html body.client-experience-active{
  padding-bottom:calc(var(--v152-height) + 24px + env(safe-area-inset-bottom,0px))!important;
}

/* =========================================================
   الشريط الأساسي (يطبَّق على #v48BottomBar و #v152BottomBar)
   ========================================================= */
#v48BottomBar,
#v152BottomBar,
.v48-bottombar{
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  bottom:max(10px,env(safe-area-inset-bottom,10px))!important;
  transform:translateX(-50%)!important;
  width:min(calc(100vw - 20px),540px)!important;
  max-width:calc(100vw - 16px)!important;
  min-height:var(--v152-height)!important;
  height:auto!important;
  padding:8px 10px!important;
  margin:0!important;
  box-sizing:border-box!important;
  border-radius:var(--v152-radius)!important;
  border:1px solid rgba(212,175,55,calc(var(--v152-border)))!important;
  background:linear-gradient(135deg,var(--v152-bg1),var(--v152-bg2))!important;
  background-color:rgba(4,18,45,var(--v152-opacity))!important;
  box-shadow:var(--v152-shadow)!important;
  backdrop-filter:blur(18px) saturate(140%)!important;
  -webkit-backdrop-filter:blur(18px) saturate(140%)!important;
  z-index:99999!important;
  overflow:hidden!important;
  display:flex!important;
  align-items:stretch!important;
  animation:v152-rise .55s cubic-bezier(.2,.9,.25,1.05) both;
}

@keyframes v152-rise{
  0%{transform:translate(-50%,120%);opacity:0}
  100%{transform:translate(-50%,0);opacity:1}
}

/* توهج ذهبي ناعم على الحواف */
#v48BottomBar::before,
#v152BottomBar::before{
  content:"";
  position:absolute;inset:0;
  border-radius:inherit;
  padding:1px;
  background:linear-gradient(135deg,rgba(212,175,55,.55),rgba(212,175,55,0) 35%,rgba(212,175,55,0) 65%,rgba(212,175,55,.55));
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude;
  pointer-events:none;opacity:.85;
}

/* الحاوية الداخلية للعناصر */
#v48BottomBar,
#v152BottomBar,
#v48BottomBar .v48-items,
#v48BottomBar .v48-bottombar-inner,
#v152BottomBar .v152-items{
  display:grid!important;
  grid-auto-flow:column!important;
  grid-auto-columns:minmax(0,1fr)!important;
  width:100%!important;
  gap:4px!important;
  align-items:stretch!important;
}
#v48BottomBar .v48-items,
#v48BottomBar .v48-bottombar-inner,
#v152BottomBar .v152-items{
  position:relative;z-index:1;
}

/* =========================================================
   العناصر (الأزرار)
   ========================================================= */
#v48BottomBar .v48-bb-item,
#v152BottomBar .v152-bb-item,
.v48-bottombar .v48-bb-item{
  position:relative;
  min-width:0!important;
  min-height:48px!important;
  padding:6px 4px!important;
  margin:0!important;
  border:0!important;
  border-radius:14px!important;
  background:transparent!important;
  color:var(--v152-label)!important;
  font-family:'Tajawal','Cairo','Noto Sans Arabic',sans-serif!important;
  font-weight:700!important;
  text-decoration:none!important;
  cursor:pointer!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  overflow:hidden!important;
  transition:transform .22s cubic-bezier(.2,.9,.25,1.05),background .25s,color .25s,box-shadow .25s!important;
  box-shadow:none!important;
  -webkit-tap-highlight-color:transparent;
}

#v48BottomBar .v48-bb-item::after,
#v152BottomBar .v152-bb-item::after{
  content:"";
  position:absolute;left:50%;bottom:4px;
  width:0;height:2px;border-radius:2px;
  background:var(--v152-gold);
  transform:translateX(-50%);
  transition:width .3s ease;
  opacity:.9;
}

#v48BottomBar .v48-bb-item:hover,
#v152BottomBar .v152-bb-item:hover{
  background:rgba(255,255,255,.05)!important;
  color:#fff!important;
}
#v48BottomBar .v48-bb-item:hover::after,
#v152BottomBar .v152-bb-item:hover::after{width:22px}

#v48BottomBar .v48-bb-item:active,
#v152BottomBar .v152-bb-item:active{
  transform:scale(.92)!important;
}

#v48BottomBar .v48-bb-item.active,
#v152BottomBar .v152-bb-item.active{
  color:var(--v152-active)!important;
}
#v48BottomBar .v48-bb-item.active::after,
#v152BottomBar .v152-bb-item.active::after{width:26px}

/* الأيقونة */
#v48BottomBar .v48-bb-ic,
#v152BottomBar .v152-bb-ic,
#v152BottomBar .v152-bb-item .ic{
  font-size:var(--v152-icon)!important;
  line-height:1!important;
  display:inline-flex;align-items:center;justify-content:center;
  transition:transform .25s ease;
}
#v48BottomBar .v48-bb-item:hover .v48-bb-ic,
#v152BottomBar .v152-bb-item:hover .v152-bb-ic{transform:translateY(-2px) scale(1.05)}

/* التسمية */
#v48BottomBar .v48-bb-lb,
#v152BottomBar .v152-bb-lb{
  display:block!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:var(--v152-lsize)!important;
  line-height:1.1!important;
  font-weight:800!important;
  letter-spacing:-.1px!important;
  margin-top:1px!important;
}

/* =========================================================
   الزر المركزي (رئيسي) — دائري بارز
   ========================================================= */
#v48BottomBar .v48-bb-item.center,
#v152BottomBar .v152-bb-item.center,
#v152BottomBar .v152-bb-item.primary{
  background:linear-gradient(135deg,var(--v152-gold),var(--v152-gold-2))!important;
  color:#0a1a3f!important;
  border-radius:16px!important;
  box-shadow:
    0 8px 22px rgba(212,175,55,.42),
    inset 0 1px 0 rgba(255,255,255,.55)!important;
  transform:translateY(-6px);
  min-height:56px!important;
}

#v48BottomBar .v48-bb-item.center .v48-bb-ic,
#v152BottomBar .v152-bb-item.center .v152-bb-ic{
  font-size:calc(var(--v152-icon) + 4px)!important;
  color:#0a1a3f!important;
}

#v48BottomBar .v48-bb-item.center .v48-bb-lb,
#v152BottomBar .v152-bb-item.center .v152-bb-lb{
  color:#0a1a3f!important;
  font-weight:900!important;
}

#v48BottomBar .v48-bb-item.center::after,
#v152BottomBar .v152-bb-item.center::after{display:none}

#v48BottomBar .v48-bb-item.center:hover,
#v152BottomBar .v152-bb-item.center:hover{
  filter:brightness(1.05);
  box-shadow:0 12px 28px rgba(212,175,55,.55),inset 0 1px 0 rgba(255,255,255,.6)!important;
}

/* شارة (badge) */
#v48BottomBar .v48-bb-item .v48-bb-badge,
#v152BottomBar .v152-bb-item .v152-bb-badge{
  position:absolute;top:4px;inset-inline-end:6px;
  min-width:16px;height:16px;padding:0 4px;
  border-radius:16px;background:#e53935;color:#fff;
  font-size:9px;font-weight:900;
  display:inline-flex;align-items:center;justify-content:center;
  box-shadow:0 2px 6px rgba(0,0,0,.4);
}

/* =========================================================
   إخفاء الأشرطة الاحتياطية المكرَّرة إن ظهر v48
   ========================================================= */
html body:has(#v48BottomBar) #v151BottomBar,
html body:has(#v48BottomBar) #v152BottomBar,
html body:has(#v48BottomBar) #gsBottomBar{display:none!important}

/* إخفاء عناصر "حسابي" الطافية داخل الشريط */
#v48BottomBar .v48-bb-item[data-account-primary],
#v48BottomBar .v48-bb-item[data-v48-account],
#v48BottomBar .v48-bb-item[data-label="حسابي"]{display:none!important}

/* دعم الأدمن — إخفاء أي زر أدمن قديم لو ظهر */
body[data-role="admin"] #v48BottomBar,
body.admin-page #v48BottomBar{display:none!important}

/* =========================================================
   الاستجابة للشاشات الصغيرة
   ========================================================= */
@media(max-width:520px){
  :root{--v152-icon:20px;--v152-lsize:10px;--v152-height:62px}
  #v48BottomBar,#v152BottomBar{
    width:calc(100vw - 14px)!important;
    max-width:calc(100vw - 14px)!important;
    bottom:max(6px,env(safe-area-inset-bottom,0px))!important;
    padding:6px 8px!important;
    gap:3px!important;
  }
}
@media(max-width:380px){
  :root{--v152-icon:18px;--v152-lsize:9px}
  #v48BottomBar,#v152BottomBar{
    width:calc(100vw - 8px)!important;
    max-width:calc(100vw - 8px)!important;
  }
  #v48BottomBar .v48-bb-item,#v152BottomBar .v152-bb-item{padding:4px 2px!important}
}
@media(max-width:320px){
  #v48BottomBar .v48-bb-lb,
  #v152BottomBar .v152-bb-lb{display:none!important}
  #v48BottomBar .v48-bb-item,#v152BottomBar .v152-bb-item{min-height:44px!important}
}

/* الوضع الأفقي القصير */
@media(max-height:520px) and (orientation:landscape){
  :root{--v152-height:52px}
  #v48BottomBar,#v152BottomBar{min-height:52px!important}
  #v48BottomBar .v48-bb-lb,#v152BottomBar .v152-bb-lb{display:none!important}
}

/* دعم اختيار ألوان مخصّصة من الأدمن — أولوية عالية */
html[data-client-experience="ready"] body.client-experience-active #v48BottomBar,
html[data-client-experience="ready"] body.client-experience-active #v152BottomBar{
  background:var(--client-nav,linear-gradient(135deg,var(--v152-bg1),var(--v152-bg2)))!important;
  border-color:color-mix(in srgb,var(--client-button,var(--v152-gold)) 40%,transparent)!important;
}
html[data-client-experience="ready"] body.client-experience-active .v48-bb-item,
html[data-client-experience="ready"] body.client-experience-active .v152-bb-item{
  color:var(--client-muted,var(--v152-label))!important;
}
html[data-client-experience="ready"] body.client-experience-active .v48-bb-item.active,
html[data-client-experience="ready"] body.client-experience-active .v152-bb-item.active{
  color:var(--client-button,var(--v152-active))!important;
}
html[data-client-experience="ready"] body.client-experience-active .v48-bb-item.center,
html[data-client-experience="ready"] body.client-experience-active .v152-bb-item.center{
  background:linear-gradient(135deg,var(--client-button,var(--v152-gold)),color-mix(in srgb,var(--client-button,var(--v152-gold)) 55%,#fff))!important;
  color:#0a1a3f!important;
}
