/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  --color-bg-deepest:    #0b0a18;
  --color-bg-dark:       #151329;
  --color-bg-page:       #080711;
  --color-accent:        #7657ff;
  --color-accent-hover:  #8b70ff;
  --color-accent-purple: #9668ff;
  --color-accent-blue:   #7657ff;
  --color-accent-cyan:   #22d3ee;
  --color-border:        rgba(148, 129, 255, 0.18);
  --color-text-muted:    #94a3b8;
  --color-text-dim:      #64748b;
  --glow-accent:         0 0 24px rgba(118, 87, 255, 0.28);
  --glow-purple:         0 0 24px rgba(150, 104, 255, 0.28);
  --transition-std:      all 0.3s ease;
}

/* ── Smooth Scroll ─────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    background: var(--color-bg-page);
}
html body.bg-slate-950 { background-color: var(--color-bg-page); }
[id] { scroll-margin-top: 80px; }

/* Global Styles */
* {
    font-family: 'Inter', sans-serif;
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #7657ff; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #7289da; }

/* Placeholder Styling */
::placeholder { color: rgb(219,219,219); opacity: 1; }
:-ms-input-placeholder { color: rgb(219,219,219); }
::-ms-input-placeholder { color: rgb(219,219,219); }

/* ── Focus styles (keyboard navigation) ────────────────────── */
:focus-visible {
  outline: 2px solid #7657ff;
  outline-offset: 3px;
  border-radius: 4px;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 3px;
}

/* Gradient Glow */
.gradient-glow {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 0 30px rgba(118, 87, 255,0.2);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #7657ff 0%, #6340dc 100%);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #947fff 0%, #7758f3 100%);
    box-shadow: 0 0 20px rgba(118, 87, 255,0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(118, 87, 255,0.5);
}

/* Feature Card */
.feature-card {
    background: linear-gradient(135deg, rgba(30,41,59,0.8) 0%, rgba(15,23,42,0.8) 100%);
    border: 1px solid rgba(100,116,139,0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.feature-card:hover {
    border-color: rgba(118, 87, 255,0.4);
    background: linear-gradient(135deg, rgba(30,41,59,1) 0%, rgba(15,23,42,1) 100%);
    box-shadow: 0 0 30px rgba(118, 87, 255,0.1);
    transform: translateY(-5px);
}

/* Stat Card */
.stat-card {
    background: linear-gradient(135deg, rgba(30,41,59,0.6) 0%, rgba(15,23,42,0.6) 100%);
    border: 1px solid rgba(100,116,139,0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: default;
}
.stat-card:hover {
    border-color: rgba(118, 87, 255, 0.35);
    box-shadow: 0 0 24px rgba(118, 87, 255, 0.12);
    transform: translateY(-3px);
}

/* Section Title */
.section-title {
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Step Number */
.step-number {
    background: linear-gradient(135deg, #7657ff 0%, #6340dc 100%);
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 24px; font-weight: bold;
    transition: all 0.3s ease;
}
.step-number:hover,
.step-number:focus-within {
    box-shadow: 0 0 20px rgba(118, 87, 255, 0.5);
    transform: scale(1.08);
}

/* Nav link underline animation */
nav[role="navigation"] > .max-w-7xl a {
    position: relative;
    padding-top: 8px;
    padding-bottom: 8px;
}
nav[role="navigation"] > .max-w-7xl a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #a855f7, #7657ff);
    border-radius: 2px;
    transition: width 0.25s ease;
}
nav[role="navigation"] > .max-w-7xl a:hover::after,
nav[role="navigation"] > .max-w-7xl a[aria-current="page"]::after {
    width: 100%;
}

/* Command Card */
.command-card {
    background: linear-gradient(135deg, rgba(30,41,59,0.6) 0%, rgba(15,23,42,0.6) 100%);
    border: 1px solid rgba(100,116,139,0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.command-card:hover {
    border-color: rgba(118, 87, 255, 0.5);
    box-shadow: 0 0 28px rgba(118, 87, 255, 0.14);
    transform: translateY(-4px);
}

/* Pricing card hover */
.pricing-card {
    transition: all 0.3s ease;
}
.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 40px rgba(118, 87, 255, 0.2);
    border-color: rgba(118, 87, 255, 0.45);
}
.pricing-card.popular:hover {
    box-shadow: 0 0 60px rgba(118, 87, 255, 0.3);
}

.ai-limit-list { display: grid; gap: .75rem; }
.ai-limit-list > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-top: 1px solid var(--color-border);
  padding-top: .75rem;
}
.ai-limit-list dt { color: var(--color-text-muted); font-size: .875rem; }
.ai-limit-list dd { margin: 0; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }

.command-category h2 { max-width: min(100%, 34rem); }
.command-card { min-width: 0; border-radius: 1rem; }
.command-card h3, .command-card code { overflow-wrap: anywhere; }
.command-detail { display: grid; gap: .35rem; min-width: 0; }
.command-detail + .command-detail { margin-top: .7rem; }
.command-detail code {
  display: block;
  max-width: 100%;
  padding: .55rem .7rem;
  color: #c4b5fd;
  background: rgba(5, 4, 14, .75);
  border: 1px solid rgba(148, 129, 255, .16);
  border-radius: .6rem;
  font-size: .82rem;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}
.detail-label { color: var(--color-text-dim); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.permission-label {
  color: #d6ccff;
  background: rgba(118, 87, 255, .12);
  border: 1px solid rgba(148, 129, 255, .2);
  border-radius: 999px;
  padding: .25rem .6rem;
  font-size: .7rem;
  line-height: 1.45;
}
.command-category[hidden], .command-card[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Doc card hover */
.doc-card {
    transition: all 0.3s ease;
}
.doc-card:hover {
    border-color: rgba(118, 87, 255, 0.35);
    box-shadow: 0 0 24px rgba(118, 87, 255, 0.1);
    transform: translateY(-2px);
}

/* Category Badge */
.category-badge {
    background: linear-gradient(135deg, #7657ff 0%, #6340dc 100%);
}

/* Permission Badge */
.permission-badge {
    background: rgba(239,68,68,0.2);
    border: 1px solid rgba(239,68,68,0.5);
}

/* ── Footer link hover ────────────────────────────────────── */
footer a {
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
footer a:hover {
    color: #a5b4fc;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

/* ── Inline code badge ────────────────────────────────────────────────── */
code.ic,
.ic {
  display: inline;
  background: rgba(13,17,23,.9);
  color: #22d3ee;
  font-family: 'Fira Code','Courier New',monospace;
  font-size: .8em;
  padding: .12em .45em;
  border-radius: .3rem;
  border: 1px solid rgba(100,116,139,.28);
  white-space: nowrap;
  vertical-align: baseline;
}

/* ── Sidebar collapse ─────────────────────────────────────────────────── */
.sidebar-wrap {
  transition: width .28s cubic-bezier(.4,0,.2,1), opacity .28s, min-width .28s;
}
.sidebar-wrap.sb-collapsed {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.sb-icon { transition: transform .28s; }
.sb-icon.flipped { transform: rotate(180deg); }

/* ── Footer logo ──────────────────────────────────────────────────────── */
.footer-logo { width:36px; height:36px; flex-shrink:0; }

/* ── Touch targets ────────────────────────────────────────── */
.cat-pill, .faq-q, button, [role="button"] {
  min-height: 44px;
}

/* ── RTL fixes ────────────────────────────────────────────── */
[dir="rtl"] nav[role="navigation"] > .max-w-7xl a::after {
  left: auto;
  right: 0;
}
[dir="rtl"] .step-connector {
  transform: scaleX(-1);
}
[dir="rtl"] footer .grid {
  direction: rtl;
}
[dir="rtl"] .docs-sidebar {
  right: 0;
  left: auto;
  border-right: none;
  border-left: 1px solid var(--color-border);
}

/* ── Nav alignment ────────────────────────────────────────────────────── */
nav .max-w-7xl { align-items: center; }

nav[role="navigation"] > .max-w-7xl {
  width: min(100% - 1.5rem, 80rem);
  margin: .45rem auto 0;
  padding-inline: 1rem;
  border: 1px solid rgba(148, 129, 255, .18);
  border-radius: 999px;
  background: rgba(9, 8, 22, .82);
  box-shadow: 0 12px 40px rgba(3, 2, 12, .35), inset 0 1px rgba(255,255,255,.025);
}

nav[role="navigation"] {
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
}

/* ── Fix nav height on mobile ─────────────────────────────────────────── */
nav .h-16 { height: 4rem; }

/* ── Mobile: hide desktop nav, show hamburger ─────────────────────────── */
@media (max-width: 767px) {
  .hidden.md\:flex { display: none !important; }
  .md\:hidden { display: flex !important; }
  /* Stack grids to single column */
  .grid.md\:grid-cols-2,
  .grid.md\:grid-cols-3,
  .grid.md\:grid-cols-4 {
    grid-template-columns: 1fr !important;
  }
  .grid.sm\:grid-cols-2 { grid-template-columns: 1fr !important; }
  /* Fix padding */
  .pt-32 { padding-top: 6rem !important; }
  .text-5xl, .text-6xl { font-size: 2rem !important; }
  .text-4xl { font-size: 1.6rem !important; }
  /* Docs sidebar hidden on mobile */
  #sb-wrap { display: none !important; }
  /* FAQ pills wrap */
  #cat-pills { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .cat-pill { white-space: nowrap; flex-shrink: 0; }
  /* Tables scroll horizontally */
  .doc-card.overflow-hidden, .overflow-x-auto { overflow-x: auto !important; }
  /* Pricing cards stack */
  .pricing-card { margin-bottom: 1rem; }
  /* Commands grid */
  .command-card { width: 100%; }
  /* Footer brand centered on mobile */
  footer .grid { gap: 1.5rem; }
}

/* ── Tablet ────────────────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  .grid.lg\:grid-cols-3 { grid-template-columns: repeat(2,1fr) !important; }
  #sb-wrap { display: none !important; }
}

/* ── Very small screens ───────────────────────────────────── */
@media (max-width: 360px) {
  .grid-cols-3-hero {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .logo-text {
    display: none;
  }
}

/* ── Fix: ensure sections are properly centered ───────────────────────── */
section > .max-w-7xl,
section > .max-w-5xl,
section > .max-w-4xl,
section > .max-w-3xl {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* ── Mobile fixes ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .docs-layout { flex-direction: column !important; }
  .sidebar-wrap { display: none !important; }
  .doc-content { padding: 0 !important; }
}

.cb { white-space: pre; }


/* ── Shared site chrome and component rhythm ─────────────────────── */
:root {
  --site-accent: #7657ff;
  --site-accent-soft: rgba(118, 87, 255, .18);
  --site-surface: rgba(16, 15, 34, .78);
  --site-surface-border: rgba(148, 129, 255, .18);
}

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 6.25rem; }

nav[role="navigation"] {
  inset-inline: 0;
  padding-inline: .5rem;
  background: transparent !important;
  border-color: transparent !important;
  backdrop-filter: none !important;
}
nav[role="navigation"] > .max-w-7xl {
  width: min(100%, 88rem);
  margin: .45rem auto 0;
  padding-inline: clamp(.75rem, 2vw, 1.25rem);
  border: 1px solid var(--site-surface-border);
  border-radius: 999px;
  background: rgba(8, 7, 17, .98);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 12px 40px rgba(3, 2, 12, .35), inset 0 1px rgba(255,255,255,.025);
}
nav[role="navigation"] > .max-w-7xl > .flex.justify-between.items-center.h-16 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  column-gap: clamp(.75rem, 2vw, 2rem);
}
nav[role="navigation"] > .max-w-7xl > .flex.justify-between.items-center.h-16 > :first-child {
  justify-self: start;
  min-width: max-content;
}
nav[role="navigation"] > .max-w-7xl > .flex.justify-between.items-center.h-16 > :nth-child(2) {
  justify-self: center;
  gap: clamp(.5rem, 1vw, .875rem);
  white-space: nowrap;
}
nav[role="navigation"] > .max-w-7xl > .flex.justify-between.items-center.h-16 > :nth-child(3) {
  justify-self: end;
}
nav[role="navigation"] .logo-text {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}
nav[role="navigation"] .gradient-text-purple {
  background: linear-gradient(110deg, #c4b5fd, #60a5fa);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
nav[role="navigation"] a[aria-current="page"] {
  color: #fff !important;
}
nav[role="navigation"] #mobile-menu {
  width: 100%;
}
nav[role="navigation"] #mobile-menu > div {
  border-top: 1px solid var(--site-surface-border);
}
nav[role="navigation"] .mobile-menu-links {
  display: grid;
  gap: .2rem;
  padding: .75rem .25rem 1rem;
}
nav[role="navigation"] .mobile-language { padding: .25rem .5rem .5rem; }
nav[role="navigation"] .nav-actions { gap: .65rem; white-space: nowrap; }
nav[role="navigation"] .nav-actions > a { flex: 0 0 auto; white-space: nowrap; }
nav[role="navigation"] .nav-actions .language-picker { flex: 0 0 auto; }

/* The picker has one measured control size and one shared menu position. */
.lang-switcher { display: flex; align-items: center; min-width: 0; }
.language-picker { position: relative; display: inline-flex; align-items: center; }
.ls-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: .5rem;
  width: 10.25rem;
  min-height: 2.75rem;
  flex: 0 0 auto;
  padding: .375rem .7rem;
  border: 1px solid rgba(100,116,139,.26);
  border-radius: .75rem;
  background: rgba(15,23,42,.82);
  color: #e2e8f0;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.ls-btn:hover, .ls-btn[aria-expanded="true"] {
  border-color: rgba(148,129,255,.55);
  background: rgba(21,19,41,.96);
  box-shadow: 0 0 0 3px rgba(118,87,255,.1);
}
.ls-globe { width: 1rem; height: 1rem; flex: 0 0 auto; color: #a78bfa; }
.ls-name {
  flex: 1 1 auto;
  overflow: hidden;
  color: #e2e8f0;
  font-size: .8125rem;
  font-weight: 600;
  text-align: start;
  text-overflow: ellipsis;
}
.ls-chevron { width: .75rem; height: .75rem; flex: 0 0 auto; color: #94a3b8; transition: transform .2s ease; }
.ls-btn[aria-expanded="true"] .ls-chevron { transform: rotate(180deg); }
.ls-menu {
  position: absolute;
  z-index: 9999;
  inset-inline-end: 0;
  top: calc(100% + .5rem);
  display: none;
  min-width: 10.25rem;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--site-surface-border);
  border-radius: .85rem;
  background: #0d0b1b;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
.ls-menu.is-open { display: flex; }
.ls-option {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 1rem;
  align-items: center;
  gap: .6rem;
  width: 100%;
  min-height: 3.25rem;
  padding: .55rem .8rem;
  border: 0;
  border-bottom: 1px solid rgba(148,129,255,.08);
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
  text-align: start;
  transition: background-color .15s ease;
}
.ls-option:hover, .ls-option.is-current { background: rgba(118,87,255,.16); }
.ls-option-code {
  display: inline-grid;
  min-width: 1.9rem;
  min-height: 1.5rem;
  place-items: center;
  border-radius: .4rem;
  background: rgba(118,87,255,.16);
  color: #c4b5fd;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.ls-option-name { min-width: 0; font-size: .8125rem; font-weight: 600; }
.ls-option-check { width: 1rem; height: 1rem; color: #a78bfa; opacity: 0; }
.ls-option.is-current .ls-option-check { opacity: 1; }

/* Shared card treatment keeps repeated surfaces visually related. */
.feature-card, .stat-card, .command-card, .pricing-card, .doc-card, .data-card, .faq-item {
  border: 1px solid var(--site-surface-border) !important;
  border-radius: 1rem !important;
  background: linear-gradient(145deg, rgba(28,26,54,.78), rgba(13,12,27,.86)) !important;
  backdrop-filter: blur(12px);
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease, background-color .22s ease;
}
.feature-card:hover, .stat-card:hover, .command-card:hover, .pricing-card:hover,
.doc-card:hover, .data-card:hover, .faq-item:hover {
  border-color: rgba(148,129,255,.42) !important;
  box-shadow: 0 12px 32px rgba(5,3,20,.28), 0 0 22px rgba(118,87,255,.1);
}
.pricing-card.popular { border-color: rgba(118,87,255,.58) !important; }

@media (max-width: 1279px) {
  nav[role="navigation"] > .max-w-7xl > .flex.justify-between.items-center.h-16 {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  nav[role="navigation"] .nav-links,
  nav[role="navigation"] .nav-actions { display: none !important; }
  nav[role="navigation"] .lg\:hidden { display: flex !important; }
  .lang-switcher { justify-content: flex-start; }
  .language-picker, .ls-btn { max-width: 100%; }
}
@media (max-width: 380px) {
  .ls-btn { width: 9.5rem; }
}
