/* ============ VARIABLES & THEMES ============ */
:root {
  --grad: linear-gradient(135deg, #7c3aed, #06b6d4);
  --grad-2: linear-gradient(135deg, #f59e0b, #ef4444);
  --radius: 18px;
  --trans: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] {
  --bg: #0b0f1e; --bg-alt: #10162b; --text: #e7ecf5; --muted: #93a0b8;
  --glass: rgba(255,255,255,0.06); --glass-border: rgba(255,255,255,0.12);
  --shadow: 0 20px 50px rgba(0,0,0,0.5); --glow: 0 0 30px rgba(124,58,237,0.45);
}
[data-theme="light"] {
  --bg: #f2f5fb; --bg-alt: #e8edf7; --text: #16203a; --muted: #5a6780;
  --glass: rgba(255,255,255,0.65); --glass-border: rgba(22,32,58,0.1);
  --shadow: 0 20px 50px rgba(22,32,58,0.12); --glow: 0 0 30px rgba(124,58,237,0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  overflow-x: hidden; transition: background var(--trans), color var(--trans);
}
.container { width: min(1180px, 92%); margin: 0 auto; }
.container.narrow { max-width: 720px; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ============ PRELOADER ============ */
#preloader {
  position: fixed; inset: 0; z-index: 9999; background: #0b0f1e;
  display: flex; flex-direction: column; gap: 24px; align-items: center; justify-content: center;
  color: #93a0b8; transition: opacity 0.6s, visibility 0.6s;
}
#preloader.hidden { opacity: 0; visibility: hidden; }
.loader-cube { display: grid; grid-template-columns: repeat(2, 22px); gap: 6px; transform: rotate(45deg); }
.loader-cube span { width: 22px; height: 22px; border-radius: 5px; background: var(--grad); animation: cubePulse 1.2s ease-in-out infinite; }
.loader-cube span:nth-child(2) { animation-delay: 0.15s; }
.loader-cube span:nth-child(3) { animation-delay: 0.3s; }
.loader-cube span:nth-child(4) { animation-delay: 0.45s; }
@keyframes cubePulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.5); opacity: 0.4; } }

/* ============ SCROLL PROGRESS ============ */
#scroll-progress { position: fixed; top: 0; left: 0; height: 4px; width: 0; background: var(--grad); z-index: 1001; box-shadow: var(--glow); }

/* ============ NAVBAR ============ */
#navbar {
  position: fixed; top: 0; width: 100%; z-index: 1000; padding: 16px 0;
  transition: var(--trans); backdrop-filter: blur(14px);
}
#navbar.scrolled { background: var(--glass); border-bottom: 1px solid var(--glass-border); padding: 10px 0; box-shadow: var(--shadow); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-size: 1.4rem; font-weight: 800; }
.logo span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 22px; list-style: none; }
.nav-links a { font-size: 0.92rem; color: var(--muted); position: relative; transition: color var(--trans); }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0; background: var(--grad); transition: width var(--trans); }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
#theme-toggle { background: var(--glass); border: 1px solid var(--glass-border); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; font-size: 1rem; transition: transform var(--trans); }
#theme-toggle:hover { transform: rotate(20deg) scale(1.1); }
#hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
#hamburger span { width: 24px; height: 2px; background: var(--text); transition: var(--trans); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-block; padding: 12px 28px; border-radius: 50px; font-weight: 600;
  border: none; cursor: pointer; font-size: 0.95rem; transition: var(--trans); position: relative;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 0 45px rgba(124,58,237,0.65); }
.btn-ghost { background: var(--glass); color: var(--text); border: 1px solid var(--glass-border); backdrop-filter: blur(10px); }
.btn-ghost:hover { transform: translateY(-3px); border-color: #7c3aed; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 15px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ============ HERO ============ */
#hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding: 120px 0 80px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; animation: drift 18s ease-in-out infinite; will-change: transform; }
.orb-1 { width: 420px; height: 420px; background: #7c3aed; top: -10%; left: -8%; }
.orb-2 { width: 360px; height: 360px; background: #06b6d4; bottom: -10%; right: -6%; animation-delay: 3s; }
.orb-3 { width: 240px; height: 240px; background: #ef4444; top: 40%; left: 55%; opacity: 0.3; animation-delay: 6s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(70px, -45px) scale(1.12); }
  50%  { transform: translate(-30px, 60px) scale(0.94); }
  75%  { transform: translate(-65px, -30px) scale(1.08); }
  100% { transform: translate(0, 0) scale(1); }
}

.hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 50px; align-items: center; position: relative; }
.badge { display: inline-block; padding: 7px 16px; border-radius: 50px; background: var(--glass); border: 1px solid var(--glass-border); font-size: 0.8rem; margin-bottom: 20px; backdrop-filter: blur(8px); }
.hero-text h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.12; margin-bottom: 18px; }
.hero-text p { color: var(--muted); font-size: 1.1rem; max-width: 480px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.6rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-stats span { color: var(--muted); font-size: 0.85rem; }

/* 3D floating elements */
.hero-3d { position: relative; height: 420px; perspective: 900px; }
.hero-ring {
  position: absolute; inset: 12%; border-radius: 50%;
  border: 2px dashed rgba(124,58,237,0.5); animation: spin 22s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.card-3d {
  position: absolute; padding: 18px 22px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(14px);
  box-shadow: var(--shadow); font-size: 1.6rem; display: flex; flex-direction: column; gap: 6px;
  transform-style: preserve-3d; transition: transform 0.15s ease-out;
}
.card-3d small { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.float-1 { top: 6%; left: 12%; animation: floatY 5s ease-in-out infinite; }
.float-2 { top: 42%; right: 4%; animation: floatY 6s ease-in-out infinite 1s; }
.float-3 { bottom: 6%; left: 22%; animation: floatY 5.5s ease-in-out infinite 2s; }
@keyframes floatY { 0%,100% { transform: translateY(0) rotateX(6deg) rotateY(-6deg); } 50% { transform: translateY(-22px) rotateX(-6deg) rotateY(6deg); } }

/* ============ SECTIONS ============ */
.section { padding: 100px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { text-align: center; font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 50px; }
.demo-tag { font-size: 0.6em; vertical-align: middle; background: var(--grad-2); color: #fff; padding: 3px 10px; border-radius: 50px; }

/* ============ GLASS CARDS & GRIDS ============ */
.glass-card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 30px; backdrop-filter: blur(14px); box-shadow: var(--shadow);
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.glass-card:hover { border-color: rgba(124,58,237,0.55); box-shadow: var(--glow); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 40px; }
.icon-bubble {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.7rem; background: var(--grad); margin-bottom: 18px; box-shadow: var(--glow);
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(4deg); } }
.glass-card h3 { margin-bottom: 10px; }
.glass-card p { color: var(--muted); line-height: 1.6; }

/* ============ PLAN ============ */
.binary-tree { display: flex; flex-direction: column; align-items: center; gap: 26px; margin-bottom: 20px; }
.tree-level { display: flex; gap: 60px; }

/* ============ PRODUCTS ============ */
.product-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.product-card .p-img { height: 200px; overflow: hidden; }
.product-card .p-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.product-card:hover .p-img img { transform: scale(1.12) rotate(1.5deg); }
.product-card .p-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.product-card .p-price { font-size: 1.3rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin: 8px 0; }
.product-card .btn { margin-top: auto; align-self: flex-start; }
.loading-msg { grid-column: 1/-1; text-align: center; color: var(--muted); }

/* ============ CALCULATOR ============ */
.calc-card label { display: block; margin: 18px 0 8px; font-weight: 600; }
input[type="range"] { width: 100%; accent-color: #7c3aed; cursor: pointer; }
.calc-card select {
  width: 100%; padding: 13px; border-radius: 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--glass-border); font-size: 1rem;
}
.calc-result { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 26px; }
.calc-result div { background: rgba(124,58,237,0.12); border-radius: 14px; padding: 18px; text-align: center; }
.calc-result span { color: var(--muted); font-size: 0.85rem; display: block; }
.calc-result strong { font-size: 1.7rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.disclaimer { font-size: 0.78rem; color: var(--muted); margin-top: 16px; }
.disclaimer.center { text-align: center; }

/* ============ TESTIMONIALS ============ */
.slider { overflow: hidden; }
.slides { display: flex; transition: transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.slide { min-width: 100%; text-align: center; }
.slide img { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px; border: 3px solid #7c3aed; }
.slide p { font-size: 1.05rem; font-style: italic; max-width: 520px; margin: 0 auto 16px; }
.slide span { color: var(--muted); font-size: 0.85rem; }
.slider-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
.slider-nav button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--glass); color: var(--text); font-size: 1.3rem; cursor: pointer; transition: var(--trans);
}
.slider-nav button:hover { background: var(--grad); color: #fff; transform: scale(1.1); }
.dots { display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--glass-border); cursor: pointer; transition: var(--trans); }
.dot.active { background: var(--grad); width: 26px; border-radius: 6px; }

/* ============ LEADERS ============ */
.leader-card { text-align: center; }
.leader-card img { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 16px; border: 3px solid transparent; background: var(--grad); padding: 3px; }
.rank { display: inline-block; margin: 6px 0 10px; font-size: 0.85rem; padding: 5px 14px; border-radius: 50px; background: rgba(124,58,237,0.15); }
.socials { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.socials a {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--glass-border); transition: var(--trans);
}
.socials a:hover { background: var(--grad); color: #fff; transform: translateY(-4px) rotate(8deg); }

/* ============ FORMS ============ */
.form-card .field { position: relative; margin-bottom: 24px; }
.field input, .field textarea {
  width: 100%; padding: 15px 16px; border-radius: 12px; background: transparent;
  border: 1px solid var(--glass-border); color: var(--text); font-size: 1rem; transition: var(--trans);
  resize: vertical; font-family: inherit;
}
.field label {
  position: absolute; left: 14px; top: 15px; color: var(--muted); pointer-events: none;
  transition: var(--trans); background: transparent; padding: 0 6px;
}
.field input:focus, .field textarea:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 4px rgba(124,58,237,0.18); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  top: -10px; font-size: 0.75rem; color: #7c3aed; background: var(--bg);
}
.section.alt .field label { background: var(--bg-alt); }
.form-msg { margin-top: 14px; text-align: center; font-weight: 600; color: #22c55e; min-height: 1.2em; }
.form-msg.error { color: #ef4444; }

/* ============ DASHBOARD ============ */
.stat-card { text-align: center; }
.stat-icon { font-size: 1.9rem; display: block; margin-bottom: 10px; }
.stat-card strong { font-size: 1.5rem; display: block; }
.stat-card > span:last-child { color: var(--muted); font-size: 0.85rem; }
.progress-card { margin-top: 30px; }
.progress-bar { height: 14px; border-radius: 8px; background: var(--glass-border); overflow: hidden; margin: 16px 0 10px; }
.progress-fill { height: 100%; width: 0; background: var(--grad); border-radius: 8px; transition: width 1.6s cubic-bezier(0.4,0,0.2,1); box-shadow: var(--glow); }

/* ============ FAQ ============ */
.faq-item { padding: 0; margin-bottom: 14px; overflow: hidden; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; background: none; border: none; color: var(--text);
  font-size: 1rem; font-weight: 600; cursor: pointer; text-align: left;
}
.faq-q span { font-size: 1.4rem; transition: transform var(--trans); color: #7c3aed; }
.faq-item.open .faq-q span { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.45s ease; }
.faq-a p { padding: 0 24px 20px; }

/* ============ CONTACT ============ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 30px; align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: 18px; }
.contact-info .glass-card { display: flex; gap: 16px; align-items: center; padding: 22px; }
.contact-info span { font-size: 1.6rem; }

/* ============ FOOTER ============ */
footer { background: var(--bg-alt); padding: 70px 0 24px; border-top: 1px solid var(--glass-border); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 34px; margin-bottom: 44px; }
footer h4 { margin-bottom: 14px; }
footer ul { list-style: none; }
footer ul a { color: var(--muted); display: block; padding: 5px 0; transition: var(--trans); }
footer ul a:hover { color: var(--text); padding-left: 6px; }
footer p { color: var(--muted); margin-top: 12px; }
footer .socials { justify-content: flex-start; }
.copyright { text-align: center; font-size: 0.82rem; border-top: 1px solid var(--glass-border); padding-top: 22px; }

/* ============ BACK TO TOP ============ */
#back-to-top {
  position: fixed; bottom: 28px; right: 28px; width: 50px; height: 50px; border-radius: 50%;
  background: var(--grad); color: #fff; border: none; font-size: 1.3rem; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(20px); transition: var(--trans);
  box-shadow: var(--glow); z-index: 999;
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { transform: translateY(-5px) scale(1.08); }

/* ============ SCROLL REVEAL ============ */
.reveal { opacity: 0; transform: translateY(45px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-text p { margin: 0 auto 28px; }
  .hero-cta, .hero-stats { justify-content: center; }
  .hero-3d { height: 320px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid, .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav-links {
    position: fixed; top: 64px; right: -100%; flex-direction: column; gap: 0;
    background: var(--bg-alt); width: 75%; height: calc(100vh - 64px); padding: 28px;
    transition: right var(--trans); border-left: 1px solid var(--glass-border);
  }
  .nav-links.open { right: 0; }
  .nav-links li { padding: 14px 0; border-bottom: 1px solid var(--glass-border); }
  #hamburger { display: flex; }
  .grid-3, .grid-4, .contact-grid, .footer-grid { grid-template-columns: 1fr; }
  .calc-result { grid-template-columns: 1fr; }
  .tree-level { gap: 28px; }
  .section { padding: 70px 0; }
}

/* ============ NEW UPGRADED ANIMATIONS ============ */
.node {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--glass); border: 2px solid rgba(124,58,237,0.6); backdrop-filter: blur(8px);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  cursor: pointer;
}
.node:hover {
  transform: scale(1.18);
  border-color: #06b6d4;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.8), 0 0 48px rgba(6, 182, 212, 0.4);
}

/* YAHAN PHOTO KO PERFECT FIT KARNE KA CODE UPDATE KIYA HAI */
.node.you { 
  background: var(--grad); 
  color: #fff; 
  width: 76px; 
  height: 76px; 
  box-shadow: var(--glow); 
  animation: pulse 2.4s infinite;
  overflow: hidden !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* NEW PHOTO LAYER CLASS */
.user-tree-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}

.node.sm { width: 50px; height: 50px; font-size: 0.8rem; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.5); } 50% { box-shadow: 0 0 0 18px rgba(124,58,237,0); } }

/* Cascading glow wave pulse class */
.node.glow-pulse {
  animation: nodeGlow 0.9s ease-out;
}
@keyframes nodeGlow {
  0%   { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); transform: scale(1); }
  40%  { box-shadow: 0 0 28px 8px rgba(124, 58, 237, 0.85), 0 0 56px rgba(6, 182, 212, 0.5); transform: scale(1.14); border-color: #06b6d4; }
  100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); transform: scale(1); }
}
