/* --- Global Styles --- */
:root {
    --primary-color: #4f46e5;       /* Indigo 600 - Matches LifeOrch */
    --primary-light: #e0e7ff;       /* Indigo 100 */
    --primary-hover: #4338ca;       /* Indigo 700 */
    --text-color: #1f2937;          /* Gray 800 */
    --text-light: #4b5563;          /* Gray 600 */
    --border-color: #e5e7eb;        /* Gray 200 */
    --bg-color: #f9fafb;            /* Gray 50 */
    --bg-white: #ffffff;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

h1, h2, h3, h4 {
    font-family: 'Lora', serif; /* Consistent with LifeOrch headers */
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-top: 2.5rem;
}

h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    font-family: 'Inter', sans-serif; /* Sub-sub-headers often cleaner as sans-serif */
    font-weight: 600;
}

p {
    margin-bottom: 1.25rem;
    color: var(--text-light);
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    margin-top: -1rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* --- Layout --- */
.help-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-white);
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0,0,0,0.03); /* Subtle depth */
}

.help-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.help-content {
    flex-grow: 1;
    padding: 3rem 4rem;
    max-width: calc(100% - 280px);
}

/* --- Sidebar Navigation --- */
.brand-link {
    display: flex;
    align-items: center;
    color: var(--text-color);
    font-family: 'Inter', sans-serif; /* Changed to Inter to fit sidebar style better */
    font-weight: 600;
    font-size: 1.1rem; /* Slightly smaller/more refined */
    text-decoration: none !important;
    padding-bottom: 0.5rem;
    transition: opacity 0.2s;
}

.brand-link:hover {
    opacity: 0.8;
}

.brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    margin-right: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.help-sidebar h3 {
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.help-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-sidebar li {
    margin-bottom: 2px;
}

.help-sidebar li a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.15s ease;
}

.help-sidebar li a:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
}

.help-sidebar li.active a {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

/* --- Search Bar --- */
.search-container {
    position: relative;
    margin-bottom: 3rem;
}

#search-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #ffffff;
    transition: all 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

#search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 20;
    max-height: 400px;
    overflow-y: auto;
}

#search-results a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--bg-color);
    font-size: 0.95rem;
}

#search-results a:last-child {
    border-bottom: none;
}

#search-results a:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.search-no-result {
    padding: 1rem 1.25rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- Category Grid (Main Page) --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    display: block;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-card:hover {
    text-decoration: none;
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.category-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-family: 'Inter', sans-serif;
}

.category-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* --- Section Page Content --- */
.help-content section {
    margin-bottom: 2.5rem;
    padding-top: 1rem; /* For anchor linking */
}

/* --- Google Doc Embedding --- */
/* FIX: Force aspect ratio and size for readability */
.doc-embed-container {
    position: relative;
    width: 100%;
    /* Use viewport height units to ensure it takes up screen space 
       but set a minimum to ensure readability on small screens.
    */
    height: 85vh; 
    min-height: 600px; 
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
    background: #fff;
}

.doc-embed-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.doc-fallback-link {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
}


/* --- Responsive Design --- */
@media (max-width: 900px) {
    .help-container {
        flex-direction: column;
    }

    .help-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 1.5rem;
    }

    /* Hide the brand link on mobile if space is tight, 
       or keep it compact. Here we keep it but adjust layout */
    .brand-link {
        margin-bottom: 1rem;
    }

    .help-sidebar h3 {
        display: none; /* Hide 'Help Menu' label on mobile */
    }

    .help-sidebar ul {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    }

    .help-sidebar li a {
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
        background: var(--bg-color);
        border: 1px solid transparent;
    }
    
    .help-sidebar li.active a {
        border-color: var(--primary-light);
    }

    .help-content {
        width: 100%;
        max-width: 100%;
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}