/* Documentation-specific styles */
/* Reuses CSS variables and components from style.css */

/* -------------- DOCS LAYOUT -------------- */
.docs-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-areas: "sidebar content";
    height: 100dvh;
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-container.sidebar-minimized {
    grid-template-columns: 60px 1fr;
}

/* -------------- DOCS SIDEBAR -------------- */
.docs-sidebar {
    grid-area: sidebar;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-container.sidebar-minimized .docs-sidebar {
    padding: 16px 8px;
    align-items: center;
}

.docs-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 12px;
    padding: 0;
}

.docs-container.sidebar-minimized .docs-sidebar-header {
    justify-content: center;
}

.docs-back-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: background-color 0.2s ease;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-back-link img {
    filter: var(--icon-filter);
}

.docs-back-link:hover {
    background: var(--hover-bg);
}

.docs-sidebar-header .icon-btn img {
    filter: var(--icon-filter);
}

.docs-container.sidebar-minimized .docs-back-link {
    padding: 12px;
    justify-content: center;
}

.docs-container.sidebar-minimized .docs-back-link span {
    display: none;
}

.docs-nav {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.docs-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
    background: transparent;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-nav-item:hover {
    background: rgba(128,128,128,0.3);
}

.docs-nav-item.active {
    background: rgba(16,185,129,0.15);
}

.docs-nav-item.active:hover {
    background: rgba(16,185,129,0.2);
}

.docs-nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: var(--icon-filter);
}

.docs-container.sidebar-minimized .docs-nav-item {
    justify-content: center;
    padding: 12px;
}

.docs-container.sidebar-minimized .docs-nav-item span {
    display: none;
}

/* -------------- DOCS CONTENT -------------- */
.docs-content {
    grid-area: content;
    padding: 48px 64px;
    overflow-y: auto;
    position: relative;
}

.docs-content-inner {
    max-width: 800px;
    margin: 0 auto;
}

/* Theme toggle button */
.docs-theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 100;
}

/* -------------- MARKDOWN CONTENT STYLING -------------- */
.docs-content h1 {
    font-size: 36px;
    line-height: 44px;
    font-weight: 600;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.docs-content h2 {
    font-size: 28px;
    line-height: 36px;
    font-weight: 600;
    margin: 40px 0 16px;
    padding-top: 16px;
}

.docs-content h3 {
    font-size: 22px;
    line-height: 30px;
    font-weight: 600;
    margin: 32px 0 12px;
}

.docs-content h4 {
    font-size: 18px;
    line-height: 26px;
    font-weight: 600;
    margin: 24px 0 10px;
}

.docs-content p {
    margin: 0 0 12px;
    line-height: 1.6;
}

.docs-content ul,
.docs-content ol {
    margin: 0 0 12px;
    padding-left: 24px;
}

.docs-content li {
    margin: 4px 0;
    line-height: 1.6;
}

.docs-content a {
    color: var(--accent);
    text-decoration: none;
}

.docs-content a:hover {
    text-decoration: underline;
}

.docs-content strong {
    font-weight: 600;
    color: var(--text);
}

.docs-content em {
    font-style: italic;
    color: var(--muted);
}

.docs-content code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 14px;
    color: var(--accent);
}

.docs-content pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
    margin: 0 0 16px;
}

.docs-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.6;
}

.docs-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--muted);
    font-style: italic;
}

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.docs-content th {
    background: var(--bg);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.docs-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.docs-content tr:last-child td {
    border-bottom: none;
}

.docs-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

.docs-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 16px 0;
}

/* Warning boxes */
.docs-content blockquote {
    background: rgba(239,68,68,0.08);
    border: 1px solid var(--danger);
    border-left: 4px solid var(--danger);
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
}

/* -------------- CODE TABS -------------- */
.code-tabs {
    margin: 16px 0;
}

.code-tabs-header {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 8px 8px 0 8px;
}

.code-tab-btn {
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.code-tab-btn:hover {
    background: var(--hover-bg);
    color: var(--text);
}

.code-tab-btn.active {
    background: var(--bg-elev);
    color: var(--accent);
    font-weight: 600;
}

.code-tabs-content {
    position: relative;
}

.code-tab-panel {
    display: none;
}

.code-tab-panel.active {
    display: block;
}

.code-tab-panel pre {
    margin: 0;
    border-radius: 0 0 10px 10px;
    border-top: none;
}

/* -------------- RESPONSIVE -------------- */
@media (max-width: 768px) {
    .docs-content {
        padding: 24px 20px;
    }

    .docs-content h1 {
        font-size: 28px;
        line-height: 36px;
    }

    .docs-content h2 {
        font-size: 24px;
        line-height: 32px;
    }
}
