:root {
    /* Light theme (default) */
    --sidebar-width: 300px;
    --header-height: 60px;
    --primary-color: #0066cc;
    --text-color: #333;
    --border-color: #e6e8eb;
    --sidebar-background: #f5f7f9;
    --background-color: #ffffff;
    --code-background: #f1f1f1;
}

[data-theme="dark"] {
    --primary-color: #66b3ff;
    --text-color: #e6e6e6;
    --border-color: #2d2d2d;
    --sidebar-background: #1a1a1a;
    --background-color: #121212;
    --code-background: #2d2d2d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background-color);
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-background);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.sidebar-nav {
    padding: 20px;
    padding-right: 10px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 8px 0;
}

.sidebar-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.sidebar-nav a:hover {
    color: var(--primary-color);
}

.nav-group {
    margin: 0 0 15px 0;
}

.nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 5px 0;
}

.collapse-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.collapse-btn:hover {
    opacity: 0.7;
}

.chevron-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.nav-group.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.nav-group.collapsed .nav-group-content {
    display: none;
}

.nav-group-content {
    transition: all 0.2s ease;
}

.nav-group-title {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    flex: 1;
}

.nav-group ul {
    margin-left: 12px;
    margin-top: 5px;
    border-left: 1px solid var(--border-color);
}

.nav-group ul li {
    margin: 4px 0;
    padding-left: 12px;
}

.active a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Main Content Styles */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
}

.content-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 40px;
    position: sticky;
    top: 0;
    background: var(--background-color);
    z-index: 100;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-bar input {
    width: 100%;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--background-color);
    color: var(--text-color);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.content-body {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

/* Markdown Content Styles */
.content-body h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.content-body h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
}

.content-body h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
}

.content-body p {
    margin-bottom: 1rem;
}

.content-body code {
    background: var(--code-background);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    color: var(--text-color);
}

.content-body pre {
    background: var(--code-background);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
    color: var(--text-color);
}

.content-body a {
    color: var(--primary-color);
    text-decoration: none;
}

.content-body a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .content {
        margin-left: 0;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content-header {
        padding: 0 20px;
    }

    .content-body {
        padding: 20px;
    }

    .search-bar {
        max-width: none;
    }

    .nav-button-text {
        display: none;
    }

    .nav-button.prev,
    .nav-button.next {
        padding: 8px;
    }

    .sidebar {
        width: 280px;
        z-index: 1000;
    }

    .mobile-menu-toggle {
        margin-right: 12px;
    }

    .theme-toggle {
        margin-right: 12px;
    }

    .content-nav {
        margin: 40px 0;
    }

    .footer {
        padding: 20px;
    }
}

/* Small screens */
@media (max-width: 480px) {
    .content-header {
        padding: 0 15px;
    }

    .content-body {
        padding: 15px;
    }

    .content-body h1 {
        font-size: 2rem;
    }

    .search-results {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--header-height));
    }
}

/* Make the scrollbar thinner and more modern */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.mobile-menu-toggle {
    display: none;
    margin-right: 20px;
}

.mobile-menu-toggle button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.mobile-menu-toggle svg {
    fill: var(--text-color);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .content-header {
        justify-content: flex-start;
    }
}

/* Add these new styles for navigation buttons */
.content-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.nav-button {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background: var(--sidebar-background);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-button.prev {
    padding-left: 12px;
}

.nav-button.next {
    padding-right: 12px;
}

.nav-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.nav-button.prev svg {
    margin-right: 8px;
}

.nav-button.next svg {
    margin-left: 8px;
}

.nav-button-text {
    display: flex;
    flex-direction: column;
}

.nav-button-label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.nav-button-title {
    font-weight: 500;
}

/* Add these styles for disabled navigation buttons */
.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--sidebar-background);
}

/* Update existing nav-button hover style to not affect disabled buttons */
.nav-button:not(.disabled):hover {
    background: var(--sidebar-background);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Add these styles for the footer */
.footer {
    margin-top: 60px;
    padding: 20px 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Update content-nav margin to work better with footer */
.content-nav {
    margin: 60px 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Ensure footer stays at bottom for short pages */
.content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-body {
    flex: 1;
}

/* Search Results Styles */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-result-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--sidebar-background);
    text-decoration: none;
}

.search-result-title {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--primary-color);
}

.search-result-context {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-results {
    padding: 12px 16px;
    color: #666;
    text-align: center;
}

/* Theme Toggle Styles */
.theme-toggle {
    margin-right: 20px;
}

.theme-toggle button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-color);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
} 