/* ── Statux Help Center Layout ──
 * Sidebar + content layout for multi-page help centers.
 * Loaded via: <link rel="stylesheet" href="/shared/styles/help.css">
 * Must be loaded AFTER common.css and tailwind-output.css.
 */

/* ── Layout Grid ── */

.help-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 4rem); /* subtract nav height */
}

/* ── Sidebar ── */

#help-sidebar {
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    overflow-y: auto;
    position: sticky;
    top: 4rem;
    height: calc(100vh - 4rem);
}

.dark #help-sidebar {
    background: #1f2937;
    border-right-color: #374151;
}

/* Back to home link */
.help-sidebar-home {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.help-sidebar-home:hover {
    color: #2563eb;
}

.dark .help-sidebar-home {
    color: #9ca3af;
}

.dark .help-sidebar-home:hover {
    color: #60a5fa;
}

.help-sidebar-home svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Section group */
.help-sidebar-section {
    margin-bottom: 0.5rem;
}

.help-sidebar-heading {
    padding: 0.375rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.dark .help-sidebar-heading {
    color: #6b7280;
}

/* Nav items */
.help-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 1.25rem 0.4375rem 1.5rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.help-sidebar-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.dark .help-sidebar-item {
    color: #d1d5db;
}

.dark .help-sidebar-item:hover {
    background: #374151;
    color: #f9fafb;
}

/* Active state */
.help-sidebar-item.active {
    background: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 500;
}

.dark .help-sidebar-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: #60a5fa;
    border-left-color: #60a5fa;
}

.help-sidebar-item svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    opacity: 0.6;
}

.help-sidebar-item.active svg {
    opacity: 1;
}

/* ── Dark Mode Toggle (in nav) ── */

.help-dark-toggle {
    padding: 0.5rem;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-dark-toggle:hover {
    color: #2563eb;
}

.dark .help-dark-toggle {
    color: #9ca3af;
}

.dark .help-dark-toggle:hover {
    color: #60a5fa;
}

.help-dark-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Show moon in light mode, sun in dark mode */
.help-dark-toggle .icon-sun { display: none; }
.help-dark-toggle .icon-moon { display: block; }
.dark .help-dark-toggle .icon-sun { display: block; }
.dark .help-dark-toggle .icon-moon { display: none; }

/* ── Main Content ── */

.help-content {
    padding: 2rem 3rem 4rem;
    max-width: 52rem;
}

.help-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.dark .help-content h1 {
    color: #f9fafb;
}

.help-content .help-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.dark .help-content .help-subtitle {
    color: #9ca3af;
}

/* ── Dark Mode Prose Overrides ──
 * Tailwind CDN doesn't include the typography plugin, so
 * dark:prose-invert doesn't work. These explicit rules ensure
 * readable text in dark mode.
 */

.dark .help-content .prose h2,
.dark .help-content .prose h3,
.dark .help-content .prose h4 {
    color: #f3f4f6;
}

.dark .help-content .prose p,
.dark .help-content .prose li,
.dark .help-content .prose td,
.dark .help-content .prose th {
    color: #d1d5db;
}

.dark .help-content .prose a {
    color: #60a5fa;
}

.dark .help-content .prose a:hover {
    color: #93c5fd;
}

.dark .help-content .prose strong {
    color: #f3f4f6;
}

.dark .help-content .prose code {
    background: #374151;
    color: #e5e7eb;
}

.dark .help-content .prose blockquote {
    color: #9ca3af;
    border-left-color: #4b5563;
}

.dark .help-content .prose hr {
    border-color: #374151;
}

/* List markers */
.dark .help-content .prose ul {
    color: #d1d5db;
}

.dark .help-content .prose ol {
    color: #d1d5db;
}

/* Breadcrumb */
.help-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.help-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.help-breadcrumb a:hover {
    color: #2563eb;
}

.dark .help-breadcrumb a {
    color: #9ca3af;
}

.dark .help-breadcrumb a:hover {
    color: #60a5fa;
}

/* Quick-link cards (index page) */
.help-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.help-card {
    display: block;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.help-card:hover {
    border-color: #2563eb;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

.dark .help-card {
    background: #1f2937;
    border-color: #374151;
}

.dark .help-card:hover {
    border-color: #60a5fa;
}

.help-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.dark .help-card-title {
    color: #f9fafb;
}

.help-card-desc {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

.dark .help-card-desc {
    color: #9ca3af;
}

/* Info/tip callouts */
.help-callout {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.help-callout-info {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    color: #1e40af;
}

.dark .help-callout-info {
    background: rgba(37, 99, 235, 0.1);
    border-left-color: #60a5fa;
    color: #93c5fd;
}

.help-callout-tip {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    color: #166534;
}

.dark .help-callout-tip {
    background: rgba(22, 163, 74, 0.1);
    border-left-color: #4ade80;
    color: #86efac;
}

.help-callout-warning {
    background: #fffbeb;
    border-left: 4px solid #d97706;
    color: #92400e;
}

.dark .help-callout-warning {
    background: rgba(217, 119, 6, 0.1);
    border-left-color: #fbbf24;
    color: #fcd34d;
}

/* ── Mobile Drawer ── */

.help-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 40;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    align-items: center;
    justify-content: center;
}

.help-mobile-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.help-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .help-layout {
        grid-template-columns: 1fr;
    }

    #help-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 35;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        padding-top: 1rem;
    }

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

    .help-overlay.open {
        display: block;
    }

    .help-mobile-toggle {
        display: flex;
    }

    .help-content {
        padding: 1.5rem 1rem 4rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .help-layout {
        grid-template-columns: 240px 1fr;
    }

    .help-content {
        padding: 2rem 2rem 4rem;
    }
}

/* ── Footer (inside help) ── */

.help-footer {
    border-top: 1px solid #e5e7eb;
    padding: 2rem 0;
    margin-top: 3rem;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.dark .help-footer {
    border-top-color: #374151;
}

.help-footer a {
    color: #6b7280;
    text-decoration: none;
}

.help-footer a:hover {
    color: #2563eb;
}

.dark .help-footer a {
    color: #9ca3af;
}

.dark .help-footer a:hover {
    color: #60a5fa;
}
