/* ========================================
   Pix.Studio Docs - Help Documentation
   Design tokens match app.css
   ======================================== */

:root {
  --color-primary: #1C1917;
  --color-primary-hover: #292524;
  --color-accent: #8B6E5A;
  --color-accent-hover: #6B5344;
  --color-text: #1C1917;
  --color-text-secondary: #57534E;
  --color-text-muted: #A8A29E;
  --color-background: #FFFFFF;
  --color-background-alt: #FAF9F7;
  --color-background-subtle: #F5F3F0;
  --color-border: #E8E4DF;
  --color-info: #3B82F6;
  --color-info-bg: #DBEAFE;
  --color-warning: #F59E0B;
  --color-warning-bg: #FEF3C7;
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --docs-sidebar-width: 240px;
  --docs-content-max: 720px;
  --docs-header-height: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 2px rgba(28,25,23,.04), 0 1px 3px rgba(28,25,23,.06);
  --transition-fast: 120ms cubic-bezier(.4,0,.2,1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background-alt);
  min-height: 100vh;
}

/* ========================================
   Header
   ======================================== */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--docs-header-height);
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.docs-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: 15px;
  min-width: 0;
}

.docs-header-left svg {
  flex-shrink: 0;
}

.docs-header-badge {
  background: var(--color-background-subtle);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
}

.docs-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-back-link {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.docs-back-link:hover {
  background: var(--color-background-subtle);
  color: var(--color-text);
}

.lang-dropdown {
  position: relative;
}

.lang-dropdown > summary {
  list-style: none;
  background: var(--color-background-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.lang-dropdown > summary::-webkit-details-marker { display: none; }
.lang-dropdown > summary::marker { display: none; }
.lang-dropdown[open] > summary { background: var(--color-background-subtle); border-color: var(--color-accent); }

.lang-dropdown > ul {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  list-style: none;
  margin: 0;
  min-width: 130px;
  box-shadow: 0 4px 12px rgba(28,25,23,.15);
  z-index: 200;
}

.langBtn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 400;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-family);
  color: var(--color-text);
  transition: background var(--transition-fast);
}

.langBtn:hover { background: var(--color-background-subtle); }
.langBtn.active { font-weight: 600; }

.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--color-text);
  line-height: 1;
}

/* ========================================
   Layout
   ======================================== */
.docs-layout {
  display: flex;
  min-height: calc(100vh - var(--docs-header-height));
}

/* ========================================
   Sidebar
   ======================================== */
.docs-sidebar {
  width: var(--docs-sidebar-width);
  flex-shrink: 0;
  background: var(--color-background);
  border-right: 1px solid var(--color-border);
  position: sticky;
  top: var(--docs-header-height);
  height: calc(100vh - var(--docs-header-height));
  overflow-y: auto;
  padding: 20px 0;
}

.docs-nav {
  padding: 0 12px;
}

.docs-nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 0 8px;
  margin: 0 0 6px;
}

.docs-nav ul {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.docs-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  line-height: 1.3;
}

.docs-nav a:hover {
  background: var(--color-background-subtle);
  color: var(--color-text);
}

.docs-nav a.active {
  background: var(--color-background-subtle);
  color: var(--color-text);
  font-weight: 600;
}

.docs-nav .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.5;
}

.docs-nav a.active .nav-icon {
  opacity: 1;
}

/* ========================================
   Main Content
   ======================================== */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px;
}

.docs-article {
  max-width: var(--docs-content-max);
  margin: 0 auto;
}

/* ========================================
   Typography
   ======================================== */
.docs-article h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
  line-height: 1.2;
}

.docs-article .page-intro {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin: 0 0 36px;
  line-height: 1.6;
}

.docs-article h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 40px 0 16px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.docs-article h2:first-of-type {
  padding-top: 0;
  border-top: none;
  margin-top: 0;
}

.docs-article p {
  margin: 0 0 16px;
  color: var(--color-text-secondary);
}

.docs-article a {
  color: var(--color-accent);
  text-decoration: none;
}

.docs-article a:hover {
  text-decoration: underline;
}

/* ========================================
   Step Cards
   ======================================== */
.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 32px;
}

.step-card {
  display: flex;
  gap: 16px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px;
}

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

.step-learn-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.step-learn-more:hover {
  text-decoration: underline;
}

/* ========================================
   Tip / Note Boxes
   ======================================== */
.tip-box {
  display: flex;
  gap: 12px;
  background: var(--color-info-bg);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 16px 0;
}

.tip-box-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1.5;
}

.tip-box p {
  margin: 0;
  font-size: 14px;
  color: #1E40AF;
  line-height: 1.5;
}

.tip-box.warning {
  background: var(--color-warning-bg);
  border-color: #FCD34D;
}

.tip-box.warning p {
  color: #92400E;
}

/* ========================================
   Plan Comparison (Subscription page)
   ======================================== */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 0 0 32px;
}

.plan-card {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.plan-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px;
}

.plan-card p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ========================================
   Screenshot Placeholder
   ======================================== */
.screenshot-placeholder {
  background: var(--color-background-subtle);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  margin: 16px 0;
}

.screenshot-placeholder::before {
  content: attr(data-label);
  display: block;
  font-style: italic;
}

/* ========================================
   Diagrams / SVG
   ======================================== */
.docs-diagram {
  margin: 24px 0;
  text-align: center;
}

.docs-diagram img,
.docs-diagram svg {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* ========================================
   Page Navigation (Prev/Next)
   ======================================== */
.docs-page-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.docs-page-nav a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  max-width: 48%;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.docs-page-nav a:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(139,110,90,.1);
}

.docs-page-nav .nav-dir {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.docs-page-nav .prev-link {
  text-align: left;
}

.docs-page-nav .next-link {
  text-align: right;
  margin-left: auto;
}

/* ========================================
   Mobile
   ======================================== */
@media (max-width: 768px) {
  .hamburger-btn {
    display: block;
  }

  .docs-back-link {
    display: none;
  }

  .docs-sidebar {
    position: fixed;
    top: var(--docs-header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--docs-header-height));
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--transition-fast);
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .docs-sidebar.open {
    transform: translateX(0);
  }

  .docs-main {
    padding: 24px 20px;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .docs-page-nav {
    flex-direction: column;
  }

  .docs-page-nav a {
    max-width: 100%;
  }

  .docs-page-nav .next-link {
    margin-left: 0;
  }
}
