/* Modern CSS Variables */
:root {
    --primary: #3b82f6; /* Blue 500 */
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --bg-body: #f8fafc; /* Slate 50 */
    --bg-surface: #ffffff;
    --text-main: #334155; /* Slate 700 */
    --text-heading: #0f172a; /* Slate 900 */
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    display: flex;
}

/* --- TOP HEADER --- */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-heading);
}

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

.header-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    transform: translateY(-1px);
}

.header-btn:active {
    transform: translateY(0);
}

.header-btn-support {
    background-color: var(--primary);
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2), 0 2px 4px -2px rgba(59, 130, 246, 0.2);
}

.header-btn-support:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3), 0 4px 6px -4px rgba(59, 130, 246, 0.3);
}

.header-btn-author {
    background-color: #82b440; /* Envato Green */
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 6px -1px rgba(130, 180, 64, 0.2), 0 2px 4px -2px rgba(130, 180, 64, 0.2);
}

.header-btn-author:hover {
    background-color: #709d37; /* Darker Envato Green */
    box-shadow: 0 10px 15px -3px rgba(130, 180, 64, 0.3), 0 4px 6px -4px rgba(130, 180, 64, 0.3);
}

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

.header-btn-secondary:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    height: calc(100vh - 70px);
    position: fixed;
    top: 70px;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

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

.nav-group-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8; /* Slate 400 */
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item { margin-bottom: 0.25rem; }

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    display: block;
    padding: 0.4rem 1rem;
    border-radius: 0.375rem; /* 6px */
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* --- MAIN CONTENT --- */
.content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: 70px;
    padding: 3rem 4rem;
    width: calc(100% - var(--sidebar-width));
}

.doc-section {
    background: var(--bg-surface);
    padding: 2.5rem 3rem;
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

/* Typography */
h2 {
    color: var(--text-heading);
    font-size: 1.75rem;
    margin-top: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

h3 {
    color: var(--text-heading);
    font-size: 1.25rem;
    margin-top: 2rem;
}

p { margin-bottom: 1.25rem; }

ul { padding-left: 1.5rem; margin-bottom: 1.5rem; }
li { margin-bottom: 0.5rem; }

/* Code Blocks & Inline Code */
code {
    background-color: #f1f5f9;
    color: #db2777; /* Pink 600 */
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875em;
}

.code-block {
    background-color: #1e293b; /* Slate 800 */
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.code-block pre { margin: 0; }

.code-block code {
    background-color: transparent;
    color: #e2e8f0;
    padding: 0;
    font-size: 0.9em;
}

/* Callouts (Alerts) */
.callout {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.callout-info {
    background-color: #eff6ff;
    border-left: 4px solid var(--primary);
    color: #1e3a8a; /* Blue 900 */
}

.callout-warning {
    background-color: #fef2f2; /* Red 50 */
    border-left: 4px solid #ef4444; /* Red 500 */
    color: #7f1d1d; /* Red 900 */
}

/* Screenshot Placeholders */
.screenshot-placeholder {
    border: 2px dashed #cbd5e1;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    padding: 2rem 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.screenshot-placeholder:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.screenshot-placeholder .icon {
    font-size: 2rem;
    color: #94a3b8;
}

.screenshot-placeholder .label {
    font-weight: 600;
    color: var(--text-heading);
}

/* Tables */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    background: var(--bg-surface);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

.doc-table th {
    background-color: #f1f5f9;
    color: var(--text-heading);
    font-weight: 600;
}

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

/* --- FIXED FOOTER --- */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-main);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fixed-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.fixed-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Adjust content wrapper padding bottom so it's not hidden under the footer */
.content-wrapper {
    padding-bottom: 6rem;
}

/* Responsive adjust for footer */
@media (max-width: 768px) {
    .fixed-footer {
        position: relative;
        left: 0;
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    .content-wrapper {
        padding-bottom: 3rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    body { flex-direction: column; }
    .top-header {
        position: relative;
        height: auto;
        padding: 1rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .content-wrapper {
        margin-left: 0;
        margin-top: 0;
        width: 100%;
        padding: 1.5rem;
    }
    .doc-section { padding: 1.5rem; }
}

/* Screenshots and Image Layouts */
.screenshot-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.screenshot-img:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.06);
}

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

.screenshot-grid .screenshot-img {
    margin: 0;
    width: 100%;
}

