/* =========================================================
   MOFX.0 — Dark Purplish AI/Command-Center Theme System
   ========================================================= */

:root {
  /* Dark Mode (Default — matched to mofx.0 Instagram PFP) */
  --bg: #090612;
  --bg-elevated: #110c1e;
  --surface: #140e24;
  --surface-hover: #1b1331;
  --code-bg: #07040e;
  --border: rgba(167, 139, 250, 0.16);
  --border-strong: rgba(167, 139, 250, 0.36);
  --text: #f5f3ff;
  --text-secondary: #b9aecf;
  --text-muted: #8478a1;
  --accent: #8b5cf6;
  --accent-bright: #c084fc;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-glow: rgba(139, 92, 246, 0.35);
  --success: #34d399;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-text: #fcd34d;
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ar: "Cairo", "Plus Jakarta Sans", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

[data-theme="light"] {
  --bg: #f8f7fc;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f3effc;
  --code-bg: #120d21;
  --border: rgba(109, 40, 217, 0.14);
  --border-strong: rgba(109, 40, 217, 0.34);
  --text: #140d26;
  --text-secondary: #4c4266;
  --text-muted: #766c91;
  --accent: #7c3aed;
  --accent-bright: #9333ea;
  --accent-soft: rgba(124, 58, 237, 0.1);
  --accent-glow: rgba(124, 58, 237, 0.22);
  --warning-bg: rgba(217, 119, 6, 0.1);
  --warning-text: #b45309;
  --shadow-card: 0 10px 30px rgba(34, 16, 74, 0.07);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

html[dir="rtl"] body {
  font-family: var(--font-ar);
}

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

button, input {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* Ambient Futuristic Background */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.34;
}

[data-theme="light"] .glow-orb {
  opacity: 0.16;
}

.orb-1 {
  width: 560px;
  height: 560px;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
}

.orb-2 {
  width: 420px;
  height: 420px;
  bottom: -160px;
  right: -80px;
  background: radial-gradient(circle, #c084fc 0%, rgba(192, 132, 252, 0) 70%);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(139, 92, 246, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(139, 92, 246, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 35%, transparent 100%);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-badge {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(192, 132, 252, 0.12));
  border: 1px solid var(--border-strong);
  color: var(--accent-bright);
  box-shadow: 0 0 22px var(--accent-glow);
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  direction: ltr;
  unicode-bidi: isolate;
}

.brand-text span {
  color: var(--accent-bright);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-pill, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.control-pill {
  padding-inline: 14px;
  font-size: 0.85rem;
  font-weight: 600;
}

.icon-btn {
  width: 38px;
}

.control-pill:hover, .icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

/* Hero Section */
.hero {
  padding: 68px 0 36px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 12px var(--accent-bright);
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(2.15rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 780px;
}

.gradient-text {
  background: linear-gradient(120deg, var(--accent-bright), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 0 34px;
  max-width: 620px;
  font-size: 1.04rem;
  color: var(--text-secondary);
}

/* Prompt-Style Command Search Bar */
.command-search-wrapper {
  width: 100%;
  max-width: 650px;
  margin-bottom: 22px;
}

.command-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(139, 92, 246, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.command-search:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.34), 0 0 0 4px var(--accent-soft);
}

.search-icon {
  display: grid;
  place-items: center;
  color: var(--accent-bright);
}

.command-search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
}

.command-search input::placeholder {
  color: var(--text-muted);
}

.clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.kbd-hint {
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Category Filter Chips */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 22px var(--accent-glow);
}

/* Tools Section */
.tools-section {
  padding: 28px 0 64px;
}

.section-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.section-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-meta {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.winget-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent-bright);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Tool Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34), 0 0 0 1px var(--accent-soft);
}

.tool-card.featured::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-bright), var(--accent), transparent);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.tool-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tool-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.22), rgba(192, 132, 252, 0.06));
  border: 1px solid var(--border-strong);
  color: var(--accent-bright);
}

.tool-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}

.tool-tagline {
  margin: 3px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badges-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge-featured {
  background: linear-gradient(120deg, var(--accent), var(--accent-bright));
  color: #ffffff;
  border: none;
}

.tool-desc {
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* Inline Command Preview Box (Always LTR!) */
.command-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  direction: ltr;
  text-align: left;
}

.prompt-sign {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  user-select: none;
}

.command-preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #e9e4ff;
}

/* Buttons */
.card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 41px;
  padding-inline: 15px;
  border-radius: 11px;
  font-size: 0.86rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  flex: 1 1 150px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #ffffff;
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.09);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 54px 20px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
}

/* How It Works Section */
.info-section {
  padding: 40px 0 64px;
}

.section-heading-center {
  text-align: center;
  margin-bottom: 32px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent-bright);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-card {
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.step-num {
  display: inline-block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.step-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Safety Section */
.safety-section {
  padding: 10px 0 76px;
}

.safety-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface), color-mix(in srgb, var(--surface) 88%, var(--accent)));
  border: 1px solid var(--border-strong);
}

.safety-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.safety-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  color: var(--accent-bright);
}

.safety-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.safety-header p {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.safety-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.safety-point {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--border);
}

.safety-point h3 {
  margin: 0 0 6px;
  font-size: 0.96rem;
}

.safety-point p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 26px;
  background: color-mix(in srgb, var(--surface) 50%, var(--bg));
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.footer-brand p {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.18s ease;
}

.social-pill:hover {
  color: var(--text);
  border-color: var(--accent-bright);
  background: var(--accent-soft);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Script Inspector Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 12, 0.76);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 8px 0 0;
  font-size: 1.35rem;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-desc {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.admin-note {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 0.84rem;
  font-weight: 600;
}

.code-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.code-actions-inline {
  display: flex;
  gap: 8px;
}

.mini-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mini-btn:hover {
  border-color: var(--border-strong);
}

.mini-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.code-block {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: #e9e4ff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.code-block-tall {
  max-height: 240px;
  overflow-y: auto;
  white-space: pre;
  word-break: normal;
}

.modal-steps-box {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.modal-steps-box h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.modal-steps-box ul {
  margin: 0;
  padding-inline-start: 20px;
  font-size: 0.87rem;
  color: var(--text-secondary);
}

.modal-steps-box li + li {
  margin-top: 5px;
}

.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 100px);
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #161029;
  color: #f5f3ff;
  border: 1px solid var(--accent-bright);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.toast svg {
  color: var(--success);
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 860px) {
  .tools-grid, .steps-grid, .safety-points {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  .hero {
    padding: 46px 0 28px;
  }
  .safety-card {
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .kbd-hint {
    display: none;
  }
  .card-top {
    flex-direction: column;
  }
  .badges-col {
    flex-direction: row;
    align-items: center;
  }
  .modal-head, .modal-body, .modal-foot {
    padding-inline: 16px;
  }
}
