/* ==========================================================================
   Help Pages Styles
   Uses CSS variables from design-system.css for dark mode compatibility
   ========================================================================== */

.help-layout {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* --- Table of Contents (Sidebar) --- */
.help-toc {
    position: sticky;
    top: 1.5rem;
    width: 260px;
    min-width: 260px;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    align-self: flex-start;
}

.help-toc h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
}

.help-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-toc li {
    margin-bottom: 0.125rem;
}

.help-toc a {
    display: block;
    padding: 0.375rem 0.625rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: background 0.15s, color 0.15s;
}

.help-toc a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* --- Main Content Area --- */
.help-content {
    flex: 1;
    min-width: 0;
}

.help-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.help-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* --- Collapsible Sections --- */
.help-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
}

.help-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
    font-family: inherit;
}

.help-section-header:hover {
    background: var(--bg-hover);
}

.help-section-header .material-icons.section-icon {
    font-size: 1.25rem;
    color: var(--color-primary, #2563EB);
}

.help-section-header .section-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.help-section-header .material-icons.chevron {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.help-section.open .help-section-header .material-icons.chevron {
    transform: rotate(180deg);
}

.help-section-body {
    display: none;
    padding: 0 1.25rem 1.25rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
}

.help-section.open .help-section-body {
    display: block;
}

/* Content inside sections */
.help-section-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.25rem 0 0.5rem 0;
}

.help-section-body h4:first-child {
    margin-top: 0;
}

.help-section-body p {
    margin: 0.5rem 0;
}

.help-section-body ul,
.help-section-body ol {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.help-section-body li {
    margin-bottom: 0.35rem;
}

.help-section-body strong {
    color: var(--text-primary);
}

.help-section-body code {
    background: var(--bg-input);
    padding: 0.125rem 0.375rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85em;
}

/* --- Steps / Numbered Instructions --- */
.help-steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}

.help-steps li {
    counter-increment: step;
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 0.75rem;
}

.help-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--color-primary, #2563EB);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Screenshots --- */
.help-screenshot {
    display: block;
    max-width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.help-screenshot-caption {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

/* --- Tip / Note boxes --- */
.help-tip {
    background: var(--bg-input);
    border-left: 3px solid var(--color-primary, #2563EB);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.help-tip strong {
    color: var(--color-primary, #2563EB);
}

.help-warning {
    background: var(--bg-input);
    border-left: 3px solid #F59E0B;
    padding: 0.75rem 1rem;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.help-warning strong {
    color: #F59E0B;
}

/* --- FAQ --- */
.help-faq dt {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.help-faq dt:first-child {
    margin-top: 0;
}

.help-faq dd {
    margin-left: 0;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .help-layout {
        flex-direction: column;
        padding: 1rem;
    }

    .help-toc {
        position: static;
        width: 100%;
        min-width: unset;
        max-height: none;
        display: none;
    }

    .help-content h1 {
        font-size: 1.4rem;
    }
}
