/* ==========================================================
   Help System Styles
   ========================================================== */

/* Light mode custom properties for the help system */
:root {
    --help-primary: var(--primary-color);
    --help-text-color: var(--text-color);
    --help-muted-color: var(--secondary-text);
    --help-bg: var(--card-bg);
    --help-surface-color: var(--body-bg);
    --help-border-color: var(--border-color);
    --help-border-radius: 0.5rem;
    --help-spacing: 1.5rem;
    --help-font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --help-line-height: 1.6;
    --help-callout-info-bg: #e7f1ff;
    --help-callout-info-border: #b6d4fe;
    --help-callout-info-text: #084298;
    --help-callout-warning-bg: #fff3cd;
    --help-callout-warning-border: #ffecb5;
    --help-callout-warning-text: #664d03;
    --help-code-bg: #f8f9fa;
    --help-table-header-bg: #f8f9fa;
}

/* Dark mode overrides for help system callouts and code blocks */
html[data-bs-theme="dark"] {
    --help-callout-info-bg: rgba(55, 136, 255, 0.12);
    --help-callout-info-border: rgba(55, 136, 255, 0.4);
    --help-callout-info-text: #d6e4ff;
    --help-callout-warning-bg: rgba(255, 202, 44, 0.14);
    --help-callout-warning-border: rgba(255, 202, 44, 0.45);
    --help-callout-warning-text: #ffe8a3;
    --help-code-bg: #1f2429;
    --help-table-header-bg: rgba(255, 255, 255, 0.08);
}

.help-container {
    max-width: 960px;
    margin: 0 auto;
    padding: var(--help-spacing);
    font-family: var(--help-font-family);
    color: var(--help-text-color);
    line-height: var(--help-line-height);
}

/* Centered page header with bottom spacing */
.help-header {
    text-align: center;
    margin-bottom: var(--help-spacing);
}

.help-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.help-header p {
    color: var(--help-muted-color);
    font-size: 1.1rem;
}

/* Themed article card with border and rounded corners */
.help-article {
    background: var(--help-bg);
    border: 1px solid var(--help-border-color);
    border-radius: var(--help-border-radius);
    padding: var(--help-spacing);
}

/* Vertical spacing between article sections */
.help-section {
    margin-bottom: var(--help-spacing);
}

/* Large article heading */
.help-h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--help-text-color);
}

/* Medium section heading */
.help-h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--help-text-color);
}

/* Small subsection heading */
.help-h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--help-text-color);
}

/* Standard paragraph text with bottom margin */
.help-text {
    margin-bottom: 1rem;
    color: var(--help-text-color);
}

/* Indented bulleted list inside help articles */
.help-list {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Spacing between list items */
.help-list li {
    margin-bottom: 0.5rem;
}

/* Unstyled list for related help article links */
.help-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Spacing between link list items */
.help-links li {
    margin-bottom: 0.5rem;
}

/* Primary-colored link without underline */
.help-links a {
    color: var(--help-primary);
    text-decoration: none;
}

/* Underline on hover for help links */
.help-links a:hover {
    text-decoration: underline;
}

/* Flex row breadcrumb with muted text and separator gaps */
.help-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--help-muted-color);
}

/* Primary link color for breadcrumb items */
.help-breadcrumb a {
    color: var(--help-primary);
    text-decoration: none;
}

/* Underline breadcrumb links on hover */
.help-breadcrumb a:hover {
    text-decoration: underline;
}

/* Themed callout box with border and rounded corners */
.help-callout {
    border: 1px solid var(--help-border-color);
    border-radius: var(--help-border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Blue-tinted info callout */
.help-callout-info {
    background-color: var(--help-callout-info-bg);
    border-color: var(--help-callout-info-border);
    color: var(--help-callout-info-text);
}

/* Yellow-tinted warning callout */
.help-callout-warning {
    background-color: var(--help-callout-warning-bg);
    border-color: var(--help-callout-warning-border);
    color: var(--help-callout-warning-text);
}

/* Monospace code block with themed background and horizontal scroll */
.help-code {
    background-color: var(--help-code-bg);
    border: 1px solid var(--help-border-color);
    border-radius: 0.25rem;
    padding: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

/* Full-width border-collapse help table */
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

/* Themed borders and padding for table cells */
.help-table th,
.help-table td {
    border: 1px solid var(--help-border-color);
    padding: 0.75rem;
    text-align: left;
}

/* Themed background for table header cells */
.help-table th {
    background-color: var(--help-table-header-bg);
    font-weight: 600;
}

/* Bottom margin for the search input wrapper */
.search-container {
    margin-bottom: var(--help-spacing);
}

/* Spacing between help category sections */
.help-sections .section {
    margin-bottom: var(--help-spacing);
}

/* Section title with a subtle bottom border */
.help-sections .section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--help-border-color);
    padding-bottom: 0.5rem;
}

/* Centered dashed-border call-to-action box for contacting support */
.contact-support {
    text-align: center;
    padding: var(--help-spacing);
    border: 1px dashed var(--help-border-color);
    border-radius: var(--help-border-radius);
    margin-top: var(--help-spacing);
}

/* Centered muted text for empty search results */
.no-results {
    text-align: center;
    padding: var(--help-spacing);
    color: var(--help-muted-color);
}

/* Unstyled list for search result items */
.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Search result row with bottom divider */
.search-results-list li {
    border-bottom: 1px solid var(--help-border-color);
    padding: 1rem 0;
}

/* Remove border from the last search result */
.search-results-list li:last-child {
    border-bottom: none;
}

/* Bold primary-colored link for each result */
.search-results-list a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--help-primary);
    text-decoration: none;
}

/* Underline result link on hover */
.search-results-list a:hover {
    text-decoration: underline;
}

/* Muted smaller text showing result metadata */
.search-results-list .result-meta {
    font-size: 0.85rem;
    color: var(--help-muted-color);
    margin-top: 0.25rem;
}

/* Centered contact page with responsive horizontal padding */
.contact-support-page {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2.5rem) var(--help-spacing);
}

/* Large rounded contact card with soft shadow */
.contact-support-card {
    background: var(--help-bg);
    border: 1px solid var(--help-border-color);
    border-radius: 1rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

/* Responsive heading size inside the contact card */
.contact-support-card h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
}

/* Muted intro paragraph inside the contact card */
.contact-support-card .lead {
    color: var(--help-muted-color);
    margin-bottom: 1.5rem;
}

/* Rounded inputs with themed border and padding */
.contact-support-card .form-control,
.contact-support-card .form-select {
    border-radius: 0.75rem;
    border-color: var(--help-border-color);
    padding: 0.85rem 1rem;
    background-color: var(--help-surface-color);
}

/* Medium-weight label text for form fields */
.contact-support-card .form-label {
    font-weight: 500;
    color: var(--help-text-color);
}

/* Minimum width for the submit button */
.contact-support-card button[type="submit"] {
    min-width: 180px;
}

/* Reduce padding on small screens for the contact card and page */
@media (max-width: 576px) {
    .contact-support-card {
        padding: 1.5rem;
    }

    .contact-support-page {
        padding: 1rem;
    }
}

/* Unstyled list for help category links */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Category row with bottom divider */
.category-list li {
    border-bottom: 1px solid var(--help-border-color);
    padding: 0.75rem 0;
}

/* Remove border from the last category item */
.category-list li:last-child {
    border-bottom: none;
}

/* Medium-weight primary-colored category link */
.category-list a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--help-primary);
    text-decoration: none;
}

/* Underline category link on hover */
.category-list a:hover {
    text-decoration: underline;
}

/* Small muted metadata text below article titles */
.article-meta {
    font-size: 0.85rem;
    color: var(--help-muted-color);
    margin-bottom: 1rem;
}

/* Flex row for previous/next article links */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: var(--help-spacing);
    padding-top: 1rem;
    border-top: 1px solid var(--help-border-color);
}

/* Dark theme overrides for Bootstrap utilities often used in help content */

/* Ensure help container text uses the themed color */
html[data-bs-theme="dark"] .help-container,
body.dark-theme .help-container {
    color: var(--help-text-color);
}

/* Themed backgrounds for cards, headers, and list items in dark mode */
html[data-bs-theme="dark"] .help-container .card,
body.dark-theme .help-container .card,
html[data-bs-theme="dark"] .help-container .card-header,
body.dark-theme .help-container .card-header,
html[data-bs-theme="dark"] .help-container .list-group-item,
body.dark-theme .help-container .list-group-item {
    background-color: var(--help-bg) !important;
    color: var(--help-text-color) !important;
    border-color: var(--help-border-color) !important;
}

/* Themed light utility classes in dark mode */
html[data-bs-theme="dark"] .help-container .bg-light,
body.dark-theme .help-container .bg-light,
html[data-bs-theme="dark"] .help-container .badge.bg-light,
body.dark-theme .help-container .badge.bg-light,
html[data-bs-theme="dark"] .help-container .btn-light,
body.dark-theme .help-container .btn-light {
    background-color: var(--help-bg) !important;
    color: var(--help-text-color) !important;
    border-color: var(--help-border-color) !important;
}

/* Ensure dark text utility switches to themed color */
html[data-bs-theme="dark"] .help-container .text-dark,
body.dark-theme .help-container .text-dark {
    color: var(--help-text-color) !important;
}

/* Themed muted text and result metadata in dark mode */
html[data-bs-theme="dark"] .help-container .text-muted,
body.dark-theme .help-container .text-muted,
html[data-bs-theme="dark"] .help-container .result-meta,
body.dark-theme .help-container .result-meta {
    color: var(--help-muted-color) !important;
}

/* Themed warning alert background and text in dark mode */
html[data-bs-theme="dark"] .help-container .alert-warning,
body.dark-theme .help-container .alert-warning {
    background-color: var(--help-callout-warning-bg);
    border-color: var(--help-callout-warning-border);
    color: var(--help-callout-warning-text);
}

/* Themed info alert background and text in dark mode */
html[data-bs-theme="dark"] .help-container .alert-info,
body.dark-theme .help-container .alert-info {
    background-color: var(--help-callout-info-bg);
    border-color: var(--help-callout-info-border);
    color: var(--help-callout-info-text);
}
