/**
 * Help Center Styles
 * Facebook-style design for Niriv Help Center
 */

/* Help Center Global Styles - Using scoped class to avoid conflicts */
body.niriv-help-page {
    background-color: #f5f5f5 !important;
}

/* Hide global header and footer for help center pages - scoped with .niriv-help-page */
body.niriv-help-page .site-header,
body.niriv-help-page .site-footer,
body.niriv-help-page header:not(.help-header):not(.help-footer),
body.niriv-help-page footer:not(.help-header footer):not(.help-footer),
body.niriv-help-page #sidebar:not(.help-sidebar),
body.niriv-help-page .sticky-header-menu,
body.niriv-help-page .mobile-footer-menu,
body.niriv-help-page .scrollable-menu,
body.niriv-help-page .mobile-menu,
body.niriv-help-page .header-menu,
body.niriv-help-page nav:not(.help-header nav):not(.help-sidebar nav),
body.niriv-help-page .navigation,
body.niriv-help-page .footer-menu,
body.niriv-help-page .sticky-footer-menu,
body.niriv-help-page .bottom-nav,
body.niriv-help-page .fixed-bottom:not(.help-header .fixed-bottom):not(.help-sidebar .fixed-bottom),
body.niriv-help-page .mobile-bottom-nav,
body.niriv-help-page .footer-sticky,
body.niriv-help-page .sticky-footer,
body.niriv-help-page .footer-mobile,
body.niriv-help-page .mobile-nav,
body.niriv-help-page .bottom-menu,
body.niriv-help-page .mobile-menu-bottom,
body.niriv-help-page #mobile-footer-menu:not(.help-header #mobile-footer-menu):not(.help-sidebar #mobile-footer-menu),
body.niriv-help-page #mobile-menu-trigger-btn {
    display: none !important;
}

body.niriv-help-page .site-main {
    margin: 0 !important;
    padding: 0 !important;
}

/* Help Header Layout */
.help-header {
    width: 100%;
}

.help-header > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 768px) {
    .help-header > div {
        padding-left: 24px;
        padding-right: 24px;
    }
}

.help-header .flex-shrink-0 {
    display: flex;
    align-items: center;
}

@media (max-width: 767px) {
    .help-header > div {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Help Content Container - Centered with margins */
.help-content {
    width: 100%;
    margin: 0;
    padding: 0;
    padding-bottom: 0;
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Desktop: Account for sidebar and center content */
@media (min-width: 768px) {
    .help-content {
        margin-left: 288px;
        width: calc(100% - 288px);
        max-width: none;
    }
}

/* Large desktop: Center content with max-width */
@media (min-width: 1024px) {
    .help-content {
        margin-left: 288px;
        width: calc(100% - 288px);
        max-width: none;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Hero Heading - White card with bottom radius, touches header */
.help-hero-heading {
    background: #ffffff;
    border-radius: 0 0 30px 30px;
    padding: 20px 16px 24px;
    margin-top: 0;
    margin-bottom: 24px;
    -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
}

/* Single help article: Add inner top padding to hero heading */
body.single-help_article .help-hero-heading,
.single-help_article .help-hero-heading {
    padding-top: 32px;
}

@media (min-width: 768px) {
    body.single-help_article .help-hero-heading,
    .single-help_article .help-hero-heading {
        padding-top: 40px;
    }
}

/* Heading text spacing */
.help-hero-heading h1,
.help-hero-heading h2 {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 16px;
    line-height: 1.2;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Mobile: Add top padding to heading text in single help article */
@media (max-width: 767px) {
    .help-hero-heading .help-article-title h1 {
        margin-top: 0;
        padding-top: 16px;
    }
    
    .help-hero-heading h1,
    .help-hero-heading h2 {
        margin-top: 0;
        padding-top: 16px;
    }
}

@media (min-width: 768px) {
    .help-hero-heading h1,
    .help-hero-heading h2 {
        font-size: 32px;
    }
}

.help-hero-heading .help-article-title {
    padding-top: 16px;
    margin-top: 0;
}

@media (min-width: 768px) {
    .help-hero-heading h1,
    .help-hero-heading h2 {
        margin-top: 0;
        padding-top: 20px;
    }
    
    .help-hero-heading .help-article-title {
        padding-top: 20px;
        margin-top: 0;
    }
}

@media (min-width: 768px) {
    .help-hero-heading {
        margin-top: 56px;
        padding: 32px 48px 40px;
        margin-left: 32px;
        margin-right: 32px;
        border-radius: 0 0 30px 30px;
        margin-bottom: 32px;
        max-width: calc(100% - 64px);
        width: calc(100% - 64px);
        box-sizing: border-box;
        position: relative;
    }
}

@media (min-width: 1024px) {
    .help-hero-heading {
        max-width: 900px;
        width: 900px;
        margin-left: auto;
        margin-right: auto;
        padding-top: 32px;
        padding-bottom: 40px;
        padding-left: 48px;
        padding-right: 48px;
        box-sizing: border-box;
        position: relative;
    }
}

/* Breadcrumbs positioning - before hero heading */
.help-content .help-breadcrumbs {
    padding: 20px 20px 0;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .help-content .help-breadcrumbs {
        padding-left: 80px;
        padding-right: 80px;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (min-width: 1024px) {
    .help-content .help-breadcrumbs {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 48px;
        padding-right: 48px;
    }
}

/* Content after hero heading */
.help-content > *:not(.help-hero-heading):not(.help-breadcrumbs):not(.help-content-card):not(.help-footer) {
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .help-content > *:not(.help-hero-heading):not(.help-breadcrumbs):not(.help-content-card):not(.help-footer) {
        margin-left: 32px;
        margin-right: 32px;
        padding-left: 48px;
        padding-right: 48px;
        max-width: calc(100% - 64px);
        width: calc(100% - 64px);
        box-sizing: border-box;
    }
}

@media (min-width: 1024px) {
    .help-content > *:not(.help-hero-heading):not(.help-breadcrumbs):not(.help-content-card):not(.help-footer) {
        max-width: 900px;
        width: 900px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 48px;
        padding-right: 48px;
        box-sizing: border-box;
    }
}

/* Center content within help-content container - removed conflicting max-width */

/* Content elements inherit positioning from parent, no additional centering needed */

/* Search Bar in Main Content */
.help-content .help-search-bar {
    width: 100%;
    padding: 14px 20px 14px 52px;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    font-size: 16px;
    background: #f9fafb;
    transition: all 0.2s;
}

.help-content .help-search-bar:focus {
    outline: none;
    background: white;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.help-content .help-search-container {
    position: relative;
    width: 100%;
}

.help-content .help-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
}

/* Sidebar Styles */
.help-sidebar {
    width: 288px;
    background: white;
    border-right: 1px solid #e5e7eb;
    box-shadow: 1px 0 2px rgba(0,0,0,0.02);
}

.help-category-toggle {
    font-size: 14px;
    font-weight: 500;
}

.help-category-toggle:hover {
    background-color: #f9fafb;
}

.help-category-toggle.bg-blue-50 {
    background-color: #eff6ff;
    color: #2563eb;
}

.help-category-articles {
    max-height: 500px;
    overflow-y: auto;
}

.help-category-articles a {
    font-size: 13px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-category-articles a i {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.help-category-toggle i[data-lucide="hash"] {
    flex-shrink: 0;
}

.help-category-articles a:hover {
    background-color: #f9fafb;
}

.help-category-articles a.bg-blue-50 {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

/* Popular Topics Cards */
.popular-topic-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
}

.popular-topic-card:hover {
    transform: translateY(-2px);
    -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
}

.popular-topic-icon {
    transition: transform 0.2s ease;
}

.popular-topic-card:hover .popular-topic-icon {
    transform: scale(1.1);
}

/* Search Bar */
.help-search-bar {
    transition: all 0.2s ease;
}

.help-search-bar::placeholder {
    color: #9ca3af;
}

/* Article Content */
.help-content-card .help-article-content {
    margin-top: 0;
}

.help-article-content {
    line-height: 1.75;
}

.help-article-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 16px;
    color: #1f2937;
}

.help-article-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
    color: #374151;
}

.help-article-content p {
    margin-bottom: 16px;
    color: #4b5563;
}

.help-article-content ul,
.help-article-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
    color: #4b5563;
}

.help-article-content li {
    margin-bottom: 8px;
}

.help-article-content a {
    color: #2563eb;
    text-decoration: none;
}

.help-article-content a:hover {
    text-decoration: underline;
}

/* Help Content Card - wraps all content including helpful buttons */
.help-content-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
    margin-bottom: 24px;
    -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .help-content-card {
        padding: 16px;
        margin-top: 16px;
        margin-bottom: 16px;
    }
}

@media (min-width: 768px) {
    .help-content-card {
        width: calc(100% - 64px);
        max-width: calc(100% - 64px);
        margin-left: 32px;
        margin-right: 32px;
        padding: 32px 48px;
        box-sizing: border-box;
        position: relative;
    }
}

@media (min-width: 1024px) {
    .help-content-card {
        width: 900px;
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
        padding: 32px 48px;
        box-sizing: border-box;
        position: relative;
    }
}

.help-feedback-wrapper {
    margin-top: 32px;
}

/* Step-by-step Instructions */
.help-steps {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 24px 0;
    -webkit-box-shadow: none;
    box-shadow: none;
}

.help-step {
    position: relative;
    padding-bottom: 16px;
}

.help-step:last-child {
    padding-bottom: 0;
}

.help-step-number {
    font-weight: 600;
    font-size: 14px;
}

/* Troubleshooting Section */
.help-troubleshooting {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    padding: 16px;
    margin: 24px 0;
}

.help-troubleshooting ul {
    margin-top: 12px;
}

.help-troubleshooting li {
    margin-bottom: 8px;
    padding-left: 0;
}

/* Related Articles */
.help-related-articles {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-top: 32px;
    -webkit-box-shadow: none;
    box-shadow: none;
}

.help-related-articles ul {
    margin-top: 16px;
}

.help-related-articles li {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.help-related-articles li:last-child {
    border-bottom: none;
}

.help-related-articles a {
    display: block;
    padding: 4px 0;
}

/* Info Note Box */
.help-content-card .help-note {
    margin-top: 0;
}

.help-note {
    background: #f3f4f6;
    border-left: 4px solid #6b7280;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.help-note strong {
    font-weight: 600;
    color: #1f2937;
}

/* Platform Tabs */
.help-content-card .help-platform-tabs {
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
    margin-top: 0;
}

.help-platform-tabs {
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
}

.help-platform-tab {
    padding: 12px 20px;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    position: relative;
}

.help-platform-tab.active {
    border-bottom-color: #2563eb;
    font-weight: 600;
}

/* Copy Link Button */
.help-copy-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-copy-link:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.help-copy-link:active {
    transform: scale(0.98);
}

/* Breadcrumbs */
.help-breadcrumbs {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

.help-breadcrumbs a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.15s ease;
}

.help-breadcrumbs a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .help-sidebar {
        width: 288px;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    }
    
    .help-header {
        height: 56px;
    }
    
    .help-content {
        padding: 0 !important;
        margin-left: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-top: 0 !important;
    }
    
    .help-hero-heading {
        margin-top: 56px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        text-align: center;
    }
    
    .help-hero-heading h1,
    .help-hero-heading h2 {
        text-align: center;
    }
    
    .help-hero-heading .help-article-title {
        justify-content: center;
        text-align: center;
    }
    
    .help-hero-heading .help-article-title h1 {
        text-align: center;
    }
    
    .help-content-card {
        margin-left: 8px !important;
        margin-right: 8px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
        box-sizing: border-box;
    }
    
    .help-content > *:not(.help-hero-heading):not(.help-breadcrumbs):not(.help-content-card):not(.help-footer) {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    .help-footer {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .help-article-title {
        font-size: 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .popular-topics-grid {
        grid-template-columns: 1fr;
    }
    
    .help-platform-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .help-platform-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .help-platform-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Sidebar Overlay (Mobile) */
.help-sidebar-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 59;
    transition: opacity 0.3s ease;
}

/* Search Results */
#help-search-results {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
    -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
}

#help-search-results-list a {
    display: block;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}

/* Help Center Footer - Separate class to avoid CSS conflicts */
.help-footer {
    width: 100%;
    margin-top: 0;
    padding: 0;
    padding-top: 64px;
    position: relative;
    background-color: #f5f5f5;
    display: block !important;
    visibility: visible !important;
    box-sizing: border-box;
}

.help-footer-container {
    width: 100%;
    margin: 0 auto;
    padding: 32px 20px;
    background: #ffffff;
    border-radius: 0;
    border: none;
    border-top: 1px solid #e5e7eb;
    -webkit-box-shadow: none;
    box-shadow: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .help-footer {
        margin-left: calc(288px + 32px) !important;
        margin-right: 32px !important;
        width: calc(100% - 288px - 64px) !important;
        max-width: calc(100% - 288px - 64px) !important;
        box-sizing: border-box;
        position: relative;
        margin-top: 0 !important;
        padding-top: 64px !important;
        margin-bottom: 0;
    }
    
    .help-footer-container {
        padding: 48px 64px;
        border-radius: 16px 16px 0 0;
        border: 1px solid #e5e7eb;
        border-bottom: none;
        -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
        box-shadow: 0 2px 4px 0 rgba(0,0,0,0.04);
        box-sizing: border-box;
        width: 100%;
        margin: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

@media (min-width: 1024px) {
    .help-footer {
        max-width: 900px !important;
        width: 900px !important;
        margin-left: calc(288px + ((100vw - 288px - 900px) / 2)) !important;
        margin-right: auto !important;
        margin-top: 0 !important;
        padding-top: 64px !important;
        margin-bottom: 0;
        box-sizing: border-box;
        position: relative;
    }
    
    .help-footer-container {
        width: 100%;
        margin: 0;
    }
}

@media (max-width: 767px) {
    .help-footer {
        padding: 20px 0 !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .help-footer-container {
        padding: 20px;
        padding-bottom: 20px;
        border-radius: 0;
        margin-bottom: 0;
        width: 100%;
    }
    
    body.niriv-help-page {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .help-content {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }
}

/* Footer content styles */
.help-footer-container > * {
    width: 100%;
    max-width: 100%;
}

.help-footer .space-y-2 {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.help-footer .space-y-2 > * + * {
    margin-top: 0.5rem;
}

.help-footer a {
    transition: color 0.15s ease;
}

.help-footer a:hover {
    text-decoration: underline;
}

#help-search-results-list a:last-child {
    border-bottom: none;
}

#help-search-results-list a:hover {
    background-color: #f9fafb;
}

#help-search-results-list h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1f2937;
}

#help-search-results-list p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Feedback Widget (Already in global-report-system.php, but additional styling if needed) */
.niriv-helpful-container {
    margin-top: 32px;
    margin-bottom: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

