﻿/* Quick System — المظهر ثلاثي الأبعاد (2026-11-27): بانر بيتحرك مع الماوس، حلقة البرامج، الكرة الأرضية، ظهور بعمق */

/* ===== ظهور الأقسام بعمق (بدل الطلوع العادي) ===== */
html.fx3d [data-anim="up"] { transform: perspective(900px) translateY(40px) rotateX(16deg); transform-origin: 50% 100%; }
html.fx3d [data-anim="zoom"] { transform: perspective(900px) translateZ(-120px) rotateX(8deg); }
html.fx3d [data-anim].in { transform: none; }

/* ===== البانر: المسرح كله 3D ويميل مع الماوس ===== */
html.fx3d .fx-stage { transform-style: preserve-3d; --rx: 0deg; --ry: 0deg; }
html.fx3d .fx-stage .fx-3d { position: relative; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s cubic-bezier(.2,.7,.2,1); }
html.fx3d .fx-stage .fx-laptop { transform: translateZ(0) rotateY(-10deg) rotateX(6deg); animation: none; }
html.fx3d[dir=ltr] .fx-stage .fx-laptop { transform: translateZ(0) rotateY(10deg) rotateX(6deg); }
html.fx3d .fx-laptop .scr { transform-origin: 50% 100%; transform: rotateX(var(--lid, 0deg)); box-shadow: 0 30px 60px -20px rgba(2,6,23,.6), inset 0 0 0 1px rgba(255,255,255,.05); }
html.fx3d .fx-laptop .base { transform: rotateX(78deg); transform-origin: 50% 0; height: 70px; margin-top: -2px; border-radius: 0 0 18px 18px; background: linear-gradient(180deg, #e2e8f0, #94a3b8); box-shadow: 0 40px 50px -10px rgba(2,6,23,.45); }
html.fx3d .fx-laptop .base::after { content: ""; position: absolute; inset: 10px 14% 26px; border-radius: 6px; background: repeating-linear-gradient(90deg, rgba(100,116,139,.35) 0 10px, transparent 10px 13px), repeating-linear-gradient(0deg, transparent 0 9px, rgba(255,255,255,.4) 9px 12px); opacity: .7; }
html.fx3d .fx-stage .fx-phone { translate: 0 0 90px; rotate: y -14deg; }
html.fx3d .fx-stage .fx-chip.c1 { translate: 0 0 140px; }
html.fx3d .fx-stage .fx-chip.c2 { translate: 0 0 110px; }
html.fx3d .fx-stage .fx-chip.c3 { translate: 0 0 170px; }
html.fx3d .fx-stage .fx-float { translate: 0 0 60px; }
html.fx3d .fx-stage .fx-float.f2, html.fx3d .fx-stage .fx-float.f5 { translate: 0 0 200px; }
html.fx3d .fx-stage .fx-ring { translate: 0 0 -80px; }
/* ظل تحت المسرح */
html.fx3d .fx-stage .fx-shadow { position: absolute; left: 8%; right: 8%; bottom: -26px; height: 40px; border-radius: 50%; background: radial-gradient(closest-side, rgba(2,6,23,.45), transparent); filter: blur(6px); transform: rotateX(80deg) translateZ(-40px); pointer-events: none; }
/* الموبايل: حركة تلقائية خفيفة بدل الماوس */
@keyframes fx3dSway { 0%, 100% { transform: rotateX(4deg) rotateY(-9deg); } 50% { transform: rotateX(-2deg) rotateY(9deg); } }
html.fx3d.fx3d-auto .fx-stage .fx-3d { animation: fx3dSway 9s ease-in-out infinite; transition: none; }

/* ===== الجديد: الدخول من أي مكان + الكرة الأرضية ===== */
.fx-new3d { position: relative; overflow: hidden; background: radial-gradient(700px 380px at 15% 20%, rgba(29,78,216,.14), transparent 70%), radial-gradient(600px 320px at 90% 90%, rgba(249,115,22,.12), transparent 70%); }
.fx-new3d .grid2 { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.fx-new3d .globe-box { position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; margin: 0 auto; }
.fx-new3d .globe-box canvas { width: 100%; height: 100%; display: block; }
.fx-new3d .globe-box .url { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); direction: ltr; white-space: nowrap; background: #0f172a; color: #e2e8f0; border-radius: 999px; padding: 9px 18px 9px 14px; font: 600 14px/1.2 ui-monospace, Consolas, monospace; box-shadow: 0 14px 30px -12px rgba(2,6,23,.5); }
.fx-new3d .globe-box .url i { color: #22c55e; margin-right: 8px; }
.fx-new3d .globe-box .url b { color: #fb923c; unicode-bidi: isolate; }
.fx-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.fx-feat { position: relative; background: var(--card, #fff); border: 1px solid rgba(148,163,184,.25); border-radius: 18px; padding: 18px 18px 16px; transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; box-shadow: 0 10px 30px -18px rgba(15,23,42,.35); }
.fx-feat .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #1d4ed8, #f97316); transform: translateZ(30px); margin-bottom: 10px; font-size: 18px; }
.fx-feat h3 { font-size: 16px; margin: 0 0 6px; transform: translateZ(20px); }
.fx-feat p { font-size: 13.5px; margin: 0; color: var(--muted, #64748b); line-height: 1.7; transform: translateZ(10px); }
.fx-feat .new { position: absolute; top: 12px; inset-inline-end: 12px; font-size: 11px; font-weight: 700; color: #f97316; background: rgba(249,115,22,.12); border-radius: 999px; padding: 3px 9px; }
html[data-theme="dark"] .fx-feat { background: #111a2e; border-color: rgba(148,163,184,.15); }

/* ===== حلقة البرامج 3D ===== */
.fx-ring3d { position: relative; overflow: hidden; padding: 70px 0 90px; color: #fff; background: radial-gradient(900px 420px at 50% 0%, #1d4ed8 0%, transparent 70%), radial-gradient(700px 300px at 50% 100%, rgba(249,115,22,.35), transparent 70%), #071233; }
.fx-ring3d .sec-head h2, .fx-ring3d .sec-head p { color: #fff; }
.fx-ring3d .sec-head p { opacity: .8; }
.r3-stage { position: relative; height: 380px; perspective: 1300px; perspective-origin: 50% 30%; margin-top: 10px; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.r3-stage.drag { cursor: grabbing; }
.r3-spin { position: absolute; left: 50%; top: 40px; width: 0; height: 0; transform-style: preserve-3d; }
.r3-card { position: absolute; left: -85px; top: 0; width: 170px; height: 210px; border-radius: 22px; padding: 22px 14px; text-align: center; color: #fff; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.22); box-shadow: 0 30px 60px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .25s, border-color .25s; }
.r3-card i { font-size: 38px; width: 78px; height: 78px; border-radius: 22px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #f97316) 85%, #000 15%); box-shadow: 0 16px 30px -12px var(--c, #f97316); color: #fff; }
.r3-card b { font-size: 15px; line-height: 1.5; font-weight: 700; }
.r3-card:hover, .r3-card:focus-visible { background: linear-gradient(160deg, rgba(255,255,255,.28), rgba(255,255,255,.08)); border-color: rgba(255,255,255,.5); }
.r3-floor { position: absolute; left: 50%; top: 290px; width: 900px; height: 900px; margin-left: -450px; border-radius: 50%; transform: rotateX(90deg); background: radial-gradient(closest-side, rgba(96,165,250,.35), rgba(96,165,250,.08) 60%, transparent 70%); pointer-events: none; }
.r3-hint { text-align: center; opacity: .75; font-size: 14px; margin-top: 4px; }
.r3-hint i { margin: 0 6px; }

/* لو الـ 3D مقفول (موبايل ضعيف أو تقليل الحركة): الكروت شبكة عادية */
html:not(.fx3d) .r3-stage { height: auto; perspective: none; cursor: default; }
html:not(.fx3d) .r3-spin { position: static; width: auto; height: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 0 16px; max-width: 1100px; margin: 0 auto; }
html:not(.fx3d) .r3-card { position: static; width: auto; height: 170px; transform: none !important; }
html:not(.fx3d) .r3-floor, html:not(.fx3d) .r3-hint { display: none; }

/* ===== لمعة على الكروت اللي بتميل ===== */
.fx-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.35), transparent 60%); opacity: 0; transition: opacity .3s; mix-blend-mode: soft-light; }
.fx-tilting .fx-glare { opacity: 1; }

@media (max-width: 900px) {
    .fx-new3d .grid2 { grid-template-columns: 1fr; gap: 10px; }
    .fx-new3d .globe-box { max-width: 380px; order: -1; }
    .r3-stage { height: 320px; }
    .r3-card { width: 140px; height: 178px; left: -70px; padding: 16px 10px; }
    .r3-card i { width: 62px; height: 62px; font-size: 30px; }
    .r3-card b { font-size: 13.5px; }
    .r3-floor { top: 250px; }
}
@media (max-width: 520px) {
    .fx-feats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    html.fx3d [data-anim] { transform: none; }
}

/* ===== صفحة تصميم المواقع: شبابيك المواقع فوق بعض 3D وبتتفرد مع الماوس ===== */
.wd-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.wd-stack { position: relative; height: 380px; perspective: 1200px; }
.wd-stack .wd-in { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(14deg) rotateY(-22deg); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
[dir=ltr] .wd-stack .wd-in { transform: rotateX(14deg) rotateY(22deg); }
.wd-win { position: absolute; width: 70%; left: 22%; top: 26%; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 60px -25px rgba(2,6,23,.55); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.wd-win .bar { height: 26px; background: #e2e8f0; display: flex; gap: 6px; align-items: center; padding: 0 10px; }
.wd-win .bar i { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; display: block; }
.wd-win .bar i:nth-child(2) { background: #f59e0b; } .wd-win .bar i:nth-child(3) { background: #22c55e; }
.wd-win .bar span { margin-inline-start: 10px; font: 600 11px/1 ui-monospace, Consolas, monospace; color: #475569; background: #fff; border-radius: 999px; padding: 4px 10px; }
.wd-win .body { padding: 14px; display: grid; gap: 10px; }
.wd-win .hero { height: 70px; border-radius: 10px; background: linear-gradient(135deg, #1d4ed8, #f97316); display: grid; place-items: center; color: #fff; font-size: 28px; }
.wd-win .hero.big { height: 110px; }
.wd-win .ln { display: block; height: 10px; border-radius: 6px; background: #e2e8f0; }
.wd-win .w40 { width: 40%; } .wd-win .w60 { width: 60%; } .wd-win .w70 { width: 70%; } .wd-win .w80 { width: 80%; }
.wd-win .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .wd-win .grid3 span { height: 46px; border-radius: 8px; background: #dbeafe; }
.wd-win.w3 { transform: translateZ(-160px) translate(-34%, -46%); opacity: .85; }
.wd-win.w2 { transform: translateZ(-80px) translate(-17%, -23%); opacity: .95; }
.wd-win.w1 { transform: translateZ(0); }
.wd-phone { position: absolute; width: 23%; right: 4%; bottom: 2%; aspect-ratio: 9/18; background: #0f172a; border-radius: 22px; padding: 10px 7px; transform: translateZ(90px); box-shadow: 0 30px 50px -20px rgba(2,6,23,.7); }
.wd-phone .body { background: #fff; border-radius: 14px; height: 100%; padding: 8px; display: grid; gap: 7px; align-content: start; }
.wd-phone .hero { height: 46px; border-radius: 8px; background: linear-gradient(135deg, #f97316, #1d4ed8); }
.wd-phone .ln { display: block; height: 7px; border-radius: 5px; background: #e2e8f0; } .wd-phone .w60 { width: 60%; } .wd-phone .w80 { width: 80%; }
.wd-phone .btn-m { height: 18px; border-radius: 6px; background: #f97316; margin-top: 4px; }
/* لما الماوس يقرّب: الشبابيك بتتفرد */
.wd-stack.open .wd-win.w3 { transform: translateZ(-240px) translate(-46%, -62%) rotateY(10deg); }
.wd-stack.open .wd-win.w2 { transform: translateZ(-120px) translate(-23%, -31%) rotateY(5deg); }
.wd-stack.open .wd-phone { transform: translateZ(180px) translateX(10%); }
.wd-type .btn { margin-top: 14px; }
.wd-type { padding-bottom: 20px; }
@keyframes wdSway { 0%, 100% { transform: rotateX(12deg) rotateY(-18deg); } 50% { transform: rotateX(6deg) rotateY(-6deg); } }
html.fx3d-auto .wd-stack .wd-in { animation: wdSway 8s ease-in-out infinite; }
html:not(.fx3d) .wd-stack .wd-in { transform: none; }

/* ===== حاجات تفاعلية زيادة ===== */
.r3-nav { display: flex; justify-content: center; gap: 12px; margin-top: 6px; }
.r3-nav button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; font-size: 18px; cursor: pointer; transition: background .2s, transform .2s; }
.r3-nav button:hover { background: rgba(255,255,255,.25); transform: scale(1.08); }
.r3-card.front { border-color: rgba(251,146,60,.9); box-shadow: 0 0 0 2px rgba(251,146,60,.5), 0 30px 60px -30px rgba(0,0,0,.8); }
.r3-card.front i { animation: r3Pop 1.6s ease-in-out infinite; }
@keyframes r3Pop { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.06); } }
.fx-globe { cursor: grab; touch-action: pan-y; }
.fx-globe.drag { cursor: grabbing; }
.globe-tip { position: absolute; pointer-events: none; background: #0f172a; color: #fff; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -140%); opacity: 0; transition: opacity .2s; }
.globe-tip.on { opacity: 1; }
.globe-hint { position: absolute; top: 4%; left: 50%; transform: translateX(-50%); font-size: 12.5px; color: var(--muted, #64748b); background: rgba(255,255,255,.85); border-radius: 999px; padding: 4px 12px; pointer-events: none; }
html[data-theme="dark"] .globe-hint { background: rgba(15,23,42,.8); }
.fx-stage .fx-3d { cursor: grab; }
.fx-stage.drag .fx-3d { cursor: grabbing; transition: none !important; }
.fx-burst { position: fixed; pointer-events: none; width: 8px; height: 8px; border-radius: 50%; z-index: 9999; }
@media (max-width: 900px) {
    .wd-hero { grid-template-columns: 1fr; }
    .wd-stack { height: 300px; }
}
