﻿/* ══════════════════════════════════════════════════════════════════════════════
   🏛️ AMMARI Unified Website Footer & Bottom Shell (Single Source of Truth)
   Clean, modern, luxury glass emerald design, 100% immune to local page styles.
   ══════════════════════════════════════════════════════════════════════════════ */

#siteFooter,
footer.site-footer,
footer[data-footer-source="unified"],
footer {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 60px 0 0 0 !important;
  padding: 50px 0 calc(75px + env(safe-area-inset-bottom, 0px)) !important;
  background: rgba(6, 18, 16, 0.78) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 0 !important;
  border-top: 1px solid rgba(220, 185, 115, 0.22) !important;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45) !important;
  box-sizing: border-box !important;
  clear: both !important;
  z-index: 90 !important;
  direction: rtl;
  text-align: right;
  color: var(--text, #F2F5F4) !important;
  font-family: "Cairo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

[dir="ltr"] #siteFooter,
[dir="ltr"] footer.site-footer,
html[lang="en"] #siteFooter,
html[lang="en"] footer.site-footer {
  direction: ltr !important;
  text-align: left !important;
}

/* الحاوية الداخلية للفوتر - متطابقة 1:1 مع شيل الهيدر (.aheader-shell) بعرض 1680px */
#siteFooter .container,
#siteFooter .footer-container,
footer.site-footer .container,
footer.site-footer .footer-container,
footer[data-footer-source="unified"] .container {
  width: min(1680px, 100%) !important;
  max-width: min(1680px, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-left: 28px !important;
  padding-right: 28px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

/* شبكة الأعمدة للفوتر */
#siteFooter .footer-grid,
footer.site-footer .footer-grid {
  display: grid !important;
  grid-template-columns: 2.2fr repeat(7, minmax(110px, 1fr)) !important;
  gap: 32px 18px !important;
  align-items: start !important;
  margin-bottom: 40px !important;
  box-sizing: border-box !important;
}

/* أعمدة الفوتر الفردية */
#siteFooter .footer-col,
footer.site-footer .footer-col {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

#siteFooter .footer-brand-col,
footer.site-footer .footer-brand-col {
  grid-column: span 1 !important;
  max-width: 480px !important;
  margin-bottom: 0 !important;
}

/* شعار البراند الكامل في الفوتر */
#siteFooter .footer-brand-col .brand-link,
footer.site-footer .footer-brand-col .brand-link {
  display: inline-flex !important;
  align-items: center !important;
  margin-bottom: 16px !important;
  text-decoration: none !important;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#siteFooter .footer-brand-col .brand-link:hover,
footer.site-footer .footer-brand-col .brand-link:hover {
  transform: scale(1.05) !important;
  filter: drop-shadow(0 0 18px rgba(228, 170, 50, 0.6)) !important;
}

#siteFooter .footer-brand-logo-img,
footer.site-footer .footer-brand-logo-img {
  width: auto !important;
  height: 88px !important;
  max-height: 92px !important;
  object-fit: contain !important;
  display: block !important;
  aspect-ratio: 1/1 !important;
}

@media (max-width: 768px) {
  #siteFooter .footer-brand-logo-img,
  footer.site-footer .footer-brand-logo-img {
    height: 68px !important;
  }
}


#siteFooter .footer-brand-col p,
footer.site-footer .footer-brand-col p {
  color: var(--text-muted, #8E9F9F) !important;
  font-size: 13.5px !important;
  line-height: 1.7 !important;
  margin-top: 0 !important;
  margin-bottom: 16px !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

/* عناوين أقسام الفوتر بدون خط نهائياً */
#siteFooter .footer-col h4,
footer.site-footer .footer-col h4,
footer[data-footer-source="unified"] .footer-col h4 {
  color: #FFFFFF !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  margin-top: 0 !important;
  margin-bottom: 14px !important;
  padding-bottom: 0 !important;
  position: static !important;
  border-bottom: none !important;
  text-decoration: none !important;
}

#siteFooter .footer-col h4::after,
#siteFooter .footer-col h4::before,
footer.site-footer .footer-col h4::after,
footer.site-footer .footer-col h4::before,
.footer-col h4::after {
  display: none !important;
  content: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* قوائم الروابط */
#siteFooter .footer-col ul,
footer.site-footer .footer-col ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 9px !important;
}

#siteFooter .footer-col ul li,
footer.site-footer .footer-col ul li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

#siteFooter .footer-col a,
footer.site-footer .footer-col a {
  color: var(--text-muted, #8E9F9F) !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  transition: color 0.2s ease, transform 0.2s ease !important;
  cursor: pointer !important;
  display: inline-block !important;
}

#siteFooter .footer-col a:hover,
footer.site-footer .footer-col a:hover {
  color: var(--amber, #E0941E) !important;
  text-decoration: none !important;
}

/* زر تطبيق Google Play */
#siteFooter .footer-app-btn,
footer.site-footer .footer-app-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: rgba(18, 120, 118, 0.16) !important;
  border: 1px solid var(--primary, #127876) !important;
  color: #5EEAD4 !important;
  padding: 9px 16px !important;
  border-radius: 10px !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  transition: all 0.25s ease !important;
  margin-top: 4px !important;
}

#siteFooter .footer-app-btn:hover,
footer.site-footer .footer-app-btn:hover {
  background: var(--primary, #127876) !important;
  color: #FFF !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 14px rgba(18, 120, 118, 0.4) !important;
}

/* الشريط السفلي لحقوق النشر */
#siteFooter .footer-bottom,
footer.site-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding-top: 24px !important;
  padding-bottom: 20px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  color: var(--text-muted, #8E9F9F) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  width: 100% !important;
}

#siteFooter .footer-bottom > div,
footer.site-footer .footer-bottom > div {
  text-align: center !important;
  margin: 0 auto !important;
  width: 100% !important;
}

/* ══════════════ زر الرجوع للأعلى العائم (Scroll To Top) ══════════════ */
.scroll-top-btn {
  position: fixed !important;
  bottom: 84px !important;
  right: 24px !important;
  z-index: 2100 !important;
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, rgba(20, 42, 40, 0.92) 0%, rgba(9, 22, 21, 0.96) 100%) !important;
  border: 1px solid rgba(220, 185, 115, 0.35) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 18px rgba(220, 185, 115, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
  color: #F0CF85 !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(20px) scale(0.85) !important;
  transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.scroll-top-btn.visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

.scroll-top-btn:hover {
  background: linear-gradient(135deg, #127876 0%, #0d5c5a 100%) !important;
  border-color: #5EEAD4 !important;
  color: #FFF !important;
  box-shadow: 0 12px 36px rgba(18, 120, 118, 0.5), 0 0 24px rgba(94, 234, 212, 0.4) !important;
  transform: translateY(-4px) scale(1.05) !important;
}

[dir="ltr"] .scroll-top-btn,
html[lang="en"] .scroll-top-btn {
  right: auto !important;
  left: 24px !important;
}

@media (max-width: 768px) {
  .scroll-top-btn {
    bottom: 50px !important;
    right: 16px !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }
  [dir="ltr"] .scroll-top-btn,
  html[lang="en"] .scroll-top-btn {
    right: auto !important;
    left: 16px !important;
  }
}

/* ══════════════ شريط الحالة ومساعد عماري الثابت أسفل الشاشة (conn-bar) ══════════════ */
.conn-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1500 !important;
  background: rgba(14, 23, 24, 0.98) !important;
  border-top: 1px solid rgba(220, 185, 115, 0.22) !important;
  padding: 4px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--text-muted, #8E9F9F) !important;
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  box-sizing: border-box !important;
}

[dir="ltr"] .conn-bar,
html[lang="en"] .conn-bar {
  direction: ltr !important;
}

.conn-bar-items {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  z-index: 2 !important;
  pointer-events: auto !important;
}

.conn-bar .item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: var(--text-muted, #8E9F9F) !important;
  transition: color 0.2s ease !important;
}

.conn-bar .item.conn-bar-action-item {
  cursor: pointer !important;
  user-select: none !important;
}

.conn-bar .item.conn-bar-action-item:hover {
  color: #5EEAD4 !important;
}

.conn-bar-svg {
  width: 13px !important;
  height: 13px !important;
  stroke: currentColor !important;
  opacity: 0.85 !important;
  flex-shrink: 0 !important;
}

.conn-bar .dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

.conn-bar .dot.ok {
  background: var(--success, #10B981) !important;
  box-shadow: 0 0 6px var(--success, #10B981) !important;
}

.conn-bar .dot.err {
  background: var(--danger, #EF4444) !important;
  box-shadow: 0 0 6px var(--danger, #EF4444) !important;
}

.conn-bar .dot.warn {
  background: var(--warning, #F59E0B) !important;
  box-shadow: 0 0 6px var(--warning, #F59E0B) !important;
}

/* ── زر مساعد عماري المدمج داخل الشريط السفلي مع الضوء الأخضر النابض ── */
@keyframes copilotBeaconBlink {
  0%, 100% {
    background: #10B981;
    box-shadow: 0 0 8px #10B981, 0 0 14px #34D399;
    opacity: 1;
  }
  50% {
    background: #065F46;
    box-shadow: 0 0 2px rgba(16, 185, 129, 0.25);
    opacity: 0.45;
  }
}

.conn-bar-copilot-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(7, 18, 20, 0.95) !important;
  border: 1.5px solid #F7CE72 !important;
  border-radius: 20px !important;
  padding: 2px 10px 2px 4px !important;
  color: #F8FAFC !important;
  cursor: pointer !important;
  font-family: inherit !important;
  transition: all 0.25s ease !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
}

[dir="ltr"] .conn-bar-copilot-btn,
html[lang="en"] .conn-bar-copilot-btn {
  padding: 2px 4px 2px 10px !important;
}

.conn-bar-copilot-btn:hover {
  background: #0d282a !important;
  border-color: #5EEAD4 !important;
  box-shadow: 0 2px 12px rgba(45, 212, 191, 0.4) !important;
  color: #fff !important;
}

.conn-bar-copilot-btn.active {
  border-color: #5EEAD4 !important;
  background: linear-gradient(135deg, #134e4a 0%, #0f3d3a 100%) !important;
  box-shadow: 0 0 16px rgba(94, 234, 212, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.25) !important;
  color: #FFFFFF !important;
}

.conn-bar-copilot-avatar {
  position: relative !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  overflow: visible !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.conn-bar-copilot-avatar img {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
}

.conn-bar-copilot-dot {
  position: absolute !important;
  top: -1px !important;
  inset-inline-end: -1px !important;
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: #10B981 !important;
  border: 1px solid #071214 !important;
  animation: copilotBeaconBlink 1.4s infinite ease-in-out !important;
}

.conn-bar-copilot-label {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #F8FAFC !important;
  white-space: nowrap !important;
}

.conn-bar-copilot-chat-svg {
  width: 13px !important;
  height: 13px !important;
  stroke: #5EEAD4 !important;
  opacity: 0.9 !important;
  flex-shrink: 0 !important;
}

body {
  padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px)) !important;
}

#latencyItem {
  display: none !important;
}

@media (max-width: 768px) {
  .conn-bar {
    padding: 4px 12px !important;
    gap: 8px !important;
    font-size: 10px !important;
  }
  .conn-bar-items {
    gap: 10px !important;
  }
  #creditsStatusItem {
    display: none !important;
  }
}

@media (max-width: 480px) {
  #favsStatusItem {
    display: none !important;
  }
}

/* ══════════════ التجاوب (Responsive Footer Grid) ══════════════ */
@media (max-width: 1239px) and (min-width: 769px) {
  #siteFooter .footer-grid,
  footer.site-footer .footer-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 32px 20px !important;
  }
  #siteFooter .footer-brand-col,
  footer.site-footer .footer-brand-col {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
    margin-bottom: 12px !important;
  }
}

@media (max-width: 768px) {
  #siteFooter .footer-grid,
  footer.site-footer .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 28px 16px !important;
  }
  #siteFooter .footer-brand-col,
  footer.site-footer .footer-brand-col {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
    margin-bottom: 12px !important;
  }
  #siteFooter .container,
  #siteFooter .footer-container,
  footer.site-footer .container,
  footer.site-footer .footer-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

@media (max-width: 480px) {
  #siteFooter,
  footer.site-footer {
    padding-top: 36px !important;
  }
  #siteFooter .footer-grid,
  footer.site-footer .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

/* ══════════════ 🪄 شريط التنقل السفلي الذكي للهواتف (Smart Dynamic Mobile Dock) ══════════════ */
#mobileBottomNav,
.mobile-bottom-nav {
  height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  transition: height 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#mobileBottomNav.is-touch-compact,
.mobile-bottom-nav.is-touch-compact {
  height: calc(44px + env(safe-area-inset-bottom, 0px)) !important;
}

#mobileBottomNav.is-touch-compact .mob-nav-label,
.mobile-bottom-nav.is-touch-compact .mob-nav-label {
  opacity: 0 !important;
  max-height: 0 !important;
  transform: translateY(4px) !important;
  pointer-events: none !important;
}

#mobileBottomNav .mob-nav-label,
.mobile-bottom-nav .mob-nav-label {
  display: block;
  max-height: 14px;
  opacity: 1;
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 9.5px;
  line-height: 12px;
  font-weight: 600;
  letter-spacing: -0.2px;
  transition: opacity 0.22s ease, max-height 0.25s ease, transform 0.22s ease;
}


/* ══════════════ 🔮 دائرة مساعد عماري البارزة من الشريط السفلي (نفس دائرة التطبيق) ══════════════
   - نصف الدائرة العلوي بارز فوق الشريط ونصفها السفلي داخله.
   - تنبض (تنور وتطفي) للفت الانتباه.
   - تختفي عند فتح نافذة الشات وتعود عند إغلاقها (الكلاس .active يُضاف/يُزال من app.js). */
@keyframes copilotOrbBlink {
  0%, 100% {
    border-color: #F7CE72;
    box-shadow: 0 0 0 0 rgba(247, 206, 114, 0.55), 0 4px 14px rgba(224, 148, 30, 0.45), 0 0 10px rgba(247, 206, 114, 0.35);
    filter: brightness(1.05);
  }
  50% {
    border-color: #5EEAD4;
    box-shadow: 0 0 0 10px rgba(94, 234, 212, 0), 0 4px 22px rgba(94, 234, 212, 0.75), 0 0 28px rgba(94, 234, 212, 0.55);
    filter: brightness(0.85);
  }
}

/* الشريط كان يأخذ ارتفاعه من الزر القديم؛ بعد جعل الدائرة absolute نثبّت ارتفاعه الأصلي ليبقى واضحًا */
#connBar.conn-bar {
  min-height: 36px !important;
  box-sizing: border-box !important;
}

#connBar #copilotFab.conn-bar-copilot-btn {
  position: absolute !important;
  top: 0 !important;
  inset-inline-start: 18px !important;
  inset-inline-end: auto !important;
  width: 56px !important;
  height: 56px !important;
  margin: 0 !important;
  padding: 0 !important;
  order: 0 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  background: #071214 !important;
  border: 2px solid #F7CE72 !important;
  z-index: 5 !important;
  transform: translateY(-50%) !important;
  animation: copilotOrbBlink 1.8s ease-in-out infinite !important;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease !important;
}

#connBar #copilotFab.conn-bar-copilot-btn:hover {
  transform: translateY(-50%) scale(1.08) !important;
  background: #0d282a !important;
}

#connBar #copilotFab.conn-bar-copilot-btn:focus-visible {
  outline: 2px solid #5EEAD4 !important;
  outline-offset: 3px !important;
}

#connBar #copilotFab .conn-bar-copilot-avatar {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  overflow: hidden !important;
}

#connBar #copilotFab .conn-bar-copilot-avatar img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

#connBar #copilotFab .conn-bar-copilot-dot {
  top: 3px !important;
  inset-inline-end: 3px !important;
  width: 12px !important;
  height: 12px !important;
  border: 2px solid #071214 !important;
}

#connBar #copilotFab .conn-bar-copilot-label,
#connBar #copilotFab .conn-bar-copilot-chat-svg {
  display: none !important;
}

/* عند فتح نافذة الشات: الدائرة تختفي بالكامل، وترجع بمجرد الإغلاق */
#connBar #copilotFab.conn-bar-copilot-btn.active,
body.copilot-panel-open #connBar #copilotFab.conn-bar-copilot-btn {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  animation: none !important;
  transform: translateY(-50%) scale(0.5) !important;
}

body.light-theme #connBar,
body.light-theme .conn-bar {
  background: rgba(248, 250, 250, 0.96) !important;
  border-top-color: #D2E0DD !important;
  color: #46615E !important;
}

body.light-theme .conn-bar .item {
  color: #36504D !important;
}

body.light-theme .conn-bar .item.conn-bar-action-item:hover {
  color: #0F766E !important;
}

body.light-theme #connBar #copilotFab.conn-bar-copilot-btn {
  background: #FFFFFF !important;
  border-color: #127876 !important;
  box-shadow: 0 4px 14px rgba(18, 120, 118, 0.28) !important;
}

body.light-theme #connBar #copilotFab .conn-bar-copilot-dot {
  border-color: #FFFFFF !important;
}

@media (prefers-reduced-motion: reduce) {
  #connBar #copilotFab.conn-bar-copilot-btn {
    animation: none !important;
    box-shadow: 0 4px 14px rgba(224, 148, 30, 0.45), 0 0 10px rgba(247, 206, 114, 0.35) !important;
  }
}
