/* March7th UI Documentation Styles */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--m7-page-bg);
  color: var(--m7-text);
  line-height: 1.6;
  overflow: hidden;
}

.docs-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.docs-sidebar {
  width: 280px;
  background: var(--m7-card-bg);
  border-right: 1px solid var(--m7-line-divider);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.docs-sidebar__header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--m7-line-divider);
}

.docs-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--m7-primary);
  margin: 0;
}

.docs-version {
  font-size: 0.875rem;
  color: var(--m7-text-muted);
  margin-top: 0.25rem;
}

.docs-sidebar__search {
  padding: 1rem;
  border-bottom: 1px solid var(--m7-line-divider);
}

#search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--m7-line-divider);
  border-radius: 0.5rem;
  background: var(--m7-surface-base, var(--m7-card-bg));
  color: var(--m7-text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 150ms ease;
}

#search-input:focus {
  border-color: var(--m7-primary);
  box-shadow: 0 0 0 3px rgba(91, 143, 239, 0.12);
}

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

.docs-nav__group {
  margin-bottom: 1rem;
}

.docs-nav__group-title {
  padding: 0.5rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--m7-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-nav__link {
  display: block;
  padding: 0.4rem 1rem;
  color: var(--m7-text-regular);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 150ms ease;
  border-left: 2px solid transparent;
}

.docs-nav__link:hover {
  background: var(--m7-btn-card-bg-hover);
  color: var(--m7-primary);
}

.docs-nav__link.active {
  background: var(--m7-btn-regular-bg);
  color: var(--m7-primary);
  border-left-color: var(--m7-primary);
  font-weight: 500;
}

.docs-nav::-webkit-scrollbar { width: 5px; }
.docs-nav::-webkit-scrollbar-track { background: transparent; }
.docs-nav::-webkit-scrollbar-thumb {
  background: var(--m7-scrollbar-bg);
  border-radius: 3px;
}

/* ===== Main Content ===== */
.docs-main {
  flex: 1;
  overflow-y: auto;
  background: var(--m7-page-bg);
}

.docs-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* ===== Typography ===== */
.docs-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--m7-text-strong);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.docs-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--m7-text-strong);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--m7-line-divider);
}

.docs-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--m7-text-strong);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.docs-content p {
  margin-bottom: 1rem;
  color: var(--m7-text-regular);
}

.docs-content ul,
.docs-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--m7-text-regular);
}

.docs-content li {
  margin-bottom: 0.375rem;
}

.docs-content code {
  background: var(--m7-inline-code-bg);
  color: var(--m7-inline-code-color);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'Courier New', Courier, monospace;
}

.docs-content pre {
  background: var(--m7-codeblock-bg);
  color: #e5e7eb;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.docs-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* ===== Home Page ===== */
.docs-home {
  text-align: center;
  padding: 3rem 0;
}

.docs-home__title {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--m7-primary), oklch(0.72 0.12 285));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.docs-home__subtitle {
  font-size: 1.25rem;
  color: var(--m7-text-muted);
  margin-bottom: 3rem;
}

.docs-home__features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
  text-align: left;
}

.docs-feature {
  background: var(--m7-card-bg);
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--m7-line-divider);
  transition: all 200ms ease;
}

.docs-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--m7-shadow-lg);
  border-color: var(--m7-primary);
}

.docs-feature__icon { font-size: 2rem; margin-bottom: 0.75rem; }
.docs-feature__title { font-size: 1.125rem; font-weight: 600; color: var(--m7-text-strong); margin-bottom: 0.5rem; }
.docs-feature__desc { font-size: 0.875rem; color: var(--m7-text-muted); line-height: 1.6; }

/* ===== Demo Box ===== */
.demo-box {
  background: var(--m7-card-bg);
  border: 1px solid var(--m7-line-divider);
  border-radius: 0.75rem;
  overflow: visible;
  margin-bottom: 1.5rem;
  position: relative;
}

.demo-box__preview {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--m7-line-divider);
  background: var(--m7-btn-regular-bg);
  border-radius: 0.75rem 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.demo-box__code { position: relative; }

.demo-box__code-copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 0.3rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, color 150ms ease;
  z-index: 1;
}

.demo-box__code-copy:hover {
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.9);
}

.demo-box__code-copy svg {
  display: block;
  pointer-events: none;
}

.demo-box__code pre {
  margin: 0;
  border-radius: 0;
  padding-right: 2.5rem;
}

/* ===== API Table ===== */
.api-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  background: var(--m7-card-bg);
  border: 1px solid var(--m7-line-divider);
  border-radius: 0.5rem;
  overflow: hidden;
}

.api-table thead { background: var(--m7-btn-regular-bg); }

.api-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--m7-text-strong);
  border-bottom: 1px solid var(--m7-line-divider);
}

.api-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--m7-text-regular);
  border-bottom: 1px solid var(--m7-line-divider);
}

.api-table tbody tr:last-child td { border-bottom: none; }
.api-table tbody tr:hover { background: var(--m7-btn-card-bg-hover); }
.api-table code { font-size: 0.8125rem; }

.type-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: var(--m7-btn-regular-bg);
  color: var(--m7-btn-content);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Courier New', Courier, monospace;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body { overflow: auto; }
  .docs-container { flex-direction: column; height: auto; }
  .docs-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--m7-line-divider);
  }
  .docs-content { padding: 1.5rem 1rem; }
  .docs-home__title { font-size: 2.5rem; }
  .docs-home__features { grid-template-columns: 1fr; }
  .api-table th, .api-table td { padding: 0.5rem 0.75rem; }
}

.docs-main::-webkit-scrollbar { width: 8px; }
.docs-main::-webkit-scrollbar-track { background: var(--m7-page-bg); }
.docs-main::-webkit-scrollbar-thumb { background: var(--m7-scrollbar-bg); border-radius: 4px; }
.docs-main::-webkit-scrollbar-thumb:hover { background: var(--m7-scrollbar-bg-hover); }
