:root {
    --bg-color: #f9f9fb;
    --sidebar-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --accent-color: #547f5e; /* D-Herbal Green */
    --accent-hover: #3f6347;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.docs-container {
    display: block;
    min-height: 100vh;
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 900;
}

.mobile-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 0 16px;
}

.menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 950;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
}

.close-sidebar {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}

.sidebar-nav {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}

.nav-link {
    padding: 12px 24px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: var(--accent-color);
    background-color: #f1f5f9;
}

.nav-link.active {
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    background-color: #f1f5f9;
}

/* Main Content */
.content-area {
    margin-left: 280px;
    padding: 48px;
    width: calc(100% - 280px);
    max-width: 900px;
    min-width: 0;
}

.doc-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.doc-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography & Markdown Styles */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

h3 {
    font-size: 1.25rem;
    margin-top: 32px;
    margin-bottom: 12px;
}

p {
    margin-bottom: 16px;
    font-size: 1.05rem;
}

ul, ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

li {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

code {
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: #e11d48;
}

strong {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        border-right: 1px solid var(--border-color); /* Ensure border is back */
    }

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

    .close-sidebar {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .content-area {
        margin-left: 0;
        width: 100%;
        padding: 24px;
        padding-top: 80px; /* Space for mobile header */
    }
    
    .sidebar-nav {
        height: calc(100vh - 73px); /* Subtract sidebar-header height */
        overflow-y: auto;
    }
}

/* Image Styles */
.doc-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    margin: 24px 0;
    display: block;
}

.image-placeholder {
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 48px;
    text-align: center;
    color: #64748b;
    margin: 24px 0;
    font-weight: 500;
}

/* Global Header */
.global-header {
    background-color: #2c3e50; /* Dark color matching example */
    color: #ffffff;
    padding: 0 40px;
    height: 60px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
}
.header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.global-logo {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
}
.global-nav {
    display: flex;
    gap: 20px;
}
.global-nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.global-nav a:hover, .global-nav a.active-nav {
    color: #ffffff;
}

/* Adjust layout for docs page */
body.docs-page .docs-container {
    padding-top: 60px; /* Offset for fixed global header */
}
body.docs-page .sidebar {
    top: 60px;
    height: calc(100vh - 60px);
}
body.docs-page .mobile-header {
    top: 60px;
}

@media (max-width: 768px) {
    body.docs-page .content-area {
        padding-top: 80px; /* Account for mobile header */
    }
}

/* Home Page Layout */
body.home-page {
    background-color: #ffffff;
    padding-top: 60px;
}
.hero-section {
    background-color: #f8fafc;
    padding: 80px 20px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}
.hero-container {
    max-width: 800px;
    margin: 0 auto;
}
.hero-section h1 {
    font-size: 2.2rem;
    font-weight: 400;
    border: none;
    margin-bottom: 30px;
    padding-bottom: 0;
}
.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-radius: 4px;
}
.search-box input {
    flex: 1;
    padding: 16px;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
}
.search-box button {
    background-color: #4c82b1; /* Blue matching HelpScout */
    color: white;
    border: none;
    padding: 0 32px;
    font-size: 1.05rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 500;
}

/* Themes Grid */
.themes-grid-section {
    padding: 80px 20px;
}
.themes-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}
.theme-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #ffffff;
}
.theme-card h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 30px;
}
.theme-links {
    list-style: none;
    padding: 0;
    text-align: left;
}
.theme-links li {
    margin-bottom: 16px;
}
.theme-links a {
    color: #64748b;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.theme-links a::before {
    content: "📄";
    margin-right: 8px;
    font-size: 0.9em;
    filter: grayscale(1);
    opacity: 0.4;
}
.theme-links li:last-child a::before {
    content: ""; /* Remove icon from view all articles */
    margin-right: 0;
}
.theme-links a:hover {
    color: #4c82b1;
}

.home-footer {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
}
