@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #070a18;
  --card: #11152a;
  --primary: #6c63ff;
  --aiblue: #00d9ff;
  --purple: #a855f7;
  --success: #22c55e;
  --error: #ef4444;
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--aiblue) 55%, var(--purple) 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(108,99,255,0.18), transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(0,217,255,0.12), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(168,85,247,0.1), transparent 45%);
  color: #f2f3f8;
  direction: rtl;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.glass {
  background: rgba(17, 21, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
  font-family: inherit;
}
.btn:hover { transform: scale(1.02); }
.btn:active { transform: scale(0.98); }
.btn-gradient { background: var(--gradient); color: #fff; box-shadow: 0 0 40px rgba(108,99,255,0.35); }
.btn-glass { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.1); }
.btn-glass:hover { background: rgba(255,255,255,0.1); }
.btn-block { width: 100%; }

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1010;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(7,10,24,0.7);
  backdrop-filter: blur(20px);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: #fff; }
.logo-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--gradient); display: flex; align-items: center; justify-content: center; }
.nav-links { display: flex; gap: 32px; font-size: 14px; color: rgba(255,255,255,0.7); }
.nav-links a:hover { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 12px; }

@media (max-width: 768px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 80px 0 110px; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 60px; align-items: center; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1fr 1fr; } }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--aiblue);
  background: rgba(0,217,255,0.1); border: 1px solid rgba(0,217,255,0.2);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 24px;
}
.hero h1 { font-size: 44px; font-weight: 800; line-height: 1.3; color: #fff; margin: 0; }
.hero p.lead { font-size: 18px; color: rgba(255,255,255,0.6); line-height: 1.8; max-width: 520px; margin: 24px 0 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-meta { display: flex; align-items: center; gap: 24px; margin-top: 40px; font-size: 13px; color: rgba(255,255,255,0.35); }
.dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,0.2); }

/* ---------- Chat Widget Demo ---------- */
.widget-demo-wrap { display: flex; justify-content: center; position: relative; }
.widget-demo {
  width: 100%; max-width: 380px; padding: 20px;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.widget-header { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.widget-avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--gradient); display: flex; align-items: center; justify-content: center; }
.widget-avatar .dot-online { position: absolute; bottom: -1px; left: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--success); border: 2px solid var(--card); }
.widget-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; min-height: 220px; }
.bubble { max-width: 85%; padding: 10px 16px; border-radius: 16px; font-size: 14px; line-height: 1.6; }
.bubble.user { align-self: flex-start; background: rgba(255,255,255,0.08); border-bottom-left-radius: 4px; }
.bubble.ai { align-self: flex-end; background: var(--gradient); border-bottom-right-radius: 4px; box-shadow: 0 0 30px rgba(0,217,255,0.25); }

/* ---------- Stats ---------- */
.stats-bar { border-top: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05); background: rgba(17,21,42,0.4); }
.stats-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 32px; padding: 40px 0; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4,1fr); } }
.stat-item { text-align: center; }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 4px; }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section-alt { background: rgba(17,21,42,0.2); }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 60px; }
.section-title h2 { font-size: 32px; font-weight: 800; color: #fff; margin: 0 0 12px; }
.section-title p { color: rgba(255,255,255,0.5); }

.steps-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 768px) { .steps-grid { grid-template-columns: repeat(3,1fr); } }
.step-card { padding: 28px; }
.step-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--gradient); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; box-shadow: 0 0 40px rgba(108,99,255,0.35); }
.step-num { font-size: 12px; color: rgba(255,255,255,0.3); font-family: monospace; }
.step-card h3 { color: #fff; margin: 4px 0 8px; }
.step-card p { color: rgba(255,255,255,0.5); font-size: 14px; line-height: 1.7; margin: 0; }

.features-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px) { .features-grid { grid-template-columns: repeat(3,1fr); } }
.feature-card { padding: 24px; transition: border-color .2s; border: 1px solid transparent; }
.feature-card:hover { border-color: rgba(108,99,255,0.4); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(108,99,255,0.15); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature-card h3 { color: #fff; margin: 0 0 8px; font-size: 16px; }
.feature-card p { color: rgba(255,255,255,0.5); font-size: 14px; line-height: 1.7; margin: 0; }

.pricing-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 50px; }
@media (min-width: 768px) { .pricing-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px) { .pricing-grid { grid-template-columns: repeat(4,1fr); } }
.plan-card { padding: 28px; display: flex; flex-direction: column; }
.plan-card.highlighted { background: var(--gradient); box-shadow: 0 0 40px rgba(108,99,255,0.35); transform: scale(1.05); }
.plan-name { font-weight: 700; font-size: 18px; color: #fff; }
.plan-price { font-size: 28px; font-weight: 800; margin: 16px 0 4px; }
.plan-credits { font-size: 13px; opacity: 0.6; }
.plan-features { list-style: none; padding: 0; margin: 24px 0; flex: 1; }
.plan-features li { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; color: rgba(255,255,255,0.7); }
.plan-card.highlighted .plan-features li { color: rgba(255,255,255,0.9); }

.cta-box { text-align: center; padding: 70px 24px; position: relative; overflow: hidden; }
.cta-box::before { content: ''; position: absolute; inset: 0; background: var(--gradient); opacity: 0.1; }
.cta-box h2 { position: relative; font-size: 30px; font-weight: 800; color: #fff; margin: 0 0 12px; }
.cta-box p { position: relative; color: rgba(255,255,255,0.5); margin: 0 0 28px; }

footer { border-top: 1px solid rgba(255,255,255,0.05); padding: 36px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: rgba(255,255,255,0.4); }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 60px 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 36px; }
.auth-card h1 { text-align: center; color: #fff; font-size: 24px; margin: 24px 0 4px; }
.auth-card .subtitle { text-align: center; color: rgba(255,255,255,0.5); font-size: 14px; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 12px 16px; color: #fff; font-family: inherit; font-size: 14px; outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-footer { text-align: center; font-size: 14px; color: rgba(255,255,255,0.5); margin-top: 20px; }
.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }

/* ---------- Dashboard ---------- */
.dash-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex-shrink: 0; border-left: 1px solid rgba(255,255,255,0.05); background: rgba(17,21,42,0.55); backdrop-filter: blur(24px); padding: 20px; }
.sidebar .logo { padding: 0 8px; margin-bottom: 20px; }
.sidebar-user-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(108,99,255,0.18), rgba(0,217,255,0.1));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 20px;
}
.sidebar-user-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gradient); background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px; flex-shrink: 0;
  box-shadow: 0 0 20px rgba(108,99,255,0.4);
}
.sidebar-user-info p { margin: 0; }
.sidebar-user-info .name { color: #fff; font-size: 13px; font-weight: 700; }
.sidebar-user-info .role { color: rgba(255,255,255,0.45); font-size: 11px; margin-top: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 5px; transition: all .2s cubic-bezier(.16,1,.3,1);
  position: relative;
}
.sidebar-nav a span:first-child {
  width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0;
  transition: transform .25s ease;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,0.06); transform: translateX(-3px); }
.sidebar-nav a:hover span:first-child { transform: scale(1.12) rotate(-6deg); }
.sidebar-nav a.active { background: var(--gradient); color: #fff; box-shadow: 0 8px 24px rgba(108,99,255,0.35); }
.sidebar-nav a.active span:first-child { background: rgba(255,255,255,0.2); }
.dash-main { flex: 1; padding: 40px; }
/* mobile sidebar visibility handled below in the dedicated mobile sidebar block */

.stat-cards { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 32px; }
@media (min-width: 640px) { .stat-cards { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px) { .stat-cards { grid-template-columns: repeat(4,1fr); } }
.stat-card { padding: 22px; }
.stat-card .top { display: flex; align-items: center; justify-content: space-between; }
.stat-card .label { font-size: 13px; color: rgba(255,255,255,0.5); }
.stat-card .icon-box { width: 34px; height: 34px; border-radius: 10px; background: rgba(108,99,255,0.15); display: flex; align-items: center; justify-content: center; }
.stat-card .value { font-size: 28px; font-weight: 800; color: #fff; margin-top: 10px; }
.stat-card .hint { font-size: 12px; color: rgba(255,255,255,0.35); margin-top: 4px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th { text-align: right; color: rgba(255,255,255,0.4); font-weight: 500; padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
table.data-table td { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); color: rgba(255,255,255,0.8); }
table.data-table tr:last-child td { border-bottom: none; }

/* ---------- Wizard ---------- */
.wizard-wrap { max-width: 640px; margin: 0 auto; }
.stepper { display: flex; align-items: center; margin-bottom: 40px; }
.step-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.4); }
.step-dot.done { background: var(--success); color: #fff; }
.step-dot.current { background: var(--gradient); color: #fff; box-shadow: 0 0 20px rgba(108,99,255,0.4); }
.step-line { height: 1px; flex: 1; background: rgba(255,255,255,0.1); margin: 0 8px; }
.step-line.done { background: var(--success); }
.wizard-panel { padding: 32px; min-height: 320px; }
.personality-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.personality-option { text-align: right; padding: 18px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1); background: transparent; cursor: pointer; color: #fff; font-family: inherit; }
.personality-option.selected { border-color: var(--primary); background: rgba(108,99,255,0.1); box-shadow: 0 0 20px rgba(108,99,255,0.2); }
.personality-option strong { display: block; margin-bottom: 4px; }
.personality-option span { font-size: 12px; color: rgba(255,255,255,0.5); }
.wizard-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }

/* ---------- Advanced Animations ---------- */
.reveal-init {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.7s cubic-bezier(.16,1,.3,1), transform 0.7s cubic-bezier(.16,1,.3,1);
}
.reveal-init.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.widget-demo, .step-card, .feature-card, .plan-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(108,99,255,0.25); }
  50% { box-shadow: 0 0 45px rgba(0,217,255,0.4); }
}
.logo-icon { animation: glowPulse 4s ease-in-out infinite; }

.bg-blob {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: var(--gradient);
  opacity: 0.15;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 12s ease-in-out infinite;
}
@keyframes blobFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-40px) scale(1.1); }
  66% { transform: translate(-20px,30px) scale(0.95); }
}
.hero { position: relative; overflow: hidden; }
.hero .container { position: relative; z-index: 1; }

.badge {
  animation: badgePulse 2.4s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 rgba(0,217,255,0); }
  50% { box-shadow: 0 0 16px rgba(0,217,255,0.25); }
}

.btn-gradient {
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.stat-value { display: inline-block; }

.text-gradient {
  background-size: 200% auto;
  animation: gradientShift 6s ease infinite;
}

/* Widget avatar pulse */
.widget-avatar { position: relative; }
.widget-avatar::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(0,217,255,0.4);
  animation: ringPulse 2.5s ease-out infinite;
}
@keyframes ringPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ================= GALAXY THEME ================= */
#galaxy-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}
body {
  background-color: #05060f;
  background-image:
    radial-gradient(circle at 15% 8%, rgba(108,99,255,0.16), transparent 40%),
    radial-gradient(circle at 88% 18%, rgba(0,217,255,0.12), transparent 38%),
    radial-gradient(circle at 60% 85%, rgba(168,85,247,0.14), transparent 42%),
    radial-gradient(circle at 30% 95%, rgba(108,99,255,0.08), transparent 35%);
}
.nebula-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  animation: nebulaDrift 18s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes nebulaDrift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(60px,-80px) scale(1.25); }
  66% { transform: translate(-50px,50px) scale(0.9); }
}

/* Aurora ribbon sweeping across the top of the page */
.aurora-ribbon {
  position: fixed;
  top: -20%;
  left: -10%;
  width: 140%;
  height: 60%;
  background: linear-gradient(100deg, transparent, rgba(108,99,255,0.12), rgba(0,217,255,0.1), rgba(168,85,247,0.12), transparent);
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
  animation: auroraSweep 14s ease-in-out infinite;
}
@keyframes auroraSweep {
  0%, 100% { transform: translateX(-5%) rotate(-3deg); opacity: 0.7; }
  50% { transform: translateX(5%) rotate(2deg); opacity: 1; }
}

/* Animated gradient border for premium cards (hero widget + CTA) */
.glow-border { position: relative; }
.glow-border::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(120deg, var(--primary), var(--aiblue), var(--purple), var(--primary));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: gradientShift 4s linear infinite;
  pointer-events: none;
}

/* ================= RIPPLE CLICK EFFECT ================= */
.btn { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(3); opacity: 0; }
}

/* ================= MOBILE HAMBURGER (marketing nav) - v2 ================= */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.2s;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.12); }
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(.68,-0.55,.27,1.55), opacity 0.25s ease;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-panel {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(108,99,255,0.25), transparent 60%), rgba(5,6,15,0.98);
  backdrop-filter: blur(24px);
  padding: 100px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s ease, visibility 0.4s;
}
.mobile-nav-panel.open { visibility: visible; opacity: 1; }
.mobile-nav-panel a {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  padding: 16px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.2s;
}
.mobile-nav-panel.open a { opacity: 1; transform: translateY(0); }
.mobile-nav-panel.open a:nth-child(1) { transition-delay: 0.05s; }
.mobile-nav-panel.open a:nth-child(2) { transition-delay: 0.1s; }
.mobile-nav-panel.open a:nth-child(3) { transition-delay: 0.15s; }
.mobile-nav-panel.open a:nth-child(4) { transition-delay: 0.2s; }
.mobile-nav-panel.open a:nth-child(5) { transition-delay: 0.25s; }
.mobile-nav-panel.open a:nth-child(6) { transition-delay: 0.3s; }
.mobile-nav-panel a:active { color: var(--aiblue); }
body.nav-open { overflow: hidden; }

@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
  .nav-links { display: none; }
  .header-actions a:not(.btn-gradient):not(.hamburger-btn) { display: none; }
  .hero h1 { font-size: 28px; }
  .hero p.lead { font-size: 15px; }
  .hero-grid { gap: 40px; }
  .section { padding: 56px 0; }
  .section-title h2 { font-size: 23px; }
  .plan-card.highlighted { transform: none; }
  .stats-grid { gap: 20px; padding: 28px 0; }
  .stat-value { font-size: 22px; }
  .personality-grid { grid-template-columns: 1fr; }
}

/* ================= MOBILE SIDEBAR (dashboard/admin) ================= */
@media (max-width: 900px) {
  .dash-main { padding: 20px; padding-top: 76px; }
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 280px;
    max-width: 82vw;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(.16,1,.3,1);
    z-index: 300;
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 250;
  }
  .sidebar-overlay.open { display: block; }
  .mobile-topbar {
    display: flex;
    position: fixed; top: 0; left: 0; right: 0;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(7,10,24,0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 310;
  }
  .stat-cards { grid-template-columns: 1fr !important; }
  table.data-table { font-size: 12px; }
  table.data-table th, table.data-table td { padding: 8px 10px; }
}
@media (min-width: 901px) {
  .mobile-topbar { display: none; }
}

/* ================= UNIVERSAL LOADING OVERLAY ================= */
#global-loading-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(108,99,255,0.15), transparent 60%), rgba(5,6,15,0.94);
  backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
#global-loading-overlay.active { opacity: 1; visibility: visible; }
.loading-orb {
  width: 96px; height: 96px;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--primary), var(--aiblue), var(--purple));
  background-size: 200% 200%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  box-shadow: 0 0 70px rgba(108,99,255,0.55);
  animation: gradientShift 2.5s ease infinite, orbFloat 2.4s ease-in-out infinite, orbSpin 6s linear infinite;
}
@keyframes orbFloat { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-14px) rotate(3deg); } }
@keyframes orbSpin { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(20deg); } }
.loading-text {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  margin-top: 32px;
  animation: textFade 0.4s ease;
}
@keyframes textFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.loading-bar-track { width: 260px; height: 5px; background: rgba(255,255,255,0.1); border-radius: 6px; margin-top: 22px; overflow: hidden; }
.loading-bar-fill { height: 100%; width: 8%; background: linear-gradient(90deg, var(--primary), var(--aiblue)); border-radius: 6px; transition: width 0.5s ease; box-shadow: 0 0 12px rgba(0,217,255,0.6); }

/* ================= EXTRA MOTION POLISH ================= */
.hero h1 .text-gradient, .text-gradient {
  background-size: 200% auto;
  animation: shimmer 3.5s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.glass:hover, .feature-card:hover, .step-card:hover {
  box-shadow: 0 20px 50px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.step-card, .feature-card, .plan-card, .glass {
  transition: transform 0.3s cubic-bezier(.16,1,.3,1), box-shadow 0.3s ease;
}

body { animation: pageFadeIn 0.5s ease; }
@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Section headings get a soft underline sweep */
.section-title h2 {
  position: relative;
  display: inline-block;
}
.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 50%;
  width: 60px; height: 3px;
  background: var(--gradient);
  border-radius: 4px;
  transform: translateX(50%);
  animation: underlineGrow 1.2s ease-out;
}
@keyframes underlineGrow {
  from { width: 0; opacity: 0; }
  to { width: 60px; opacity: 1; }
}

/* Icons get a gentle continuous float/rotate for liveliness */
.step-icon, .feature-icon {
  transition: transform 0.4s cubic-bezier(.16,1,.3,1);
}
.step-card:hover .step-icon, .feature-card:hover .feature-icon {
  transform: scale(1.12) rotate(-6deg);
}

/* Language switcher */
.lang-switch {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; font-size: 12px; font-weight: 700;
  transition: background 0.2s, transform 0.2s;
}
.lang-switch:hover { background: rgba(255,255,255,0.14); transform: scale(1.06); }

/* Continuous smooth hue rotation for extra "alive" galaxy feel */
.nebula-blob { animation: nebulaDrift 18s ease-in-out infinite, hueRotate 20s linear infinite; }
@keyframes hueRotate {
  0% { filter: blur(90px) hue-rotate(0deg); }
  100% { filter: blur(90px) hue-rotate(360deg); }
}
html[dir="ltr"] body { font-family: 'Vazirmatn', 'Segoe UI', sans-serif; }

/* Smooth parallax movement for hero layers */
.hero-grid > div:first-child, .widget-demo-wrap {
  transition: transform 0.15s ease-out;
}
