/* Global Variables */
:root {
--primary-color: #3b82f6;
--primary-hover: #2563eb;
--sidebar-bg: #f8fafc;
--sidebar-border: #e2e8f0;
--text-primary: #1e293b;
--text-secondary: #64748b;
--page-bg: #ffffff;
--surface-bg: #ffffff;
--surface-elevated: #ffffff;
--code-bg: #f1f5f9;
--success-bg: #ecfdf5;
--success-border: #10b981;
--info-bg: #eff6ff;
--info-border: #3b82f6;
--warning-bg: #fef3c7;
--warning-border: #f59e0b;
--header-height: 60px;
}

@media (prefers-color-scheme: dark) {
:root {
--primary-color: #60a5fa;
--primary-hover: #3b82f6;
--sidebar-bg: #0f172a;
--sidebar-border: #1e293b;
--text-primary: #e2e8f0;
--text-secondary: #94a3b8;
--page-bg: #020617;
--surface-bg: #0b1120;
--surface-elevated: #111827;
--code-bg: #1f2937;
--success-bg: rgba(16, 185, 129, 0.15);
--success-border: #34d399;
--info-bg: rgba(59, 130, 246, 0.15);
--info-border: #60a5fa;
--warning-bg: rgba(245, 158, 11, 0.15);
--warning-border: #fbbf24;
}
}

/* Reset */

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

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

/* Mobile Header */
.mobile-header {
display: none;
}

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

.sidebar-header {
padding: 24px 24px 16px;
border-bottom: 1px solid var(--sidebar-border);
background: var(--surface-elevated);
}

.sidebar-header h1 {
font-size: 24px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 4px;
}

.version {
font-size: 12px;
color: var(--text-secondary);
font-weight: 500;
}

.sidebar-content {
flex: 1;
padding: 16px 0;
}

.nav-section {
margin-bottom: 24px;
}

.nav-section h3 {
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-secondary);
padding: 8px 24px;
margin-bottom: 4px;
}

.nav-section ul {
list-style: none;
}

.nav-section ul li {
margin-bottom: 2px;
}

.nav-section ul li a {
display: block;
padding: 8px 24px;
color: var(--text-primary);
text-decoration: none;
font-size: 14px;
transition: all 0.2s;
border-left: 3px solid transparent;
}

.nav-section ul li a:hover {
background: rgba(59, 130, 246, 0.1);
color: var(--primary-color);
}

.nav-section ul li a.active {
background: rgba(59, 130, 246, 0.1);
color: var(--primary-color);
border-left-color: var(--primary-color);
font-weight: 500;
}

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

.github-link {
display: flex;
align-items: center;
gap: 8px;
color: var(--text-secondary);
text-decoration: none;
font-size: 14px;
transition: color 0.2s;
}

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

/* Main Content */
.content {
margin-left: 280px;
min-height: 100vh;
display: flex;
flex-direction: column;
}

.content-wrapper {
flex: 1;
max-width: 900px;
padding: 48px 64px;
}

.doc-section {
display: block;
animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

/* Typography */
h1 {
font-size: 36px;
font-weight: 700;
margin-bottom: 16px;
color: var(--text-primary);
}

h2 {
font-size: 28px;
font-weight: 600;
margin-top: 48px;
margin-bottom: 16px;
color: var(--text-primary);
padding-bottom: 8px;
border-bottom: 1px solid var(--sidebar-border);
}

h3 {
font-size: 20px;
font-weight: 600;
margin-top: 32px;
margin-bottom: 12px;
color: var(--text-primary);
}

p {
margin-bottom: 16px;
color: var(--text-primary);
font-size: 16px;
}

.lead {
font-size: 18px;
color: var(--text-secondary);
margin-bottom: 32px;
}

ul, ol {
margin-bottom: 16px;
padding-left: 24px;
}

li {
margin-bottom: 8px;
color: var(--text-primary);
}

code {
background: var(--code-bg);
padding: 2px 6px;
border-radius: 4px;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 14px;
color: #e11d48;
}

/* Feature Grid */
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 24px;
margin: 32px 0;
}

.feature-card {
padding: 24px;
background: var(--surface-bg);
border: 1px solid var(--sidebar-border);
border-radius: 8px;
transition: all 0.2s;
}

.feature-card:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transform: translateY(-2px);
}

.feature-icon {
font-size: 32px;
margin-bottom: 12px;
}

.feature-card h3 {
font-size: 16px;
margin: 0 0 8px 0;
}

.feature-card p {
font-size: 14px;
color: var(--text-secondary);
margin: 0;
}

/* Info Boxes */
.info-box, .success-box, .warning-box {
padding: 16px;
border-radius: 8px;
margin: 24px 0;
border-left: 4px solid;
}

.info-box {
background: var(--info-bg);
border-color: var(--info-border);
}

.success-box {
background: var(--success-bg);
border-color: var(--success-border);
}

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

.info-box strong, .success-box strong, .warning-box strong {
font-weight: 600;
}

/* Code Blocks */
.code-block {
margin: 24px 0;
border-radius: 8px;
overflow: hidden;
border: 1px solid var(--sidebar-border);
}

.code-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: #334155;
color: white;
font-size: 14px;
font-weight: 500;
}

.copy-btn {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
color: white;
padding: 4px 12px;
border-radius: 4px;
font-size: 12px;
cursor: pointer;
transition: all 0.2s;
}

.copy-btn:hover {
background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
background: #10b981;
border-color: #10b981;
}

pre {
margin: 0;
padding: 16px;
background: #1e293b;
overflow-x: auto;
}

pre code {
background: none;
padding: 0;
color: #e2e8f0;
font-size: 14px;
line-height: 1.6;
}

/* Tables */
.table-responsive {
overflow-x: auto;
margin: 24px 0;
}

table {
width: 100%;
border-collapse: collapse;
border: 1px solid var(--sidebar-border);
border-radius: 8px;
overflow: hidden;
}

thead {
background: var(--sidebar-bg);
}

th {
padding: 12px 16px;
text-align: left;
font-weight: 600;
font-size: 14px;
color: var(--text-primary);
border-bottom: 2px solid var(--sidebar-border);
}

td {
padding: 12px 16px;
border-bottom: 1px solid var(--sidebar-border);
font-size: 14px;
}

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

tbody tr:hover {
background: rgba(59, 130, 246, 0.05);
}

/* Color Grid */
.color-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 12px;
margin: 24px 0;
}

.color-item {
display: flex;
align-items: center;
gap: 8px;
padding: 8px;
background: var(--surface-bg);
border: 1px solid var(--sidebar-border);
border-radius: 6px;
font-size: 14px;
font-family: monospace;
}

.color-swatch {
width: 24px;
height: 24px;
border-radius: 4px;
border: 1px solid var(--sidebar-border);
flex-shrink: 0;
}

/* Footer */
.footer {
padding: 24px 64px;
border-top: 1px solid var(--sidebar-border);
text-align: center;
color: var(--text-secondary);
font-size: 14px;
background: var(--sidebar-bg);
}

.footer a {
color: var(--primary-color);
text-decoration: none;
}

.footer a:hover {
text-decoration: underline;
}

/* Pagination */
.doc-pagination {
display: flex;
gap: 16px;
margin-top: 48px;
padding-top: 32px;
border-top: 1px solid var(--sidebar-border);
}

.pagination-button {
flex: 1;
text-align: left;
background: var(--surface-bg);
border: 1px solid var(--sidebar-border);
border-radius: 10px;
padding: 16px 20px;
cursor: pointer;
transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
display: block;
text-decoration: none;
color: inherit;
}

.pagination-button:hover:not([aria-disabled="true"]) {
border-color: var(--primary-color);
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
transform: translateY(-2px);
}

.pagination-button[aria-disabled="true"] {
cursor: not-allowed;
opacity: 0.5;
transform: none;
box-shadow: none;
pointer-events: none;
}

.pagination-label {
display: block;
font-size: 12px;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--text-secondary);
margin-bottom: 6px;
}

.pagination-title {
display: block;
font-size: 16px;
font-weight: 600;
color: var(--text-primary);
}

.pagination-next {
text-align: right;
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
width: 6px;
}

.sidebar::-webkit-scrollbar-track {
background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
background: var(--sidebar-border);
border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
.sidebar {
width: 250px;
}

.content {
    margin-left: 250px;
}

.content-wrapper {
    padding: 32px 32px;
}

}

@media (max-width: 768px) {
.sidebar {
transform: translateX(-100%);
transition: none;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar.is-ready {
transition: transform 0.3s;
}

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

.content {
    margin-left: 0;
}

.content-wrapper {
    padding: calc(var(--header-height) + 20px) 16px 24px;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 22px;
}

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

.footer {
    padding: 24px 16px;
}

.doc-pagination {
    flex-direction: column;
}

.pagination-next {
    text-align: left;
}

}

/* Mobile Menu Button */
.mobile-menu-btn {
display: none;
background: transparent;
color: var(--text-primary);
border: none;
width: 44px;
height: 44px;
border-radius: 8px;
cursor: pointer;
transition: background 0.2s;
-webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
.mobile-menu-btn:hover {
background: rgba(59, 130, 246, 0.15);
}
}

@media (max-width: 768px) {
.mobile-header {
display: flex;
align-items: center;
gap: 12px;
position: fixed;
top: 0;
left: 0;
right: 0;
height: var(--header-height);
padding: 0 16px;
background: var(--surface-elevated);
border-bottom: 1px solid var(--sidebar-border);
z-index: 102;
}

.mobile-brand {
display: flex;
flex-direction: column;
line-height: 1.1;
}

.mobile-title {
font-size: 18px;
font-weight: 700;
color: var(--text-primary);
}

.mobile-version {
font-size: 11px;
font-weight: 500;
color: var(--text-secondary);
}

.sidebar {
top: var(--header-height);
height: calc(100vh - var(--header-height));
}

.mobile-menu-btn {
display: flex;
align-items: center;
justify-content: center;
}
}

/* Smooth Scrolling */
html {
scroll-behavior: smooth;
}

/* Selection */
::selection {
background: rgba(59, 130, 246, 0.2);
color: var(--text-primary);
}
