/* ============================================
   Magical Shop Builder - Documentation Styles
   Version: 2.0.0
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --primary-bg: #f5f3ff;
    --accent: #f59e0b;
    --accent-bg: #fffbeb;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --pro: #f97316;
    --pro-bg: #fff7ed;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --bg: #ffffff;
    --bg-gray: #f8fafc;
    --bg-dark: #0f172a;
    --sidebar-width: 280px;
    --header-height: 64px;
    --content-max: 900px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg-gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- Header ---------- */
.doc-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.95);
}

.doc-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.doc-header .logo svg {
    width: 32px;
    height: 32px;
}

.doc-header .logo span.version {
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 260px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font);
    background: var(--bg-gray);
    transition: all var(--transition);
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary-light);
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
    width: 16px;
    height: 16px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 200;
    padding: 5px 20px;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.search-result-item:hover {
    border-left: 3px solid var(--primary);
}

.search-result-item .result-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.search-result-item .result-section {
    font-size: 11px;
    color: var(--text-lighter);
    margin-top: 2px;
}

.btn-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    cursor: pointer;
    color: var(--text);
}

/* ---------- Sidebar ---------- */
.doc-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.doc-sidebar::-webkit-scrollbar {
    width: 4px;
}
.doc-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.sidebar-section {
    margin-bottom: 4px;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-lighter);
    cursor: pointer;
    user-select: none;
}

.sidebar-section-title .chevron {
    width: 14px;
    height: 14px;
    transition: transform var(--transition);
}

.sidebar-section.collapsed .chevron {
    transform: rotate(-90deg);
}

.sidebar-section.collapsed .sidebar-links {
    display: none;
}

.sidebar-links {
    list-style: none;
}

.sidebar-links li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px 6px 24px;
    font-size: 13.5px;
    color: var(--text-light);
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-links li a:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.sidebar-links li a.active {
    color: var(--primary);
    background: var(--primary-bg);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-links li a .nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

.sidebar-links li a.active .nav-icon {
    opacity: 1;
}

.sidebar-links li a .pro-badge {
    font-size: 9px;
    font-weight: 700;
    background: var(--pro);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: auto;
}

/* Sub-navigation */
.sidebar-links li .sub-links {
    list-style: none;
    display: none;
}

.sidebar-links li.has-sub.open .sub-links {
    display: block;
}

.sidebar-links li .sub-links a {
    padding-left: 44px;
    font-size: 12.5px;
}

/* ---------- Main Content ---------- */
.doc-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

.doc-content {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 40px 40px 80px;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-lighter);
    margin-bottom: 24px;
}

.breadcrumbs a {
    color: var(--text-light);
}
.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .sep {
    color: var(--border);
}

/* Page Header */
.page-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 12px;
}

.page-header .subtitle {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.6;
}

.page-header .page-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-lighter);
}

.page-header .page-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Typography ---------- */
.doc-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.doc-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-top: 32px;
    margin-bottom: 12px;
}

.doc-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 8px;
}

.doc-content p {
    margin-bottom: 16px;
    color: var(--text);
}

.doc-content ul, .doc-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.doc-content li {
    margin-bottom: 6px;
}

.doc-content strong {
    font-weight: 600;
}

/* ---------- Callout Boxes ---------- */
.callout {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border-left: 4px solid;
    display: flex;
    gap: 12px;
}

.callout .callout-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.callout-content {
    flex: 1;
}

.callout-content p:last-child {
    margin-bottom: 0;
}

.callout.info {
    background: var(--info-bg);
    border-color: var(--info);
}
.callout.info .callout-icon { color: var(--info); }

.callout.success {
    background: var(--success-bg);
    border-color: var(--success);
}
.callout.success .callout-icon { color: var(--success); }

.callout.warning {
    background: var(--warning-bg);
    border-color: var(--warning);
}
.callout.warning .callout-icon { color: var(--warning); }

.callout.danger {
    background: var(--danger-bg);
    border-color: var(--danger);
}
.callout.danger .callout-icon { color: var(--danger); }

.callout.pro {
    background: var(--pro-bg);
    border-color: var(--pro);
}
.callout.pro .callout-icon { color: var(--pro); }

/* ---------- Code Blocks ---------- */
code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-gray);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary-dark);
    border: 1px solid var(--border-light);
}

pre {
    background: var(--bg-dark);
    color: #e2e8f0;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow-x: auto;
    position: relative;
    line-height: 1.6;
}

pre code {
    background: none;
    padding: 0;
    border: none;
    color: inherit;
    font-size: 13px;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1e293b;
    padding: 8px 16px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-bottom: 0;
}

.code-header + pre {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: 0;
}

.code-header .lang {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-copy {
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-lighter);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-copy:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.btn-copy.copied {
    color: var(--success);
}

/* ---------- Tables ---------- */
.table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

thead {
    background: var(--bg-gray);
}

th {
    text-align: left;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: rgba(124, 58, 237, 0.02);
}

/* ---------- Cards / Feature Grid ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition);
}

.feature-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feature-card .card-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.feature-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.5;
}

.feature-card .card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
    color: var(--primary);
}

/* Widget cards */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.widget-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.widget-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.widget-card .widget-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-card .widget-name .pro-tag {
    font-size: 9px;
    font-weight: 700;
    background: var(--pro);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
}

.widget-card .widget-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.5;
}

.widget-card .widget-meta {
    font-size: 11px;
    color: var(--text-lighter);
}

/* ---------- Screenshot Placeholder ---------- */
.screenshot {
    background: linear-gradient(135deg, var(--primary-bg), #ede9fe);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screenshot .placeholder-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-light);
    margin-bottom: 12px;
    opacity: 0.5;
}

.screenshot .placeholder-text {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
}

.screenshot img {
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.screenshot .caption {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 12px;
    font-style: italic;
}

/* ---------- Steps ---------- */
.steps {
    counter-reset: step;
    margin-bottom: 32px;
}

.step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
}

.step::before {
    content: counter(step);
    counter-increment: step;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    margin-top: 2px;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 40px;
    bottom: -16px;
    width: 2px;
    background: var(--border);
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 15px;
}

.step-content p {
    font-size: 14px;
    color: var(--text-light);
}

/* ---------- Tabs ---------- */
.tabs {
    margin-bottom: 24px;
}

.tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.badge-free {
    background: var(--success-bg);
    color: var(--success);
}

.badge-pro {
    background: var(--pro-bg);
    color: var(--pro);
}

.badge-new {
    background: var(--info-bg);
    color: var(--info);
}

/* ---------- Requirements list ---------- */
.req-list {
    list-style: none;
    padding: 0;
    margin-bottom: 24px;
}

.req-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.req-list li .req-icon {
    width: 20px;
    height: 20px;
    color: var(--success);
    flex-shrink: 0;
}

.req-list li .req-label {
    font-weight: 600;
    min-width: 160px;
}

.req-list li .req-value {
    color: var(--text-light);
}

/* ---------- On This Page (Right Sidebar) ---------- */
.toc-sidebar {
    position: fixed;
    top: calc(var(--header-height) + 40px);
    right: 24px;
    width: 200px;
    max-height: calc(100vh - var(--header-height) - 80px);
    overflow-y: auto;
    font-size: 12px;
    background: #fff;
    padding: 20px 10px;
}

.toc-sidebar .toc-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-lighter);
    margin-bottom: 8px;
}

.toc-sidebar ul {
    list-style: none;
    padding: 0;
    border-left: 1px solid var(--border);
}

.toc-sidebar ul li a {
    display: block;
    padding: 4px 12px;
    color: var(--text-light);
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: all var(--transition);
    font-size: 12px;
    line-height: 1.4;
}

.toc-sidebar ul li a:hover,
.toc-sidebar ul li a.active {
    color: var(--primary);
    border-left-color: var(--primary);
}

/* ---------- Footer ---------- */
.doc-footer {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.footer-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

.footer-nav a {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 200px;
    transition: all var(--transition);
}

.footer-nav a:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.footer-nav a .nav-label {
    font-size: 11px;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.footer-nav a .nav-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.footer-nav a.prev {
    text-align: left;
}

.footer-nav a.next {
    text-align: right;
    margin-left: auto;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-lighter);
}

/* ---------- Settings Group ---------- */
.settings-group {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
}

.settings-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.settings-group-header h4 {
    margin: 0;
    font-size: 15px;
}

.settings-group-header .toggle-icon {
    margin-left: auto;
    width: 16px;
    height: 16px;
    color: var(--text-lighter);
    transition: transform var(--transition);
}

.settings-group.open .toggle-icon {
    transform: rotate(180deg);
}

.settings-table {
    width: 100%;
}

.settings-table td {
    padding: 12px 20px;
}

.settings-table .setting-name {
    font-weight: 600;
    font-size: 13px;
    width: 220px;
}

.settings-table .setting-type {
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    width: 80px;
}

.settings-table .setting-desc {
    font-size: 13px;
    color: var(--text-light);
}

/* ---------- Hero / Intro Section ---------- */
.hero-section {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #c4b5fd 100%);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    margin-bottom: 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.hero-section h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
}

.hero-section p {
    font-size: 17px;
    opacity: 0.9;
    max-width: 600px;
    line-height: 1.6;
    position: relative;
}

.hero-stats {
    display: flex;
    gap: 32px;
    margin-top: 24px;
    position: relative;
}

.hero-stat {
    text-align: center;
}

.hero-stat .stat-number {
    font-size: 28px;
    font-weight: 800;
    display: block;
}

.hero-stat .stat-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- Keyboard Shortcut ---------- */
kbd {
    display: inline-flex;
    padding: 2px 6px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    font-family: var(--font-mono);
    box-shadow: 0 1px 0 var(--border);
    color: var(--text);
}

/* ---------- API Endpoint ---------- */
.api-endpoint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.api-method {
    font-weight: 700;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.api-method.get { background: #dbeafe; color: #1d4ed8; }
.api-method.post { background: #dcfce7; color: #16a34a; }
.api-method.put { background: #fef3c7; color: #d97706; }
.api-method.delete { background: #fee2e2; color: #dc2626; }

.api-route {
    color: var(--text);
}

.api-route .param {
    color: var(--primary);
}

/* ---------- Template Type Cards ---------- */
.template-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.template-type-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all var(--transition);
}

.template-type-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.template-type-card .type-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 8px;
    color: var(--primary);
}

.template-type-card h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.template-type-card .type-desc {
    font-size: 11px;
    color: var(--text-lighter);
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .toc-sidebar {
        display: none;
    }
}

@media (max-width: 860px) {
    .doc-sidebar {
        transform: translateX(-100%);
    }

    .doc-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .doc-main {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .search-box {
        width: 180px;
    }

    .doc-content {
        padding: 24px 20px 60px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .hero-section {
        padding: 32px 24px;
    }

    .hero-section h1 {
        font-size: 26px;
    }

    .hero-stats {
        gap: 20px;
        flex-wrap: wrap;
    }

    .feature-grid,
    .widget-grid {
        grid-template-columns: 1fr;
    }

    .footer-nav {
        flex-direction: column;
    }

    .footer-nav a {
        min-width: unset;
    }

    .template-types {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .doc-header .logo span:not(.version) {
        display: none;
    }

    .search-box {
        width: 140px;
    }

    .btn-header span {
        display: none;
    }

    .hero-section h1 {
        font-size: 22px;
    }
}

/* ---------- Overlay for mobile sidebar ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 40;
}

.sidebar-overlay.active {
    display: block;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.doc-content {
    animation: fadeIn 0.3s ease;
}

/* ---------- Print ---------- */
@media print {
    .doc-header,
    .doc-sidebar,
    .toc-sidebar,
    .mobile-toggle,
    .sidebar-overlay {
        display: none !important;
    }

    .doc-main {
        margin-left: 0 !important;
    }

    .doc-content {
        max-width: 100%;
        padding: 20px;
    }
}
