/* تجسيد — تذييل الموقع المشترك v4 (ملف جديد؛ لا يستبدل footer-refresh.css) */
.shared-site-footer{
  --sf-card:var(--card,#0e1630); --sf-card2:var(--card2,#132044);
  --sf-gold:var(--gold,#c9a227); --sf-text:var(--text,#e8ecf6); --sf-muted:var(--muted,#98a2bf);
  --sf-line:var(--line,rgba(201,162,39,.2)); --sf-line2:var(--line2,rgba(255,255,255,.07));
  margin-top:48px; padding:28px 0 calc(20px + env(safe-area-inset-bottom,0px));
  border-top:1px solid var(--sf-line); color:var(--sf-text);
  background:linear-gradient(180deg,transparent,rgba(var(--bg-rgb,7,11,24),.6));
}
.shared-footer-inner{width:min(1100px,calc(100% - 32px)); margin:0 auto; display:grid; gap:16px}
.shared-footer-main,.shared-footer-extra{display:grid; gap:16px; grid-template-columns:1fr}
.shared-footer-card{
  background:var(--sf-card); border:1px solid var(--sf-line2); border-radius:18px; padding:18px;
}
.shared-footer-card h2{
  margin:0 0 12px; font-size:15px; font-weight:700; color:var(--sf-gold);
  display:flex; align-items:center; gap:8px;
}
.shared-footer-about{display:flex; flex-direction:column; justify-content:center; gap:6px}
.shared-footer-brand{
  display:inline-flex; align-items:center; gap:10px; font-size:22px; font-weight:800;
  color:var(--sf-gold); text-decoration:none;
}
.shared-footer-about p{margin:0; color:var(--sf-muted); font-size:14px; line-height:1.8}

.shared-footer-nav{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 12px}
.shared-footer-nav a{
  display:flex; align-items:center; gap:8px; padding:9px 8px; min-height:40px; border-radius:10px;
  color:var(--sf-text); text-decoration:none; font-size:14px;
}
.shared-footer-nav a i{width:16px; text-align:center; color:var(--sf-gold); font-size:13px}
.shared-footer-nav a:hover{background:var(--sf-card2)}

.shared-footer-actions{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px}
.shared-footer-item{
  display:flex; align-items:center; gap:10px; min-height:56px; padding:10px 12px; text-align:start;
  background:var(--sf-card2); border:1px solid var(--sf-line2); border-radius:14px;
  color:var(--sf-text); text-decoration:none; font:inherit; cursor:pointer;
  transition:border-color .15s, transform .15s;
}
.shared-footer-item:hover{border-color:var(--sf-gold); transform:translateY(-1px)}
.shared-app-icon{font-size:22px; color:var(--sf-gold); flex:none; width:26px; text-align:center}
.shared-footer-item span{display:grid; gap:2px; min-width:0}
.shared-footer-item b{font-size:14px; font-weight:700}
.shared-footer-item small{font-size:11.5px; color:var(--sf-muted); line-height:1.5}

.shared-social-actions{display:flex; gap:10px; flex-wrap:wrap}
.shared-social{
  width:46px; height:46px; display:inline-flex; align-items:center; justify-content:center;
  background:var(--sf-card2); border:1px solid var(--sf-line2); border-radius:50%;
  color:var(--sf-gold); font-size:19px; text-decoration:none; cursor:pointer; padding:0;
  transition:border-color .15s, transform .15s;
}
.shared-social:hover{border-color:var(--sf-gold); transform:translateY(-1px)}
.shared-footer-note{margin:10px 0 0; font-size:12px; line-height:1.7; color:var(--sf-muted)}
.shared-footer-note:empty{display:none}

.shared-footer-bottom{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding-top:14px; border-top:1px solid var(--sf-line2); font-size:12.5px; color:var(--sf-muted);
}
.shared-footer-top{
  display:inline-flex; align-items:center; gap:6px; padding:8px 12px; min-height:36px;
  border-radius:999px; color:var(--sf-gold); text-decoration:none; border:1px solid var(--sf-line);
}
.shared-footer-top:hover{background:var(--sf-card2)}

.shared-site-footer :focus-visible{outline:2px solid var(--sf-gold); outline-offset:2px}

/* نافذة التثبيت */
.install-help-dialog{
  max-width:min(420px,calc(100% - 32px)); padding:22px; border:1px solid var(--sf-line,rgba(201,162,39,.2));
  border-radius:18px; background:var(--card,#0e1630); color:var(--text,#e8ecf6);
}
.install-help-dialog::backdrop{background:rgba(0,0,0,.6)}
.install-help-dialog h2{margin:0 0 10px; font-size:17px; color:var(--gold,#c9a227)}
.install-help-dialog p{margin:0 0 8px; line-height:1.8; font-size:14px}
.install-help-close{
  position:absolute; inset-block-start:10px; inset-inline-end:10px; width:36px; height:36px;
  border:0; border-radius:50%; background:transparent; color:inherit; cursor:pointer;
}

/* إعدادات إظهار/إخفاء الأقسام من learn.php */
html[data-ui-footer="0"] .shared-site-footer{display:none}
html[data-ui-footer-links="0"] .shared-footer-links{display:none}
html[data-ui-footer-apps="0"] .shared-apps{display:none}
html[data-ui-footer-share="0"] .shared-sharing{display:none}

/* ثيم التباين العالي */
[data-theme="contrast"] .shared-footer-card,
[data-theme="contrast"] .shared-footer-item,
[data-theme="contrast"] .shared-social{border-width:2px}

@media (min-width:720px){
  .shared-footer-main{grid-template-columns:1fr 2fr}
  .shared-footer-extra{grid-template-columns:2fr 1fr}
  .shared-footer-nav{grid-template-columns:repeat(3,minmax(0,1fr))}
  .shared-footer-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:1000px){
  .shared-footer-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
  .shared-social-actions{display:flex}
}
/* مساحة للشريط السفلي في شاشة المتعلّم على الهاتف */
@media (max-width:820px){
  .learner-ui.signed-in .shared-site-footer{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
}
@media (prefers-reduced-motion:reduce){
  .shared-footer-item,.shared-social{transition:none}
  .shared-footer-item:hover,.shared-social:hover{transform:none}
}
