/* Color Variables */
:root {
    --blue: #3b82f6;
    --dark-blue: #1e3a8a;
    --orange: #f97316;
    --sidebar-width: 280px;
    --sidebar-bg: var(--dark-blue);
    --sidebar-text: #ffffff;
    --content-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --link-color: var(--blue);
    --link-hover: var(--orange);
    --code-bg: #f3f4f6;
    --code-border: #d1d5db;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

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

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--sidebar-bg);
    border: none;
    padding: 12px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--blue);
}

.sidebar-toggle span {
    width: 24px;
    height: 3px;
    background: var(--sidebar-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.sidebar.open ~ .content .sidebar-toggle {
    left: calc(var(--sidebar-width) + 20px);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

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

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.sidebar-header a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease, color 0.3s ease;
}

.sidebar-header a:hover {
    transform: translateX(8px);
}

.sidebar-header .logo {
    width: 44px;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}


.sidebar-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--sidebar-text);
    margin: 0;
    transition: color 0.3s ease;
}

.sidebar-header a:hover h1 {
    color: var(--link-hover);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 16px 0;
}

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

.sidebar-nav > ul > li {
    margin-bottom: 4px;
}

.sidebar-nav .nav-link {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    border-left-color: var(--orange);
}

.sidebar-nav .nav-link.active {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--sidebar-text);
    border-left-color: var(--blue);
    font-weight: 600;
}

/* Expandable Sections */
.nav-section {
    margin-bottom: 4px;
}

.nav-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    user-select: none;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-section-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--orange);
}

.nav-section-header.expanded .expand-icon {
    transform: rotate(180deg);
}

.expand-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.nav-subsection {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(0, 0, 0, 0.1);
}

.nav-subsection.expanded {
    max-height: 1000px;
}

.nav-subsection li {
    padding-left: 20px;
}

.nav-subsection .nav-link {
    padding: 10px 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.nav-subsection .nav-link:hover {
    padding-left: 24px;
}

/* Main Content */
.content {
    margin-left: 0;
    min-height: 100vh;
    padding: 80px 40px 40px;
    transition: margin-left 0.3s ease;
}

.sidebar.open ~ .content {
    margin-left: var(--sidebar-width);
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 18px;
}

/* Markdown Content Styling */
.markdown-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.markdown-body h1 {
    font-size: 2.5em;
    margin-top: 0;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--dark-blue);
}

.markdown-body h2 {
    font-size: 2em;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--dark-blue);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-body h3 {
    font-size: 1.5em;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--blue);
}

.markdown-body h4 {
    font-size: 1.25em;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.markdown-body p {
    margin-bottom: 16px;
}

.markdown-body a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.markdown-body a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 16px;
    padding-left: 30px;
}

.markdown-body li {
    margin-bottom: 8px;
}

.markdown-body blockquote {
    border-left: 4px solid var(--blue);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.markdown-body code {
    background-color: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #e83e8c;
}

.markdown-body pre {
    background-color: #1e293b;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 20px 0;
}

.markdown-body pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.9em;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95em;
}

.markdown-body table th,
.markdown-body table td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.markdown-body table th {
    background-color: var(--dark-blue);
    color: white;
    font-weight: 600;
}

.markdown-body table tr:nth-child(even) {
    background-color: #f9fafb;
}

.markdown-body table tr:hover {
    background-color: #f3f4f6;
}

.markdown-body hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 32px 0;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }

    .content {
        padding: 80px 20px 40px;
    }

    .sidebar.open ~ .content {
        margin-left: 0;
    }

    .sidebar.open ~ .content .sidebar-toggle {
        left: calc(var(--sidebar-width) - 40px);
    }

    .footer {
        margin-left: 0 !important;
    }

    .markdown-body {
        font-size: 15px;
    }

    .markdown-body h1 {
        font-size: 2em;
    }

    .markdown-body h2 {
        font-size: 1.75em;
    }
}

@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
    }

    .content {
        margin-left: var(--sidebar-width);
    }

    .footer {
        margin-left: var(--sidebar-width) !important;
    }

    .sidebar-toggle {
        display: none;
    }
}

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

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 1023px) {
    .sidebar-overlay.active {
        display: block;
    }
}

/* Footer Styles */
.footer {
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--border-color);
    margin-top: 48px;
    background-color: var(--content-bg);
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

.footer-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 40px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-link {
    text-decoration: none;
    color: inherit;
}

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

.footer-brand {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-link:hover .footer-brand {
    color: var(--link-hover);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.footer-social-link:hover {
    color: var(--link-hover);
    transform: scale(1.1);
    background-color: rgba(249, 115, 22, 0.1);
}

.footer-social-link svg {
    width: 20px;
    height: 20px;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-container {
        padding: 20px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }
}

