/* ============================================================
   الزراير الدايرية — إشعارات + تثبيت + جديد الموقع
   شغالين على خلفية بيضا وداكنة
   ============================================================ */

.fsb-circle-group {
  position: fixed;
  left: 2px;
  top: 45%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fsb-circle-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.fsb-circle-btn.btn-notif {
  background: linear-gradient(135deg, #92400e, #d97706);
  box-shadow: 0 3px 14px rgba(217,119,6,0.45), 0 1px 4px rgba(0,0,0,0.3);
}

.fsb-circle-btn.btn-install {
  background: linear-gradient(135deg, #3730a3, #7c3aed);
  box-shadow: 0 3px 14px rgba(124,58,237,0.45), 0 1px 4px rgba(0,0,0,0.3);
}

.fsb-circle-btn.btn-whatsnew {
  background: linear-gradient(135deg, #0f4c75, #1b6ca8);
  box-shadow: 0 3px 14px rgba(27,108,168,0.5), 0 1px 4px rgba(0,0,0,0.3);
}

.fsb-circle-btn:hover {
  transform: scale(1.18) rotate(-6deg);
}

.fsb-circle-btn.btn-notif:hover {
  box-shadow: 0 6px 22px rgba(217,119,6,0.6), 0 2px 8px rgba(0,0,0,0.35);
}

.fsb-circle-btn.btn-install:hover {
  box-shadow: 0 6px 22px rgba(124,58,237,0.6), 0 2px 8px rgba(0,0,0,0.35);
}

.fsb-circle-btn.btn-whatsnew:hover {
  box-shadow: 0 6px 22px rgba(27,108,168,0.65), 0 2px 8px rgba(0,0,0,0.35);
}

.fsb-circle-btn svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
}

/* ── نقطة الإشعارات ── */
.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: dot-pulse 2s ease-in-out infinite;
  z-index: 3;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.35); opacity: 0.65; }
}

/* ── Badge جديد ── */
.whatsnew-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-family: 'Cairo', 'Segoe UI', sans-serif;
  font-size: 0.52rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 6px;
  border: 1.5px solid #fff;
  letter-spacing: 0.3px;
  animation: badge-pop 2.5s ease-in-out infinite;
  z-index: 4;
  pointer-events: none;
}

@keyframes badge-pop {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

/* ── Hover animations ── */
.fsb-circle-btn.btn-notif:hover svg {
  animation: bell-shake 0.4s ease infinite alternate;
}
@keyframes bell-shake {
  0%   { transform: rotate(-14deg); }
  100% { transform: rotate(14deg);  }
}

.fsb-circle-btn.btn-whatsnew:hover svg {
  animation: lightning-pulse 0.4s ease infinite alternate;
}
@keyframes lightning-pulse {
  0%   { transform: scale(1) rotate(-8deg); }
  100% { transform: scale(1.15) rotate(8deg); }
}

/* ── Tooltip Label ── */
.fsb-circle-label {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: rgba(10, 10, 15, 0.94);
  border-radius: 8px;
  padding: 5px 12px;
  white-space: nowrap;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e2e2ff;
  letter-spacing: 0.3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.fsb-circle-label::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: rgba(10,10,15,0.94);
}

.fsb-circle-btn:hover .fsb-circle-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── State Done ── */
.fsb-circle-btn.state-done {
  background: linear-gradient(135deg, #065f46, #10b981) !important;
  box-shadow: 0 3px 14px rgba(16,185,129,0.45), 0 1px 4px rgba(0,0,0,0.3) !important;
}
.fsb-circle-btn.state-done:hover {
  box-shadow: 0 6px 22px rgba(16,185,129,0.6), 0 2px 8px rgba(0,0,0,0.35) !important;
}

/* ── Show / Hide ── */
.fsb-circle-btn.fsb-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.fsb-circle-btn.fsb-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* مخفيين من الأول */
#circleNotifBtn,
#circleInstallBtn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

/* جديد الموقع يظهر دايماً */
#circleWhatsnewBtn {
  opacity: 1;
  pointer-events: auto;
}

/* ── Dark Mode ── */
body.dark-mode .fsb-circle-label {
  background: rgba(20, 20, 30, 0.97);
}
body.dark-mode .fsb-circle-label::before {
  border-right-color: rgba(20,20,30,0.97);
}
body.dark-mode .notif-dot {
  border-color: #1a1a2e;
}

/* ============================================================
   Popup جديد الموقع
   ============================================================ */
.whatsnew-popup {
  position: fixed;
  left: 58px;
  top: 45%;
  transform: translateY(-50%) translateX(-12px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.34,1.56,0.64,1);
}
.whatsnew-popup.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.whatsnew-popup-inner {
  background: #0a0a12;
  border: 1px solid rgba(27,108,168,0.45);
  border-radius: 18px;
  padding: 20px 18px 16px;
  width: 240px;
  box-shadow: 0 0 40px rgba(27,108,168,0.18), 0 16px 40px rgba(0,0,0,0.65);
  position: relative;
}

.whatsnew-popup-close {
  position: absolute;
  top: 10px; left: 10px;
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: rgba(200,200,230,0.55);
  font-size: 0.82rem;
  transition: background 0.2s, color 0.2s;
}
.whatsnew-popup-close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.whatsnew-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-right: 4px;
}
.whatsnew-popup-emoji { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.whatsnew-popup-title {
  font-family: 'Cairo', 'Segoe UI', sans-serif;
  font-size: 0.92rem; font-weight: 800; color: #e2e8ff; line-height: 1.2;
}
.whatsnew-popup-sub {
  font-family: 'Cairo', 'Segoe UI', sans-serif;
  font-size: 0.7rem; color: rgba(147,197,253,0.65); margin-top: 2px;
}

.whatsnew-features {
  list-style: none;
  display: flex; flex-direction: column; gap: 9px;
  margin-bottom: 14px;
}
.whatsnew-feature-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 10px;
  background: rgba(27,108,168,0.08);
  border: 1px solid rgba(27,108,168,0.18);
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s;
}
.whatsnew-feature-item:hover {
  background: rgba(27,108,168,0.15);
  border-color: rgba(27,108,168,0.35);
}
.whatsnew-feature-icon { font-size: 1.05rem; flex-shrink: 0; margin-top: 1px; }
.whatsnew-feature-title {
  font-family: 'Cairo', 'Segoe UI', sans-serif;
  font-size: 0.78rem; font-weight: 700; color: #bfdbfe; line-height: 1.3;
}
.whatsnew-feature-desc {
  font-family: 'Cairo', 'Segoe UI', sans-serif;
  font-size: 0.68rem; color: rgba(186,230,253,0.55); margin-top: 1px; line-height: 1.4;
}

.whatsnew-cta-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 9px 14px;
  background: linear-gradient(135deg, #0f4c75, #1b6ca8);
  border: none; border-radius: 10px;
  color: #fff;
  font-family: 'Cairo', 'Segoe UI', sans-serif;
  font-size: 0.78rem; font-weight: 700;
  text-decoration: none; cursor: pointer; direction: rtl;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 3px 12px rgba(27,108,168,0.4);
}
.whatsnew-cta-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(27,108,168,0.55);
}
.whatsnew-cta-btn svg {
  flex-shrink: 0;
  transform: rotate(180deg);
}

/* ============================================================
   Modal تثبيت التطبيق
   ============================================================ */
.pwa-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99998;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.3s ease;
}
.pwa-modal-overlay.open { display: flex; opacity: 1; }

.pwa-modal {
  background: #0f0f16;
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 320px; width: 90%;
  box-shadow: 0 0 50px rgba(124,58,237,0.15), 0 20px 50px rgba(0,0,0,0.6);
  transform: translateY(18px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
.pwa-modal-overlay.open .pwa-modal { transform: translateY(0) scale(1); }

.pwa-modal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.pwa-modal-icon {
  width: 44px; height: 44px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.pwa-modal-title { font-size: 0.95rem; font-weight: 700; color: #e2e2ff; font-family: 'Cairo','Segoe UI',sans-serif; }
.pwa-modal-browser { font-size: 0.72rem; color: rgba(167,139,250,0.7); margin-top: 2px; }

.pwa-steps { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.pwa-step { display: flex; align-items: flex-start; gap: 10px; }
.pwa-step-num {
  width: 24px; height: 24px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #a78bfa;
  flex-shrink: 0; margin-top: 1px;
}
.pwa-step-text { font-size: 0.82rem; color: rgba(200,200,230,0.85); line-height: 1.5; font-family: 'Cairo','Segoe UI',sans-serif; }
.pwa-step-text strong { color: #c4b5fd; }

.pwa-modal-close {
  position: absolute; top: 12px; left: 12px;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(200,200,230,0.6); font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.pwa-modal-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ============================================================
   Toast
   ============================================================ */
#fsb-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(10,10,16,0.97);
  border: 1px solid rgba(248,113,113,0.4); color: #fca5a5;
  font-family: 'Cairo','Segoe UI',sans-serif; font-size: 0.8rem;
  padding: 7px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 99999; white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
}
#fsb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#fsb-toast.success { border-color: rgba(16,185,129,0.45); color: #6ee7b7; }

/* ============================================================
   موبايل — شريط الهيدر الثابت
   ============================================================ */
.fsb-mobile-header-bar {
  display: none;
}

@media (max-width: 768px) {

  .fsb-circle-group {
    display: none !important;
  }

  .fsb-mobile-header-bar {
    display: flex;
   /** position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;**/
  /* background: rgb(49, 55, 68);*/
   margin-top: -15px;
   /*  backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
   /* border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 6px 12px;
    align-items: center;
    /*justify-content: flex-end;*/
    justify-content: center;
    gap: 8px;
   /* box-shadow: 0 2px 16px rgba(0,0,0,0.4);
    direction: rtl;*/
  }

body.dark-mode .fsb-mobile-header-bar {
    display: flex;
   background: rgb(49, 55, 68);
   margin-top: -15px;
    justify-content: center;
    gap: 8px;

  }

  .fsb-hdr-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 10px;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    min-width: 48px;
  }
  .fsb-hdr-btn:active { background: rgba(255,255,255,0.06); }

  .fsb-hdr-btn-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .fsb-hdr-btn-icon svg {
    width: 14px; height: 14px;
    stroke: #fff; fill: none;
    stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  }
  .fsb-hdr-btn-text {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    font-size: 0.6rem; font-weight: 600;
    color: rgba(220,220,240,0.75);
    white-space: nowrap;
  }

  .fsb-hdr-btn.hdr-notif    .fsb-hdr-btn-icon { background: linear-gradient(135deg, #92400e, #d97706); }
  .fsb-hdr-btn.hdr-install  .fsb-hdr-btn-icon { background: linear-gradient(135deg, #3730a3, #7c3aed); }
  .fsb-hdr-btn.hdr-whatsnew .fsb-hdr-btn-icon { background: linear-gradient(135deg, #0f4c75, #1b6ca8); }

  .hdr-notif-dot {
    position: absolute;
    top: -1px; right: -1px;
    width: 7px; height: 7px;
    background: #ef4444;
    border-radius: 50%;
    border: 1.5px solid #08080e;
    animation: dot-pulse 2s ease-in-out infinite;
  }

  .hdr-whatsnew-badge {
    position: absolute;
    top: -3px; right: -3px;
    background: #ef4444;
    color: #fff;
    font-size: 0.44rem; font-weight: 700;
    font-family: 'Cairo', sans-serif;
    padding: 1px 4px; border-radius: 4px;
    border: 1px solid #08080e;
    pointer-events: none;
  }

  .fsb-hdr-btn.fsb-hidden { display: none !important; }

  /* Popup على الموبايل يطلع من تحت الهيدر */
  .whatsnew-popup {
    position: fixed;
    top: 58px;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(-8px);
    width: calc(100vw - 24px);
    max-width: 340px;
  }
  .whatsnew-popup.open {
    transform: translateX(-50%) translateY(0);
  }
  .whatsnew-popup-inner { width: 100%; }
}
