/* SimpleSum API Documentation Styles */

/* ===== CSS Variables ===== */
:root {
  /* Colors - Light Mode */
  --color-bg: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-code: #f1f5f9;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  /* Brand Colors */
  --color-primary: #B31F60;
  --color-primary-light: #d4326f;
  --color-secondary: #F05A29;
  --color-accent: #DE304C;

  /* Gradient */
  --gradient-brand: linear-gradient(135deg, #B31F60 0%, #F05A29 50%, #DE304C 100%);

  /* Sidebar */
  --sidebar-width: 280px;
  --sidebar-bg: #f8fafc;
  --sidebar-border: #e2e8f0;

  /* Code */
  --code-bg: #1e293b;
  --code-text: #e2e8f0;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* Dark Mode */
[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-code: #334155;
  --color-text: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-border: #334155;
  --color-border-light: #1e293b;
  --sidebar-bg: #1e293b;
  --sidebar-border: #334155;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Layout ===== */
.docs-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
}

.sidebar-logo img {
  width: 36px;
  height: 36px;
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
}

.sidebar-logo-badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  background: var(--gradient-brand);
  color: white;
  border-radius: 9999px;
  margin-left: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 600;
}

.logo:hover {
  text-decoration: none;
  color: var(--color-text);
}

.logo img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 0 1.5rem 0 calc(1.5rem + 3px);
  margin-bottom: 0.5rem;
}

.nav-links {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.nav-link.active {
  color: var(--color-primary);
  background: rgba(179, 31, 96, 0.08);
  border-left-color: var(--color-primary);
  font-weight: 500;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-link-children {
  list-style: none;
  margin-left: 2.5rem;
}

.nav-link-child {
  display: block;
  padding: 0.375rem 1.5rem 0.375rem calc(1.5rem + 3px + 1rem);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color var(--transition-fast);
}

.nav-link-child:hover,
.nav-link-child.active {
  color: var(--color-primary);
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sidebar-border);
}

.theme-toggle {
  display: flex;
  align-items: center;
  padding: 0.25rem;
  background: var(--color-bg);
  border-radius: 9999px;
  border: 1px solid var(--color-border);
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 9999px;
  transition: all var(--transition-fast);
}

.theme-btn:hover {
  color: var(--color-text);
}

.theme-btn.active {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 1px 3px rgba(179, 31, 96, 0.3);
}

.theme-btn svg {
  width: 14px;
  height: 14px;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  padding: 2.5rem 3rem;
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.content-header {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 101;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.breadcrumbs a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs span {
  color: var(--color-text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.version-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  border-radius: 9999px;
  border: 1px solid var(--color-border);
}

.content-body {
  padding: 2rem;
  max-width: 900px;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.75rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

h3 {
  font-size: 1.375rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.125rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

.lead {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* ===== Code Blocks ===== */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

:not(pre) > code {
  padding: 0.125rem 0.375rem;
  background: var(--color-bg-code);
  border-radius: 0.25rem;
  color: var(--color-primary);
}

pre {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--code-bg);
  border-radius: 0.75rem;
  overflow-x: auto;
}

pre code {
  color: var(--code-text);
  font-size: 0.875rem;
  line-height: 1.7;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.75rem 0.75rem 0 0;
  margin: -1.25rem -1.25rem 1rem -1.25rem;
}

.code-lang {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 0.375rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.copy-btn.copied {
  background: #22c55e;
  color: white;
}

/* ===== Cards & Boxes ===== */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.feature-card {
  padding: 1.5rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  transition: all var(--transition-fast);
}

.feature-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.feature-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: 0.75rem;
  color: white;
  margin-bottom: 1rem;
}

.feature-card h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.feature-card p {
  margin-bottom: 0;
  font-size: 0.9375rem;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.card p {
  margin-bottom: 0;
  font-size: 0.9375rem;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: 0.75rem;
  color: white;
  margin-bottom: 1rem;
}

.card-link {
  display: block;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.card-link:hover {
  text-decoration: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-link h3 {
  color: var(--color-text);
}

.card-link p {
  color: var(--color-text-secondary);
}

/* ===== Hero Section ===== */
.hero {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* ===== Alerts ===== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 0.75rem;
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.alert-danger,
.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th, td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-bg-secondary);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--color-bg-secondary);
}

/* ===== HTTP Method Badges ===== */
.method {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  border-radius: 0.25rem;
  text-transform: uppercase;
}

.method-get { background: #dcfce7; color: #166534; }
.method-post { background: #dbeafe; color: #1e40af; }
.method-put { background: #fef3c7; color: #92400e; }
.method-patch { background: #fae8ff; color: #86198f; }
.method-delete { background: #fee2e2; color: #991b1b; }

[data-theme="dark"] .method-get { background: rgba(34, 197, 94, 0.2); color: #86efac; }
[data-theme="dark"] .method-post { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
[data-theme="dark"] .method-put { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
[data-theme="dark"] .method-patch { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
[data-theme="dark"] .method-delete { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

/* ===== Endpoint Cards ===== */
.endpoint {
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.endpoint-header:hover {
  background: var(--color-bg-code);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--color-text);
  flex: 1;
}

.endpoint-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.endpoint-toggle {
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
}

.endpoint.open .endpoint-toggle {
  transform: rotate(180deg);
}

.endpoint-body {
  display: none;
  padding: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.endpoint.open .endpoint-body {
  display: block;
}

/* ===== Tabs ===== */
.tabs {
  margin: 1.5rem 0;
}

.tabs-nav,
.tabs-header {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--color-text);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== Lists ===== */
ul, ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  text-decoration: none;
  color: white;
}

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

.btn-secondary:hover {
  background: var(--color-bg-code);
  text-decoration: none;
}

/* ===== Quick Start Steps ===== */
.steps {
  margin: 2rem 0;
}

.step {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.step:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.step-number {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 9999px;
}

.step-content {
  flex: 1;
  padding-top: 0.25rem;
}

.step-content h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.step-content p {
  margin-bottom: 0;
}

/* ===== Mobile Styles ===== */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
    padding-top: 4.5rem;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .sidebar-overlay.open {
    display: block;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 1.5rem;
    padding-top: 4.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.375rem;
  }

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

  .endpoint-header {
    flex-wrap: wrap;
  }

  .endpoint-desc {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ===== Prism.js Theme Override ===== */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6b7280;
}

.token.punctuation {
  color: #9ca3af;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #f472b6;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #a7f3d0;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #fcd34d;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #93c5fd;
}

.token.function,
.token.class-name {
  color: #c4b5fd;
}

.token.regex,
.token.important,
.token.variable {
  color: #fca5a5;
}

/* ===== Anchor Links ===== */
h2[id], h3[id], h4[id] {
  scroll-margin-top: 5rem;
}

.anchor-link {
  opacity: 0;
  margin-left: 0.5rem;
  color: var(--color-text-muted);
  transition: opacity var(--transition-fast);
}

h2:hover .anchor-link,
h3:hover .anchor-link,
h4:hover .anchor-link {
  opacity: 1;
}

.anchor-link:hover {
  color: var(--color-primary);
}
