@font-face {
  font-family: 'Pahari';
  src: url('../fonts/Pahari.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Chitka3';
  src: url('../fonts/CHITKA3.TTF') format('truetype');
}

@font-face {
  font-family: 'Pothowar';
  src: url('../fonts/POTHOWAR.TTF') format('truetype');
}

@font-face {
  font-family: 'PunjabiNaskh';
  src: url('../fonts/punjabi-naskh-final.ttf') format('truetype');
}

:root {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-light: #93c5fd;
  --bg-dark: #0f172a;
  --bg-dark-2: #1e293b;
  --bg-dark-3: #334155;
  --text: #1e293b;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --purple: #8b5cf6;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', 'Noto Sans', 'Noto Sans Devanagari', 'Noto Nastaliq Urdu', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ─── Nav ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  cursor: pointer;
  text-decoration: none;
}

.nav-brand:hover { text-decoration: none; }

.nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: none;
}

.nav-links a:hover { color: #fff; text-decoration: none; }

.nav-auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1002;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(12px);
  padding: 16px 24px 24px;
  z-index: 999;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}
.mobile-menu.open { display: flex; transform: translateY(0); opacity: 1; }
.mobile-menu a {
  color: #cbd5e1;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
}
.mobile-menu a:hover { color: #fff; text-decoration: none; }
.mobile-menu-lang { padding: 12px 0; }
.mobile-menu-lang .lang-select {
  padding: 10px 12px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  font-size: 14px;
}
.mobile-menu-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(59,130,246,0.4); transform: translateY(-1px); }

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost {
  background: transparent;
  color: #cbd5e1;
  padding: 8px 16px;
}
.btn-ghost:hover { color: #fff; }

.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 10px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

/* ─── Hero ─── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 140px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(59,130,246,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 50%;
  height: 160%;
  background: radial-gradient(ellipse, rgba(139,92,246,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 20px;
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 18px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.hero-stat {
  text-align: left;
}

.hero-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}

.hero-stat-label {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

/* Hero demo */
.hero-demo {
  position: relative;
}

.demo-window {
  background: #1e293b;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

.demo-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.demo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.demo-dot-red { background: #ef4444; }
.demo-dot-yellow { background: #f59e0b; }
.demo-dot-green { background: #22c55e; }

.demo-body {
  padding: 24px;
  min-height: 280px;
}

.demo-text {
  font-size: 16px;
  line-height: 1.8;
  color: #cbd5e1;
  font-family: 'Inter', sans-serif;
}

.demo-error {
  text-decoration: underline wavy #ef4444;
  text-underline-offset: 4px;
  cursor: pointer;
  position: relative;
}

.demo-correction {
  display: inline-block;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 500;
}

.demo-panel {
  margin-top: 16px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 10px;
  padding: 14px;
}

.demo-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.demo-panel-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #3b82f6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.demo-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #93c5fd;
}

.demo-panel-issue {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: #94a3b8;
}

.demo-panel-issue del {
  color: #ef4444;
}

.demo-panel-issue strong {
  color: #4ade80;
}

.demo-score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.demo-score-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.demo-score-fill {
  height: 100%;
  width: 78%;
  background: linear-gradient(90deg, #f59e0b, #22c55e);
  border-radius: 3px;
}

.demo-score-value {
  font-size: 14px;
  font-weight: 700;
  color: #4ade80;
}

/* ─── Features ─── */
.features {
  padding: 100px 0;
  background: #fff;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #eff6ff;
  border-radius: 20px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
  color: var(--text);
}

.section-header p {
  font-size: 18px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s;
  background: #fff;
}

.feature-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

/* ─── Languages ─── */
.languages {
  padding: 100px 0;
  background: var(--bg-dark);
  color: #fff;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 40px;
}

.lang-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  transition: all 0.2s;
}

.lang-card:hover {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.3);
}

.lang-flag {
  font-size: 22px;
}

.lang-name {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
}

/* ─── How It Works ─── */
.how-it-works {
  padding: 100px 0;
  background: #f8fafc;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.step {
  text-align: center;
  position: relative;
}

.step::after {
  content: '';
  position: absolute;
  top: 32px;
  right: -16px;
  width: 32px;
  height: 2px;
  background: var(--border);
}

.step:last-child::after { display: none; }

.step-number {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  margin: 0 auto 16px;
}

.step h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

/* ─── Tutorials ─── */
.tutorials {
  padding: 100px 0;
  background: #fff;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.tutorial-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.3s;
}

.tutorial-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.tutorial-thumb {
  height: 180px;
  background: linear-gradient(135deg, #1e293b, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.tutorial-body {
  padding: 20px;
}

.tutorial-tag {
  display: inline-block;
  padding: 3px 10px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tutorial-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tutorial-card p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

/* ─── Pricing ─── */
.pricing {
  padding: 100px 0;
  background: #f8fafc;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 800px;
  margin: 48px auto 0;
}

.price-card {
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #fff;
  position: relative;
}

.price-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1), var(--shadow-lg);
}

.price-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.price-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.price-amount {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -2px;
}

.price-amount span {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0;
}

.price-period {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.price-features {
  list-style: none;
  margin-bottom: 32px;
}

.price-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text);
}

.price-features li::before {
  content: '\2713';
  color: var(--success);
  font-weight: 700;
  font-size: 16px;
}

.price-card .btn {
  width: 100%;
  justify-content: center;
}

/* ─── CTA ─── */
.cta {
  padding: 100px 0;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  text-align: center;
  color: #fff;
}

.cta h2 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.cta p {
  font-size: 18px;
  color: #94a3b8;
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ─── Footer ─── */
.footer {
  background: #0f172a;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 48px 0 24px;
  color: #64748b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 14px;
  line-height: 1.6;
  max-width: 300px;
}

.footer h4 {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 8px;
}

.footer ul a {
  color: #64748b;
  font-size: 14px;
  transition: color 0.2s;
  text-decoration: none;
}

.footer ul a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
}

/* ─── Dashboard ─── */
.dashboard {
  padding-top: 80px;
  min-height: 100vh;
  background: #f8fafc;
}

.dash-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 80px);
}

.dash-sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 24px 0;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.dash-nav-item:hover { background: #f1f5f9; color: var(--text); }
.dash-nav-item.active { background: #eff6ff; color: var(--primary); font-weight: 600; }

.dash-content {
  padding: 32px;
  position: relative;
}

.dash-header {
  margin-bottom: 32px;
}

.dash-header h2 {
  font-size: 24px;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.card-body { padding: 20px; }

/* ─── Auth Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
}

.modal-body { padding: 24px 28px; }

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.api-key-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  word-break: break-all;
}

/* ─── Toast ─── */
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease-out;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Chatbot ─── */
#ord-chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  font-family: 'Inter', sans-serif;
}

.chatbot-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(59,130,246,0.4);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(59,130,246,0.5);
}

.chatbot-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatbot-slide 0.25s ease-out;
}

.chatbot-window.hidden { display: none; }

@keyframes chatbot-slide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-header {
  background: linear-gradient(135deg, #1e293b, #334155);
  padding: 16px 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.chatbot-header h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.chatbot-header p {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
}

.chatbot-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.chatbot-close:hover { color: #fff; }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 340px;
  min-height: 200px;
}

.chatbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chatbot-msg.bot {
  background: #f1f5f9;
  color: #334155;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chatbot-msg.typing {
  background: #f1f5f9;
  color: #94a3b8;
  font-style: italic;
}

.chatbot-input-area {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
}

.chatbot-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.chatbot-input-area input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.chatbot-input-area button {
  padding: 10px 16px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.chatbot-input-area button:hover {
  background: #2563eb;
}

.pahari-text {
  font-family: 'Pahari', 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  direction: rtl;
}

/* ─── Language Switcher ─── */
.nav-lang-switcher {
  margin-right: 8px;
}

.lang-select {
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: auto;
}

.lang-select:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.lang-select option {
  background: #1e293b;
  color: #fff;
}

/* ─── Download Section ─── */
.download-section {
  padding: 80px 0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.download-card {
  max-width: 560px;
  margin: 0 auto;
}

.download-card-inner {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

/* ─── Admin Table ─── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

/* ─── Writer / Editor ─── */
.writer-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  min-height: calc(100vh - 160px);
}

.writer-main {
  position: relative;
  display: flex;
  flex-direction: column;
}

.editor-area {
  flex: 1;
  min-height: 400px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  outline: none;
  overflow-y: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.editor-area:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.editor-area:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

/* Error underlines */
.ord-error {
  cursor: pointer;
  position: relative;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.ord-error-grammar {
  text-decoration: underline wavy #ef4444;
}

.ord-error-spelling {
  text-decoration: underline wavy #3b82f6;
}

.ord-error-style {
  text-decoration: underline dotted #10b981;
}

.ord-error:hover {
  background: rgba(59,130,246,0.06);
  border-radius: 2px;
}

/* Editor toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  gap: 12px;
  flex-wrap: wrap;
}

.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-tone-group {
  display: flex;
  gap: 4px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.editor-tone-btn {
  background: #f1f5f9 !important;
  color: var(--text-light) !important;
  border: 1px solid var(--border) !important;
  font-size: 12px !important;
  padding: 4px 10px !important;
}

.editor-tone-btn:hover {
  background: #e2e8f0 !important;
  color: var(--text) !important;
}

.editor-autocheck-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
}

.editor-autocheck-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Writer sidebar */
.writer-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.writing-score-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.writing-score {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.writing-score .score-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.score-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  z-index: 1;
  line-height: 1;
}

.score-label {
  font-size: 12px;
  color: var(--text-muted);
  z-index: 1;
  margin-top: 2px;
}

.writer-status {
  min-height: 0;
}

.writer-errors {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.error-count-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text);
}

.error-count-row:not(:last-child) {
  border-bottom: 1px solid #f1f5f9;
}

.error-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.error-dot-grammar { background: #ef4444; }
.error-dot-spelling { background: #3b82f6; }
.error-dot-style { background: #10b981; }

.error-count {
  margin-left: auto;
  font-weight: 700;
  font-size: 15px;
}

.writer-meta {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-light);
  padding: 4px 0;
}

.meta-row span:last-child {
  font-weight: 600;
  color: var(--text);
}

.writer-lang-select {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.writer-lang-select label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.writer-lang-select select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
}

.writer-lang-select select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Suggestion popup */
.ord-suggestion-popup,
.ord-rephrase-popup {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  max-width: 320px;
  min-width: 240px;
  z-index: 1000;
  overflow: hidden;
  animation: popup-in 0.15s ease-out;
}

.ord-suggestion-popup.hidden,
.ord-rephrase-popup.hidden {
  display: none;
}

@keyframes popup-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.suggestion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.suggestion-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.suggestion-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

.suggestion-close:hover { color: var(--text); }

.suggestion-body {
  padding: 14px;
}

.suggestion-original {
  font-size: 14px;
  color: #ef4444;
  margin-bottom: 8px;
}

.suggestion-original del {
  text-decoration: line-through;
}

.suggestion-fix {
  font-size: 14px;
  font-weight: 600;
  color: #22c55e;
  padding: 6px 10px;
  background: #f0fdf4;
  border-radius: 6px;
  margin-bottom: 8px;
}

.suggestion-explanation {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.suggestion-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}

/* Checking spinner */
.checking-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #bfdbfe;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .hero-demo { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step::after { display: none; }
  .tutorial-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-lang-switcher { display: none; }
  .nav-auth { display: none; }
  .nav-hamburger { display: flex; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .download-card-inner { padding: 32px 24px; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .lang-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .writer-layout { grid-template-columns: 1fr; }
  .editor-area { min-height: 250px; padding: 20px; }
  .editor-tone-group { border-left: none; padding-left: 0; margin-left: 0; }
}
