/* =============================================================
   BioHubs — القواعد المشتركة للثيمات المتحركة (16 ثيم للمشتركين)
   بيتحمّل بس لما الثيم واحد منهم، والـ body بياخد كلاس bh-anim + theme-KEY
   ألوان كل ثيم في ملفه: themes/theme-KEY.css (متغيرات بس)
   أسماء العناصر هنا هي أسماء كلاسات صفحة البروفايل الفعلية
   ============================================================= */

body.bh-anim {
  background: transparent;
  color: var(--tx);
  font-family: var(--font), 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}
/* الخلفية في طبقة ثابتة ورا الصفحة: بتتحرك من غير ما تتمط مع طول الصفحة */
body.bh-anim::before,
body.bh-anim::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
body.bh-anim::before {
  background: var(--bg);
  background-size: var(--bgs, auto);
  animation: var(--bga, none);
}
body.bh-anim::after {
  background: var(--ov, none);
  background-size: var(--ovs, auto);
  animation: var(--ova, none);
}
/* طبقة تأثيرات إضافية (نجوم، مطر، بتلات، شبكة...) — ثابتة ومقصوصة على الشاشة فمش بتعمل سكرول جانبي */
.bh-anim .bh-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bh-anim .bh-fx::before { content: none; position: absolute; inset: 0; pointer-events: none; }
.bh-anim .bh-fx::after { content: none; position: absolute; inset: 0; pointer-events: none; }
/* طبقة فوق المحتوى للزخارف الثابتة (شريط حالة، شريط عنوان، شريط تحميل) — مبتمنعش الضغط */
.bh-anim .bh-chrome { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.bh-anim .bh-chrome::before { content: none; position: absolute; pointer-events: none; }

/* ---------- ظهور العناصر بالترتيب ---------- */
.bh-anim .profile-container > .bh-av,
.bh-anim .profile-container > .display-name,
.bh-anim .profile-container > .bio,
.bh-anim .profile-container > .profile-socials,
.bh-anim .profile-container > .followers-total,
.bh-anim .profile-container > .contact-block,
.bh-anim .profile-container > .powered-by,
.bh-anim .links-container > * {
  animation: bh-rise .6s cubic-bezier(.2, .8, .2, 1) var(--d, 0s) backwards;
}
.bh-anim .profile-container > .display-name    { --d: .08s; }
.bh-anim .profile-container > .bio             { --d: .16s; }
.bh-anim .profile-container > .profile-socials { --d: .22s; }
.bh-anim .profile-container > .followers-total { --d: .27s; }
.bh-anim .links-container > :nth-child(1)  { --d: .31s; }
.bh-anim .links-container > :nth-child(2)  { --d: .38s; }
.bh-anim .links-container > :nth-child(3)  { --d: .45s; }
.bh-anim .links-container > :nth-child(4)  { --d: .52s; }
.bh-anim .links-container > :nth-child(5)  { --d: .58s; }
.bh-anim .links-container > :nth-child(6)  { --d: .64s; }
.bh-anim .links-container > :nth-child(7)  { --d: .70s; }
.bh-anim .links-container > :nth-child(n+8) { --d: .75s; }
.bh-anim .profile-container > .contact-block { --d: .8s; }
.bh-anim .profile-container > .powered-by    { --d: .85s; }

/* ---------- الصورة والاسم والنبذة ---------- */
.bh-anim .avatar {
  border-radius: var(--av-r);
  background: var(--av-bg);
  color: var(--av-tx);
  box-shadow: var(--av-sh);
  border: var(--av-bd);
}
/* غلاف الصورة: بيشيل الحلقة وأي تأثير حوالين الأفاتار */
.bh-anim .bh-av { position: relative; width: fit-content; margin: 0 auto 16px; }
.bh-anim .bh-av > .avatar { display: block; margin: 0; animation: var(--ava, bh-noop 1s); }
.bh-anim .display-name { font-weight: 800; }
.bh-anim .display-name::after { content: var(--cur, ''); animation: bh-blink 1s steps(2) infinite; }
.bh-anim .bio { opacity: .78; }

/* ---------- الروابط ---------- */
.bh-anim .profile-link {
  border-radius: var(--r);
  background: var(--bb);
  background-size: var(--lks, auto);
  color: var(--bt);
  border: var(--bd);
  box-shadow: var(--bs);
  -webkit-backdrop-filter: var(--bf, none);
  backdrop-filter: var(--bf, none);
  transition: transform .2s;
}
.bh-anim .links-container > .profile-link {
  animation: bh-rise .6s cubic-bezier(.2, .8, .2, 1) var(--d, 0s) backwards, var(--lka, bh-noop 1s);
}
.bh-anim .profile-link:hover { transform: translateY(-2px) scale(1.01); }
/* زرار واتساب */
.bh-anim .profile-link.is-wa {
  background: var(--wa-bg);
  background-size: var(--wks, var(--lks, auto));
  color: var(--wa-tx);
}
.bh-anim .links-container > .profile-link.is-wa {
  animation: bh-rise .6s cubic-bezier(.2, .8, .2, 1) var(--d, 0s) backwards, var(--waa, var(--lka, bh-noop 1s));
}

/* ---------- البلوكات الخاصة ---------- */
.bh-anim .block-header { color: var(--tx); opacity: .9; }
.bh-anim .video-frame { border-radius: var(--r); border: var(--bd); box-shadow: var(--bs); }
.bh-anim .social-chip {
  border-radius: var(--so-r);
  background: var(--bb);
  background-size: var(--lks, auto);
  color: var(--bt);
  border: var(--bd);
}
.bh-anim .contact-block { border-color: color-mix(in srgb, var(--tx) 22%, transparent); }
.bh-anim .contact-row {
  border-radius: var(--r);
  background: var(--bb);
  background-size: var(--lks, auto);
  color: var(--bt);
  border: var(--bd);
}
.bh-anim .share-btn { color: var(--tx); background: color-mix(in srgb, var(--tx) 12%, transparent); }

/* ---------- الحركات ---------- */
@keyframes bh-noop {}
@keyframes bh-rise  { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes bh-float { 50% { transform: translateY(-6px); } }
@keyframes bh-pulse { 50% { transform: scale(1.035); } }
@keyframes bh-shift { 0% { background-position: 0 50%; } 100% { background-position: 100% 50%; } }
@keyframes bh-shim  { 0% { background-position: 0 0; } 100% { background-position: 100% 0; } }
@keyframes bh-wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes bh-glow  { 50% { box-shadow: 0 0 38px #00ffc8, 0 0 6px #00ffc8; } }
@keyframes bh-blink { 50% { opacity: 0; } }
@keyframes bh-unfold { from { opacity: 0; transform: perspective(600px) rotateX(-70deg); transform-origin: top; } }
@keyframes bh-jelly { 30% { transform: scale(1.12, .85); } 50% { transform: scale(.92, 1.08); } 70% { transform: scale(1.04, .97); } }
@keyframes bh-morph { 50% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; } }
@keyframes bh-drift { to { background-position: 160px 320px; } }
@keyframes bh-drift2 { to { background-position: 100% 100%; } }
@keyframes bh-twinkle { from { opacity: .25; } to { opacity: 1; } }
@keyframes bh-ringtilt { from { transform: rotate(-26deg); } to { transform: rotate(-14deg); } }
@keyframes bh-glitch { 0%, 92%, 100% { transform: none; } 94% { transform: translate(-3px, 1px) skewX(8deg); } 96% { transform: translate(3px, -1px); } 98% { transform: translate(-1px, 2px) skewX(-6deg); } }
@keyframes bh-scan { to { top: 120%; } }
@keyframes bh-rain { to { background-position: -24px 90px; } }
@keyframes bh-rain2 { to { background-position: -40px 150px; } }
@keyframes bh-fall { to { background-position: -90px 110px; } }
@keyframes bh-fall2 { to { background-position: -100px 400px; } }
@keyframes bh-grid { to { background-position: 0 32px, 0 0; } }
@keyframes bh-dots { to { background-position: 26px 26px; } }
@keyframes bh-spin { to { transform: rotate(360deg); } }
@keyframes bh-ping { 0% { box-shadow: 0 0 0 0 rgba(0,255,150,.6); } 100% { box-shadow: 0 0 0 30px transparent; } }
@keyframes bh-ping2 { 0% { box-shadow: 0 0 0 2px var(--dot), 0 0 0 0 var(--dot); } 100% { box-shadow: 0 0 0 2px var(--dot), 0 0 0 14px transparent; } }
@keyframes bh-flow { to { background-position: 0 200%; } }
@keyframes bh-grid20 { to { background-position: 20px 20px, 20px 20px; } }
@keyframes bh-hop { 50% { transform: translateY(-8px); } }
@keyframes bh-clouds { to { background-position: -240px 0, -240px 0, -240px 0; } }
@keyframes bh-ground { to { background-position: 0 0, -32px 0; } }
@keyframes bh-nn { to { background-position: 70px 120px, 70px 120px, 70px 120px; } }
@keyframes bh-sweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes bh-rainv { to { background-position: 0 160px; } }
@keyframes bh-rainv2 { to { background-position: 11px 260px; } }
@keyframes bh-hazard { to { background-position: 28.28px 0, 28.28px 100%; } }
@keyframes bh-alarm { 50% { box-shadow: 0 0 38px #ff1a1a, 0 0 0 4px rgba(255,26,26,.6); } }
@keyframes bh-vign { from { opacity: .4; } to { opacity: 1; } }
@keyframes bh-type { from { clip-path: inset(0 100% 0 0); } }
@keyframes bh-decrypt { 0% { opacity: 0; filter: blur(10px); } 40% { opacity: .7; filter: blur(5px) hue-rotate(60deg); } 70% { opacity: .5; filter: blur(2px); } 100% { opacity: 1; filter: none; } }
@keyframes bh-load { from { transform: scaleX(0); } }
@keyframes bh-fadeout { to { opacity: 0; } }

/* أي حد مفعّل "تقليل الحركة" على جهازه: كل الحركات بتقف */
@media (prefers-reduced-motion: reduce) {
  body.bh-anim::before,
  body.bh-anim::after,
  body.bh-anim *,
  body.bh-anim *::before,
  body.bh-anim *::after { animation: none !important; }
}
