/* ============================================================
   fx.css — সারা সাইটের (পাবলিক + অ্যাডমিন + লগইন) গ্লাস • ৩ডি • অ্যানিমেশন স্তর
   মূল স্টাইলের পরে লোড হয়; থিম-রং (--primary, --accent) মানে। fx.js ক্লাস বসায়।
   সরাতে চাইলে: header-এর fx.css/fx.js লাইন দুটো মুছুন।
   ============================================================ */
@keyframes fx-rise    { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fx-pop     { from { opacity: 0; transform: translateY(18px) scale(.94); }  to { opacity: 1; transform: none; } }
@keyframes fx-float   { 0%,100% { transform: translate3d(0,0,0) scale(1); } 33% { transform: translate3d(5vw,-4vh,0) scale(1.1); } 66% { transform: translate3d(-4vw,5vh,0) scale(.94); } }
@keyframes fx-gradient{ 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes fx-shine   { from { transform: translateX(-130%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }
@keyframes fx-ripple  { to { transform: scale(4); opacity: 0; } }
@keyframes fx-bob     { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- ভাসমান রঙিন আলো (aurora) — পেছনের স্তর ---------- */
.fx-aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fx-aurora span { position: absolute; border-radius: 50%; will-change: transform; animation: fx-float 26s ease-in-out infinite; }
.fx-aurora span:nth-child(1) { width: 55vw; height: 55vw; left: -12vw; top: -18vw;  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--primary) 30%, transparent), transparent 64%); }
.fx-aurora span:nth-child(2) { width: 46vw; height: 46vw; right: -14vw; top: 8vh;   background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent, #f59e0b) 24%, transparent), transparent 64%); animation-duration: 32s; animation-delay: -8s; }
.fx-aurora span:nth-child(3) { width: 50vw; height: 50vw; left: 22vw; bottom: -26vw; background: radial-gradient(circle at 50% 50%, rgba(139,92,246,.20), transparent 64%); animation-duration: 38s; animation-delay: -15s; }
body.fx-dark .fx-aurora span:nth-child(1) { background: radial-gradient(circle, rgba(59,130,246,.45), transparent 64%); }
body.fx-dark .fx-aurora span:nth-child(2) { background: radial-gradient(circle, rgba(244,162,40,.30), transparent 64%); }
body.fx-dark .fx-aurora span:nth-child(3) { background: radial-gradient(circle, rgba(139,92,246,.40), transparent 64%); }

/* ---------- স্ক্রলে ধীরে ফুটে ওঠা ---------- */
.fx-reveal { opacity: 0; transform: translateY(26px) scale(.985); }
.fx-reveal.fx-in { opacity: 1; transform: none; transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0ms); }

/* ---------- ৩ডি টিল্ট + আলোর ঝলক (ছোট কার্ডে) ---------- */
.fx-tilt { position: relative; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .16s ease-out, box-shadow .3s; transform-style: preserve-3d; will-change: transform; }
.fx-tilt:hover { box-shadow: 0 26px 54px -14px rgba(15,23,42,.30), 0 8px 18px -8px rgba(15,23,42,.18) !important; }
.fx-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.42), transparent 62%); mix-blend-mode: soft-light; z-index: 3; }
.fx-tilt:hover > .fx-glare { opacity: 1; }
.fx-tilt > :not(.fx-glare) { transform: translateZ(0); }

/* ---------- গ্লাস পৃষ্ঠ ---------- */
.fx-glass { background: rgba(255,255,255,var(--glass-a, .66)) !important; backdrop-filter: blur(var(--glass-blur, 14px)) saturate(165%); -webkit-backdrop-filter: blur(var(--glass-blur, 14px)) saturate(165%);
  border: 1px solid rgba(255,255,255,.75) !important; box-shadow: 0 10px 34px rgba(31,41,100,.10), inset 0 1px 0 rgba(255,255,255,.95); }

/* ---------- বাটন: ৩ডি গভীরতা, ঝলক, ripple ---------- */
.btn, .btn-primary, .btn-secondary, .btn-add-cart { position: relative; overflow: hidden; }
.btn::after, .btn-primary::after, .btn-secondary::after, .btn-add-cart::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 38%; pointer-events: none; opacity: .55;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-130%) skewX(-20deg);
}
.btn:hover::after, .btn-primary:hover::after, .btn-secondary:hover::after, .btn-add-cart:hover::after { animation: fx-shine .75s ease; }
.btn:hover, .btn-primary:hover, .btn-add-cart:hover { transform: translateY(-2px); }
.btn:active, .btn-primary:active, .btn-add-cart:active { transform: translateY(1px) scale(.985); }
.btn-primary { background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%), none; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.14), 0 10px 22px -10px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn-success { background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -2px 0 rgba(0,0,0,.12), 0 10px 22px -10px rgba(16,185,129,.7); }
.btn-danger  { background-image: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0) 55%);  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -2px 0 rgba(0,0,0,.12), 0 10px 22px -10px rgba(239,68,68,.7); }
.fx-ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.55); width: 40px; height: 40px; margin: -20px 0 0 -20px; transform: scale(0); animation: fx-ripple .6s ease-out; pointer-events: none; }

/* ---------- মোডাল: কাচের মতো + পপ-ইন ---------- */
.modal-overlay.open .modal { animation: fx-pop .32s cubic-bezier(.2,.9,.3,1.15) both; }
.modal { background: rgba(255,255,255,.92); backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); border: 1px solid rgba(255,255,255,.7); }

/* ================= অ্যাডমিন ================= */
body.fx-admin { background: #eef2fb; }
body.fx-admin .card { background: rgba(255,255,255,calc(var(--glass-a, .66) + .08)); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 10px 30px rgba(31,41,100,.08), inset 0 1px 0 rgba(255,255,255,.95); transition: box-shadow .3s, transform .3s; }
body.fx-admin .card:hover { box-shadow: 0 16px 42px rgba(31,41,100,.12), inset 0 1px 0 rgba(255,255,255,.95); }
body.fx-admin .stat-card { background: rgba(255,255,255,.66); }
body.fx-admin .data-table th { background: rgba(244,247,252,.75); }
body.fx-admin .data-table tbody tr { transition: background .15s; }
body.fx-admin #adminSidebar { background: linear-gradient(185deg, color-mix(in srgb, var(--sidebar-bg) 90%, #3b82f6), var(--sidebar-bg) 55%); }
body.fx-admin .page-header { animation: fx-rise .55s cubic-bezier(.2,.8,.2,1) both; }
body.fx-admin .page-header h1, body.fx-admin .page-title { background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--primary) 80%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.fx-admin .sb-link.active i, body.fx-admin .sb-link.open i { box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--primary) 70%, transparent); }
body.fx-admin .form-control { background: rgba(255,255,255,.85); }
body.fx-admin .stat-icon, body.fx-admin .stat-icon-em { animation: fx-bob 5s ease-in-out infinite; }

/* ================= পাবলিক ================= */
body.fx-public { background: #f3f6fc; }
/* হেডার: কাচ — পেছনের স্তরে blur (অভিভাবকে নয়, তাই মোবাইল মেনুর fixed অংশ ভাঙে না) */
.site-header, .main-header { isolation: isolate; background: color-mix(in srgb, var(--primary) 82%, transparent) !important; }
.site-header::before, .main-header::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  backdrop-filter: blur(16px) saturate(170%); -webkit-backdrop-filter: blur(16px) saturate(170%); border-bottom: 1px solid rgba(255,255,255,.14); }
.hero, .page-hero { background-size: 240% 240%; animation: fx-gradient 24s ease infinite; }
.fx-has-orbs { isolation: isolate; position: relative; overflow: hidden; }
.fx-orbs { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fx-orbs span { position: absolute; border-radius: 50%; filter: blur(38px); animation: fx-float 20s ease-in-out infinite; }
.fx-orbs span:nth-child(1) { width: 340px; height: 340px; left: -80px; top: -100px; background: rgba(96,165,250,.35); }
.fx-orbs span:nth-child(2) { width: 280px; height: 280px; right: -60px; bottom: -90px; background: rgba(244,162,40,.30); animation-delay: -7s; }
.fx-orbs span:nth-child(3) { width: 200px; height: 200px; left: 42%; top: 30%; background: rgba(167,139,250,.28); animation-delay: -12s; animation-duration: 28s; }
.section-title, .section-header h2 { background: linear-gradient(90deg, var(--primary), var(--primary-bright, #1e5aa8) 55%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-header .divider { background: linear-gradient(90deg, var(--accent), transparent 150%); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 60%, transparent); }
.site-footer { background: radial-gradient(900px 320px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent), radial-gradient(700px 300px at 5% 110%, rgba(96,165,250,.14), transparent), var(--primary-deep); }
body.fx-public .form-control { background: rgba(255,255,255,.9); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
body.fx-public .form-control:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
body.fx-public .cart-summary { background: rgba(255,255,255,.7); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 10px 30px rgba(31,41,100,.08); }

/* ================= লগইন ================= */
body.fx-dark .login-wrap { background: rgba(255,255,255,.9); backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); border: 1px solid rgba(255,255,255,.55); box-shadow: 0 30px 80px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.9); animation: fx-pop .7s cubic-bezier(.2,.9,.3,1.1) both; }
body.fx-dark .login-head { background: linear-gradient(135deg, var(--primary), var(--primary-d)); background-size: 220% 220%; animation: fx-gradient 14s ease infinite; }

/* ---------- মোবাইল: হালকা রাখা ---------- */
@media (max-width: 768px) {
  .fx-aurora span:nth-child(3), .fx-orbs span:nth-child(3) { display: none; }
  .fx-glass { backdrop-filter: blur(8px) saturate(150%); -webkit-backdrop-filter: blur(8px) saturate(150%); }
}
/* ---------- সংবেদনশীল ব্যবহারকারী: গতি বন্ধ ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-aurora span, .fx-orbs span, .hero, .page-hero, .stat-icon, .stat-icon-em, body.fx-dark .login-head { animation: none !important; }
  .fx-reveal { opacity: 1 !important; transform: none !important; }
  .fx-tilt { transform: none !important; }
  .btn::after, .btn-primary::after, .btn-secondary::after, .btn-add-cart::after { display: none; }
}
/* ---------- প্রিন্ট: সব সাজসজ্জা বন্ধ ---------- */
@media print {
  .fx-aurora, .fx-orbs, .fx-glare { display: none !important; }
  .fx-reveal, .fx-glass, .fx-tilt { opacity: 1 !important; transform: none !important; backdrop-filter: none !important; }
}
