/* Help Center Modal Styles */

/* Help Icon - Matches existing .xp-info-icon pattern */
.help-icon {
    position: absolute;
    top: var(--spacing-2, 8px);
    right: var(--spacing-2, 8px);
    background: none;
    border: none;
    color: var(--color-text-muted, #6b7280);
    cursor: pointer;
    padding: var(--spacing-1, 4px);
    font-size: var(--font-size-sm, 0.875rem);
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.help-icon:hover {
    color: var(--color-primary, #1e40af);
    background-color: var(--color-surface-elevated, rgba(0, 0, 0, 0.05));
}

.help-icon:focus {
    outline: 2px solid var(--color-primary, #1e40af);
    outline-offset: 2px;
}

/* Dark mode support for help icon */
[data-theme="dark"] .help-icon {
    color: var(--color-text-muted, #9ca3af);
}

[data-theme="dark"] .help-icon:hover {
    color: var(--color-primary-light, #60a5fa);
    background-color: var(--color-surface-elevated, rgba(255, 255, 255, 0.1));
}

/* Deactivated topics/articles - red border for admin visibility */
.help-deactivated {
    border: 2px solid #dc2626 !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.3);
}

[data-theme="dark"] .help-deactivated {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3);
}

/* Modal Container */
.help-center-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.help-center-modal.show {
    display: flex !important; /* Override inline style="display: none" */
    align-items: center;
    justify-content: center;
}

/* Modal Overlay */
.help-center-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.help-center-modal-content {
    position: relative;
    background: var(--color-surface, #ffffff);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border, #e5e7eb);
}

[data-theme="dark"] .help-center-modal-content {
    background: var(--color-surface, #1f2937);
    border-color: var(--color-border, #374151);
}

/* Modal Header */
.help-center-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--color-primary, #1e40af) 0%, var(--color-primary-dark, #1e3a8a) 100%);
    color: white;
}

.help-center-modal-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-center-header-icon {
    font-size: 1.5rem;
}

.help-center-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.help-center-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.help-center-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Breadcrumb Navigation */
.help-center-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-surface-elevated, #f9fafb);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    flex-wrap: wrap;
}

[data-theme="dark"] .help-center-breadcrumb {
    background: var(--color-surface-elevated, #111827);
    border-bottom-color: var(--color-border, #374151);
}

.help-breadcrumb-item {
    background: none;
    border: none;
    color: var(--color-primary, #1e40af);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-breadcrumb-item:hover {
    background: var(--color-primary, #1e40af);
    color: white;
}

.help-breadcrumb-item.help-breadcrumb-current {
    color: var(--color-text-muted, #6b7280);
    cursor: default;
}

.help-breadcrumb-item.help-breadcrumb-current:hover {
    background: none;
    color: var(--color-text-muted, #6b7280);
}

.help-breadcrumb-separator {
    color: var(--color-text-muted, #9ca3af);
    font-size: 0.75rem;
}

/* Modal Body */
.help-center-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 300px;
}

/* Loading State */
.help-center-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--color-text-muted, #6b7280);
}

.help-center-loading i {
    font-size: 2rem;
    color: var(--color-primary, #1e40af);
}

/* Error State */
.help-center-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    text-align: center;
    color: var(--color-error, #ef4444);
}

.help-center-error i {
    font-size: 2.5rem;
}

.help-center-retry-btn {
    margin-top: 8px;
    padding: 8px 16px;
    background: var(--color-primary, #1e40af);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.help-center-retry-btn:hover {
    background: var(--color-primary-dark, #1e3a8a);
}

/* Topics Grid */
.help-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.help-topic-card {
    background: var(--color-surface-elevated, #f9fafb);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.help-topic-card:hover {
    border-color: var(--color-primary, #1e40af);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.15);
    transform: translateY(-2px);
}

[data-theme="dark"] .help-topic-card {
    background: var(--color-surface-elevated, #111827);
    border-color: var(--color-border, #374151);
}

[data-theme="dark"] .help-topic-card:hover {
    border-color: var(--color-primary-light, #60a5fa);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.15);
}

.help-topic-icon {
    font-size: 2rem;
    color: var(--color-primary, #1e40af);
    margin-bottom: 12px;
}

[data-theme="dark"] .help-topic-icon {
    color: var(--color-primary-light, #60a5fa);
}

.help-topic-card h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text, #111827);
}

[data-theme="dark"] .help-topic-card h3 {
    color: var(--color-text, #f9fafb);
}

.help-topic-card p {
    margin: 0 0 8px 0;
    font-size: 0.875rem;
    color: var(--color-text-muted, #6b7280);
    line-height: 1.4;
}

.help-topic-article-count {
    font-size: 0.75rem;
    color: var(--color-text-muted, #9ca3af);
}

/* Topic Detail View */
.help-topic-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

[data-theme="dark"] .help-topic-header {
    border-bottom-color: var(--color-border, #374151);
}

.help-topic-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-topic-header-icon {
    font-size: 1.5rem;
    color: var(--color-primary, #1e40af);
}

[data-theme="dark"] .help-topic-header-icon {
    color: var(--color-primary-light, #60a5fa);
}

.help-topic-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text, #111827);
}

[data-theme="dark"] .help-topic-header h3 {
    color: var(--color-text, #f9fafb);
}

.help-topic-header p {
    margin: 8px 0 0 0;
    color: var(--color-text-muted, #6b7280);
}

/* Articles List */
.help-articles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-article-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-surface-elevated, #f9fafb);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-article-item:hover {
    border-color: var(--color-primary, #1e40af);
    background: var(--color-surface, #ffffff);
}

[data-theme="dark"] .help-article-item {
    background: var(--color-surface-elevated, #111827);
    border-color: var(--color-border, #374151);
}

[data-theme="dark"] .help-article-item:hover {
    border-color: var(--color-primary-light, #60a5fa);
    background: var(--color-surface, #1f2937);
}

.help-article-item i {
    color: var(--color-primary, #1e40af);
    font-size: 0.875rem;
}

[data-theme="dark"] .help-article-item i {
    color: var(--color-primary-light, #60a5fa);
}

.help-article-item span {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--color-text, #111827);
}

[data-theme="dark"] .help-article-item span {
    color: var(--color-text, #f9fafb);
}

.help-article-item .fa-chevron-right {
    color: var(--color-text-muted, #9ca3af);
    font-size: 0.75rem;
}

/* Modal Article View - matches help-center-main from full page */
.help-center-modal-article {
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 12px;
    padding: 24px;
}

[data-theme="dark"] .help-center-modal-article {
    background: var(--color-surface, #1f2937);
    border-color: var(--color-border, #374151);
}

.help-center-modal-article .help-article-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

[data-theme="dark"] .help-center-modal-article .help-article-header {
    border-bottom-color: var(--color-border, #374151);
}

.help-center-modal-article .help-article-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text, #111827);
}

[data-theme="dark"] .help-center-modal-article .help-article-header h1 {
    color: var(--color-text, #f9fafb);
}

/* Article Content View */
.help-article-content {
    line-height: 1.7;
    color: var(--color-text, #374151);
}

[data-theme="dark"] .help-article-content {
    color: var(--color-text, #d1d5db);
}

.help-article-content h1,
.help-article-content h2,
.help-article-content h3,
.help-article-content h4,
.help-article-content h5,
.help-article-content h6 {
    color: var(--color-text, #111827);
    margin-top: 24px;
    margin-bottom: 12px;
}

[data-theme="dark"] .help-article-content h1,
[data-theme="dark"] .help-article-content h2,
[data-theme="dark"] .help-article-content h3,
[data-theme="dark"] .help-article-content h4,
[data-theme="dark"] .help-article-content h5,
[data-theme="dark"] .help-article-content h6 {
    color: var(--color-text, #f9fafb);
}

.help-article-content h1:first-child,
.help-article-content h2:first-child,
.help-article-content h3:first-child {
    margin-top: 0;
}

.help-article-content p {
    margin-bottom: 16px;
}

.help-article-content ul,
.help-article-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.help-article-content li {
    margin-bottom: 8px;
}

.help-article-content code {
    background: var(--color-surface-elevated, #f3f4f6);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
}

[data-theme="dark"] .help-article-content code {
    background: var(--color-surface-elevated, #374151);
}

.help-article-content pre {
    background: var(--color-surface-elevated, #f3f4f6);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

[data-theme="dark"] .help-article-content pre {
    background: var(--color-surface-elevated, #111827);
}

.help-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.help-article-content a {
    color: var(--color-primary, #1e40af);
    text-decoration: none;
}

.help-article-content a:hover {
    text-decoration: underline;
}

[data-theme="dark"] .help-article-content a {
    color: var(--color-primary-light, #60a5fa);
}

.help-article-content blockquote {
    border-left: 4px solid var(--color-primary, #1e40af);
    margin: 16px 0;
    padding: 12px 20px;
    background: var(--color-surface-elevated, #f9fafb);
    border-radius: 0 8px 8px 0;
}

[data-theme="dark"] .help-article-content blockquote {
    border-left-color: var(--color-primary-light, #60a5fa);
    background: var(--color-surface-elevated, #111827);
}

.help-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.help-article-content th,
.help-article-content td {
    padding: 12px;
    border: 1px solid var(--color-border, #e5e7eb);
    text-align: left;
}

[data-theme="dark"] .help-article-content th,
[data-theme="dark"] .help-article-content td {
    border-color: var(--color-border, #374151);
}

.help-article-content th {
    background: var(--color-surface-elevated, #f3f4f6);
    font-weight: 600;
}

[data-theme="dark"] .help-article-content th {
    background: var(--color-surface-elevated, #1f2937);
}

/* Modal Footer */
.help-center-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-surface-elevated, #f9fafb);
    text-align: center;
}

[data-theme="dark"] .help-center-modal-footer {
    background: var(--color-surface-elevated, #111827);
    border-top-color: var(--color-border, #374151);
}

.help-center-full-page-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary, #1e40af);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.help-center-full-page-link:hover {
    color: var(--color-primary-dark, #1e3a8a);
}

[data-theme="dark"] .help-center-full-page-link {
    color: var(--color-primary-light, #60a5fa);
}

[data-theme="dark"] .help-center-full-page-link:hover {
    color: var(--color-primary, #93c5fd);
}

/* Empty State */
.help-center-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted, #6b7280);
}

.help-center-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.help-center-empty p {
    margin: 0;
    font-size: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .help-center-modal-content {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .help-topics-grid {
        grid-template-columns: 1fr;
    }
    
    .help-center-breadcrumb {
        padding: 10px 16px;
    }
    
    .help-center-modal-body {
        padding: 16px;
    }
}

/* Help Center Full Page Styles */
.help-center-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.help-center-page-header {
    margin-bottom: 32px;
}

.help-center-page-header h1 {
    margin: 0 0 8px 0;
    font-size: 2rem;
    color: var(--color-text, #111827);
}

[data-theme="dark"] .help-center-page-header h1 {
    color: var(--color-text, #f9fafb);
}

.help-center-page-header p {
    margin: 0;
    color: var(--color-text-muted, #6b7280);
    font-size: 1.125rem;
}

.help-center-page-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

.help-center-sidebar {
    background: var(--color-surface-elevated, #f9fafb);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 24px;
}

[data-theme="dark"] .help-center-sidebar {
    background: var(--color-surface-elevated, #111827);
    border-color: var(--color-border, #374151);
}

.help-center-sidebar-topic {
    margin-bottom: 24px;
}

.help-center-sidebar-topic:last-child {
    margin-bottom: 0;
}

.help-center-sidebar-topic-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--color-text, #111827);
    margin-bottom: 12px;
    font-size: 0.9375rem;
}

[data-theme="dark"] .help-center-sidebar-topic-title {
    color: var(--color-text, #f9fafb);
}

.help-center-sidebar-topic-title i {
    color: var(--color-primary, #1e40af);
}

[data-theme="dark"] .help-center-sidebar-topic-title i {
    color: var(--color-primary-light, #60a5fa);
}

.help-center-sidebar-articles {
    list-style: none;
    margin: 0;
    padding: 0;
}

.help-center-sidebar-articles li {
    margin-bottom: 4px;
}

.help-center-sidebar-articles a {
    display: block;
    padding: 8px 12px;
    color: var(--color-text-muted, #6b7280);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.help-center-sidebar-articles a:hover,
.help-center-sidebar-articles a.active {
    background: var(--color-primary, #1e40af);
    color: white;
}

[data-theme="dark"] .help-center-sidebar-articles a:hover,
[data-theme="dark"] .help-center-sidebar-articles a.active {
    background: var(--color-primary-dark, #1e3a8a);
}

.help-center-main-content {
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 12px;
    padding: 32px;
}

[data-theme="dark"] .help-center-main-content {
    background: var(--color-surface, #1f2937);
    border-color: var(--color-border, #374151);
}

@media (max-width: 900px) {
    .help-center-page-content {
        grid-template-columns: 1fr;
    }
    
    .help-center-sidebar {
        position: static;
    }
}
