/* ============================================================
   FSDMBot User Guide — style.css
   Dark & Light mode, Glassmorphism, RTL support, Responsive
   ============================================================ */

/* ── DARK THEME TOKENS (Default) ────────────────────────────── */
:root, [data-theme="dark"] {
  --bg:         #060d1a;
  --bg-2:       #0a1628;
  --bg-card:    rgba(255,255,255,0.04);
  --bg-card-h:  rgba(255,255,255,0.07);
  --border:     rgba(255,255,255,0.08);
  --border-h:   rgba(255,255,255,0.18);

  --cyan:       #00f2fe;
  --cyan-dim:   rgba(0,242,254,0.15);
  --cyan-glow:  0 0 32px rgba(0,242,254,0.25);

  --green:      #10b981;
  --green-dim:  rgba(16,185,129,0.15);
  --green-glow: 0 0 24px rgba(16,185,129,0.2);

  --purple:     #a78bfa;
  --purple-dim: rgba(167,139,250,0.15);

  --orange:     #f59e0b;
  --orange-dim: rgba(245,158,11,0.15);

  --text:       #e2e8f0;
  --text-muted: #8899aa;
  --text-dim:   #4a5568;

  --code-bg:    #030814;
  --header-bg:  rgba(6,13,26,0.85);
  --footer-bg:  #030810;

  --radius:     16px;
  --radius-lg:  24px;
  --radius-pill:999px;

  --font-latin: 'Outfit', sans-serif;
  --font-ar:    'Cairo', sans-serif;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
}

/* ── LIGHT THEME TOKENS ─────────────────────────────────────── */
[data-theme="light"] {
  --bg:         #f8fafc;
  --bg-2:       #f1f5f9;
  --bg-card:    #ffffff;
  --bg-card-h:  #ffffff;
  --border:     #e2e8f0;
  --border-h:   #cbd5e1;

  --cyan:       #0284c7;
  --cyan-dim:   rgba(2,132,199,0.1);
  --cyan-glow:  0 4px 20px rgba(2,132,199,0.15);

  --green:      #059669;
  --green-dim:  rgba(5,150,105,0.1);
  --green-glow: 0 4px 20px rgba(5,150,105,0.15);

  --purple:     #7c3aed;
  --purple-dim: rgba(124,58,237,0.1);

  --orange:     #d97706;
  --orange-dim: rgba(217,119,6,0.1);

  --text:       #0f172a;
  --text-muted: #475569;
  --text-dim:   #94a3b8;

  --code-bg:    #e2e8f0;
  --header-bg:  rgba(248,250,252,0.85);
  --footer-bg:  #e2e8f0;

  --shadow-card: 0 4px 20px rgba(0,0,0,0.06);
}

/* ── RESET / BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-latin);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}
/* RTL Arabic */
[lang="ar"] body, [dir="rtl"] {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}
img { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { line-height: 1.25; }
strong { color: var(--text); font-weight: 700; }

/* ── UTILITIES ──────────────────────────────────────────────── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--cyan) 0%, #0284c7 50%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.code-inline {
  font-family: 'Courier New', monospace;
  background: var(--code-bg);
  color: var(--cyan);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.88em;
  font-weight: 700;
  border: 1px solid var(--border);
}

/* ── LANGUAGE & THEME BAR ───────────────────────────────────── */
.lang-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s, border-color 0.3s;
}
.lang-bar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  color: var(--text);
}
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.6; }
}
.bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-switcher {
  display: flex;
  gap: 6px;
}
.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.lang-btn:hover { border-color: var(--border-h); color: var(--text); }
.lang-btn.active {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: var(--cyan);
  font-weight: 700;
}
.theme-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.theme-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: scale(1.05);
}
.theme-btn svg { width: 20px; height: 20px; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s;
  border: none;
  text-decoration: none;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0,242,254,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,242,254,0.45);
  text-decoration: none;
  color: #ffffff;
}
.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--bg-card-h);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}
.btn-download {
  background: linear-gradient(135deg, var(--green), #059669);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(16,185,129,0.3);
  border-radius: var(--radius-pill);
  padding: 14px 28px;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16,185,129,0.5);
  text-decoration: none;
  color: #ffffff;
}
.btn-download svg { width: 20px; height: 20px; }

/* ── HERO ───────────────────────────────────────────────────── */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 110px 24px 70px;
  position: relative;
  overflow: hidden;
  max-width: 1120px;
  margin: 0 auto;
  gap: 60px;
}
.hero-bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,242,254,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,242,254,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}
.hero-content { flex: 1; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0,242,254,0.3);
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
  text-transform: uppercase;
}
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse-dot 1.5s ease-in-out infinite;
}
.hero-title {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 20px;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 500px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  min-width: 260px;
}
.robot-showcase { position: relative; }
.hero-robot-img {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-h);
  box-shadow: var(--cyan-glow), var(--shadow-card);
  transition: transform 0.4s ease;
}
.hero-robot-img:hover { transform: scale(1.02) rotate(-1deg); }
.showcase-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at center, rgba(0,242,254,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero-scroll-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  animation: bounce 2s ease-in-out infinite;
  z-index: 1;
}
.hero-scroll-hint svg { width: 24px; height: 24px; }
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}

/* ── STEPS BAR ──────────────────────────────────────────────── */
.steps-bar {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
  transition: background-color 0.3s;
}
.steps-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.step-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.88rem;
  transition: border-color 0.2s;
}
.step-chip svg { width: 18px; height: 18px; color: var(--cyan); }
.step-chip:hover { border-color: var(--border-h); }
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #0284c7);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-sep { color: var(--text-dim); font-size: 1.3rem; }

/* ── SECTION ────────────────────────────────────────────────── */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-2); transition: background-color 0.3s; }
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 48px;
}
.section-header.centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
[dir="rtl"] .section-header { text-align: right; }
.section-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.section-icon svg { width: 24px; height: 24px; }
.section-icon.cyan   { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid rgba(0,242,254,0.25); }
.section-icon.green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(16,185,129,0.25); }
.section-icon.purple { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(167,139,250,0.25); }
.section-icon.orange { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(245,158,11,0.25); }
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.section-desc { color: var(--text-muted); font-size: 1rem; max-width: 720px; }

/* ── FEATURE CARDS (Academic Assistant) ──────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 768px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-h);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}
.feature-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feature-icon svg { width: 26px; height: 26px; }
.feature-icon.cyan   { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid rgba(0,242,254,0.25); }
.feature-icon.green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(16,185,129,0.25); }
.feature-icon.purple { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(167,139,250,0.25); }
.feature-icon.orange { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(245,158,11,0.25); }

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── FLOW DIAGRAM ────────────────────────────────────────────── */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.flow-node-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--border-h);
  display: flex;
  align-items: center;
  justify-content: center;
}
.flow-node-icon svg { width: 26px; height: 26px; }
.flow-node-label { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.flow-node-sub { font-size: 0.8rem; color: var(--text-muted); }
.flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 600;
}
.flow-arrow svg { width: 44px; height: 20px; }

/* ── WIFI SETUP ─────────────────────────────────────────────── */
.wifi-setup-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 768px) { .wifi-setup-wrapper { grid-template-columns: 1fr; } }

.wifi-config-card, .wifi-steps-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.config-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.config-step-badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--cyan);
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.badge-green {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green);
}
.config-card-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.config-desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 24px; }

.wifi-creds-display { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.cred-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 12px;
}
.cred-label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 6px; }
.cred-example { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 0.95rem; font-weight: 600; }
.cred-icon { width: 18px; height: 18px; color: var(--cyan); flex-shrink: 0; }

.instruction-list {
  list-style: none;
  counter-reset: inst;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.instruction-list li {
  counter-increment: inst;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.93rem;
}
.instruction-list li::before {
  content: counter(inst);
  width: 26px; height: 26px;
  background: var(--bg-2);
  border: 1px solid var(--border-h);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0,242,254,0.25);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.info-note svg { width: 18px; height: 18px; color: var(--cyan); flex-shrink: 0; margin-top: 2px; }
.info-note.warning {
  background: var(--orange-dim);
  border-color: rgba(245,158,11,0.25);
}
.info-note.warning svg { color: var(--orange); }

/* ── IP DISCOVERY SECTION ───────────────────────────────────── */
.ip-methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
}
@media (max-width: 768px) { .ip-methods-grid { grid-template-columns: 1fr; } }

.ip-method-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-card);
}
.ip-method-card.featured {
  border-color: var(--purple);
  box-shadow: 0 4px 24px rgba(167,139,250,0.15);
}
.method-badge {
  position: absolute;
  top: 18px; right: 24px;
  background: var(--purple-dim);
  border: 1px solid var(--purple);
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}
[dir="rtl"] .method-badge { right: auto; left: 24px; }
.method-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--purple-dim);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.method-icon svg { width: 24px; height: 24px; }
.ip-method-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.method-desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 16px; }

.app-suggestions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.app-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
}
.app-pill svg { width: 20px; height: 20px; color: var(--purple); flex-shrink: 0; }
.app-pill-name { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.app-pill-sub { font-size: 0.76rem; color: var(--text-muted); }

.ip-visual-card {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-card));
  border: 1px solid var(--border-h);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}
.ip-visual-label { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 12px; }
.ip-display {
  font-family: 'Courier New', monospace;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.ip-highlight { color: var(--cyan); text-shadow: 0 0 20px rgba(0,242,254,0.4); }
.ip-visual-note { font-size: 0.88rem; color: var(--text-muted); }

/* ── DOWNLOAD APP SECTION ────────────────────────────────────── */
.download-card-wrapper {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 768px) { .download-card-wrapper { grid-template-columns: 1fr; } }

.download-card {
  background: var(--bg-card);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  align-items: center;
  gap: 28px;
  box-shadow: var(--green-glow), var(--shadow-card);
  min-width: 340px;
}
@media (max-width: 480px) { .download-card { flex-direction: column; text-align: center; min-width: 0; } }
.app-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--green), #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}
.app-icon svg { width: 36px; height: 36px; stroke-width: 1.8; }
.app-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.app-name { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.version-badge {
  background: var(--green-dim);
  border: 1px solid rgba(16,185,129,0.35);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
}
.app-meta { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.meta-tag {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.install-steps-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.install-steps-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 18px; }

/* ── CONTROL SECTION ────────────────────────────────────────── */
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 768px) { .control-grid { grid-template-columns: 1fr; } }

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.control-card:hover {
  border-color: var(--border-h);
  box-shadow: var(--shadow-card);
}
.control-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.joystick-icon { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(167,139,250,0.25); }
.voice-icon    { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid rgba(0,242,254,0.25); }
.control-icon svg { width: 40px; height: 40px; }
.control-card h3 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.control-card > p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }

/* D-Pad */
.direction-pad { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dpad-row { display: flex; gap: 6px; }
.dpad-btn {
  width: 46px; height: 46px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: default;
}
.dpad-btn.active { background: var(--purple-dim); border-color: var(--purple); color: var(--purple); font-weight: 700; }
.dpad-btn.stop-btn { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #f87171; }

/* Voice Commands */
.voice-cmds { display: flex; flex-direction: column; gap: 10px; }
.voice-cmd-row { display: flex; gap: 10px; }
.voice-pill {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.voice-pill.stop { border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.05); }
.voice-pill .flag { font-size: 1.4rem; flex-shrink: 0; }
.cmd-word { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.cmd-sub  { font-size: 0.75rem; color: var(--text-muted); }

/* ── GALLERY ────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 600px) { .gallery-grid { grid-template-columns: 1fr; } }
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  aspect-ratio: 4/3;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  color: #fff;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay svg { width: 40px; height: 40px; }

/* ── FAQ ────────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: var(--border-h); }
.faq-q {
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
}
.faq-q::after {
  content: '›';
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: transform 0.25s;
  flex-shrink: 0;
}
.faq-item[open] .faq-q::after { transform: rotate(90deg); color: var(--cyan); }
.faq-q::-webkit-details-marker { display: none; }
.faq-a {
  padding: 0 24px 20px;
  color: var(--text-muted);
  font-size: 0.93rem;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  line-height: 1.7;
}

/* ── QR CODE ────────────────────────────────────────────────── */
.qr-card-wrapper { display: flex; justify-content: center; }
.qr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 40px;
  max-width: 700px;
  width: 100%;
}
@media (max-width: 600px) { .qr-card { flex-direction: column; text-align: center; } }
.qr-img-wrapper {
  flex-shrink: 0;
  width: 180px; height: 180px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.qr-img { width: 100%; height: 100%; object-fit: contain; }
.qr-info { flex: 1; }
.qr-url {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(0,242,254,0.2);
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  word-break: break-all;
}
.qr-info p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  padding: 48px 0;
  transition: background-color 0.3s;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.footer-text { color: var(--text-muted); font-size: 0.87rem; max-width: 520px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.87rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-copy { color: var(--text-dim); font-size: 0.78rem; }

/* ── LIGHTBOX ───────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border: 1px solid var(--border-h);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  width: 52px; height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--green);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 999;
  transition: transform 0.3s, opacity 0.3s;
  opacity: 0;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── RTL OVERRIDES ──────────────────────────────────────────── */
[dir="rtl"] .faq-q::after { content: '‹'; }
[dir="rtl"] .faq-item[open] .faq-q::after { transform: rotate(-90deg); }
[dir="rtl"] .step-sep { transform: scaleX(-1); }
[dir="rtl"] .flow-arrow svg { transform: scaleX(-1); }

/* ── PRINT STYLES ───────────────────────────────────────────── */
@media print {
  /* Hide non-printable layout elements */
  .lang-bar,
  .hero,
  .steps-bar,
  #about,
  #wifi,
  #find-ip,
  #download,
  #control,
  #gallery,
  #help,
  .footer,
  .lightbox,
  .toast,
  .btn,
  button {
    display: none !important;
  }

  /* Force light theme for printing */
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    min-height: auto !important;
  }

  /* Reset section wrapper for print */
  #qrcode {
    padding: 20px 0 !important;
    background: transparent !important;
    display: block !important;
  }

  .qr-card-wrapper {
    display: flex !important;
    justify-content: center !important;
  }

  .qr-card {
    background: #ffffff !important;
    border: 2px solid #0f172a !important;
    border-radius: 16px !important;
    padding: 30px !important;
    max-width: 500px !important;
    width: 100% !important;
    box-shadow: none !important;
    margin: 40px auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    page-break-inside: avoid !important;
  }

  .qr-img-wrapper {
    width: 220px !important;
    height: 220px !important;
    border: 2px solid #0f172a !important;
    border-radius: 12px !important;
    padding: 10px !important;
    margin-bottom: 20px !important;
  }

  .qr-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  .qr-url {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    margin-bottom: 12px !important;
  }

  .qr-info p {
    color: #475569 !important;
    font-size: 0.95rem !important;
  }
}

/* ── RESPONSIVE TWEAKS ──────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { flex-direction: column; text-align: center; padding-top: 110px; }
  .hero-subtitle { margin: 0 auto 36px; }
  .hero-cta { justify-content: center; }
  .section-header:not(.centered) { flex-direction: column; }
}
@media (max-width: 480px) {
  .lang-btn { font-size: 0.72rem; padding: 5px 10px; }
  .section { padding: 60px 0; }
  .flow-diagram { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
}
