/* BOOKY AI — Help Article Styles */

.help-page-wrapper {
    padding-top: 60px;
    padding-bottom: 80px;
    min-height: 100vh;
    background: var(--bg-page);
}

.help-container-fluid {
    width: 100%;
    padding-right: 3rem;
    padding-left: 3rem;
    margin-right: auto;
    margin-left: auto;
}

/* 3 Column Grid Structure */
.help-grid {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 3rem;
    align-items: start;
}

/* Sidebars Base */
.article-sidebar-sticky {
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding-right: 1rem;
    border-right: 1px solid var(--border-default);
}

/* Left Sidebar - Navigation */
.sidebar-category-group {
    margin-bottom: 1.25rem;
}

.sidebar-category-toggle {
    background: transparent;
    border: none;
    outline: none;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base);
    text-align: left;
}

.sidebar-category-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--brand-light);
}

.category-arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    margin-left: 0.5rem;
}

.sidebar-category-group.collapsed .category-arrow {
    transform: rotate(-90deg);
}

.sidebar-category-group.collapsed .sidebar-nav-list {
    display: none;
}

/* Indented sub-list for category articles */
.sidebar-nav-list {
    list-style: none;
    padding-left: 1.15rem;
    margin: 0.35rem 0 0 0.5rem;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav-item {
    margin-bottom: 0.2rem;
}

.sidebar-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none !important;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 400;
    transition: all var(--transition-base);
}

.sidebar-nav-link:hover {
    background: var(--bg-card-raised);
    color: var(--text-primary);
}

.sidebar-nav-link.active {
    background: rgba(var(--brand-rgb), 0.15);
    color: var(--brand-light);
    font-weight: 600;
}

/* Main Content Area */
.article-main-container {
    max-width: 900px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 1rem;
}

.article-breadcrumb {
    margin-bottom: 1.5rem;
}

.breadcrumb-item, .breadcrumb-item a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--brand-light);
}

.article-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-bottom: 1rem;
}

/* Document Style Typography */
.article-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    scroll-margin-top: 140px; /* Offset for sticky nav */
}

.article-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 140px;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 3px solid var(--brand);
    padding: 1rem 1.5rem;
    background: var(--bg-card-raised);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    margin: 2rem 0;
    color: var(--text-primary);
}

/* --- Media Elements: Images, Videos, Embeds --- */

/* 1. Images */
.article-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 2rem auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-md);
    background-color: var(--bg-card-raised);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    cursor: zoom-in;
}

.article-content img:hover {
    border-color: rgba(var(--brand-rgb), 0.45);
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.45);
}

.article-content a:has(> img),
.article-content a > img {
    cursor: pointer;
}

/* Figures & Captions */
.article-content figure,
.article-figure {
    margin: 2.5rem auto;
    max-width: 100%;
    text-align: center;
}

.article-content figure img,
.article-figure img {
    margin: 0 auto 0.75rem auto;
}

.article-content figcaption,
.article-figure-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.65rem;
    line-height: 1.5;
    text-align: center;
    font-style: italic;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.article-content figcaption::before,
.article-figure-caption::before {
    content: "\e10e"; /* Phosphor camera */
    font-family: "Phosphor";
    font-weight: normal;
    font-size: 0.75rem;
    color: var(--brand-light);
    opacity: 0.8;
}

/* Broken image fallback placeholder */
.article-img-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1.5rem;
    background: var(--bg-card-raised);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 2rem auto;
    text-align: center;
}

.article-img-error i {
    font-size: 2.25rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* 2. Video Tags */
.article-content video,
.article-video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 2rem auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-md);
    background-color: #0b0f19;
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.article-content video:hover,
.article-video:hover {
    border-color: rgba(var(--brand-rgb), 0.45);
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.45);
}

.article-video-wrapper {
    position: relative;
    width: 100%;
    margin: 2rem auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-md);
    background-color: #0b0f19;
}

.article-video-wrapper video {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* 3. YouTube & Video Iframe Embeds */
.article-content iframe {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-md);
    background-color: #0b0f19;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.article-content iframe:hover {
    border-color: rgba(var(--brand-rgb), 0.45);
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.45);
}

/* Responsive Embed Container (Guaranteed 16:9 on all viewports) */
.article-embed-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 2rem auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-md);
    background-color: #0b0f19;
}

@supports (aspect-ratio: 16 / 9) {
    .article-embed-responsive {
        padding-bottom: 0;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

.article-embed-responsive iframe,
.article-embed-responsive object,
.article-embed-responsive embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Paragraph media wrapper cleanup */
.article-content p:has(> img),
.article-content p:has(> video),
.article-content p:has(> iframe),
.article-content p:has(> .article-embed-responsive),
.article-content p:has(> .article-video-wrapper) {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* 4. Lightbox Modal for Article Images */
.article-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: rgba(5, 10, 20, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.article-lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.article-lightbox-img {
    max-width: 92vw;
    max-height: 82vh;
    border-radius: var(--radius-md);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transform: scale(0.94);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    object-fit: contain;
}

.article-lightbox.active .article-lightbox-img {
    transform: scale(1);
}

.article-lightbox-caption {
    margin-top: 1rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.45rem 1.25rem;
    border-radius: var(--radius-full);
    backdrop-filter: blur(8px);
    max-width: 80vw;
}

.article-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
    z-index: 100000;
}

.article-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Right Sidebar - TOC */
.toc-container {
    border-left: 1px solid var(--border-default);
    padding-left: 1.5rem;
}

.toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

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

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-link {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none !important;
    transition: all var(--transition-base);
    line-height: 1.4;
    padding: 2px 0;
}

.toc-link:hover {
    color: var(--text-primary);
}

.toc-link.active {
    color: var(--brand-light);
    font-weight: 600;
}

.toc-h3 {
    padding-left: 1rem;
    font-size: 0.8rem;
}

/* Feedback Section */
.helpful-section {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-default);
    text-align: center;
}

.helpful-section p {
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.btn-feedback {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-base);
}

.btn-feedback:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-feedback.active {
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--brand-light);
    border-color: var(--brand-light);
}

.btn-feedback.active-negative {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border-color: #EF4444;
}

/* Custom Scrollbar */
.article-sidebar-sticky::-webkit-scrollbar {
    width: 4px;
}
.article-sidebar-sticky::-webkit-scrollbar-track {
    background: transparent;
}
.article-sidebar-sticky::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
}

/* Article Prev / Next Navigation */
.article-pagination-nav {
    border-top: 1px solid var(--border-default);
}

.article-nav-card {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background-color: var(--bg-card-raised);
    border: 1px solid var(--border-default);
    text-decoration: none !important;
    transition: all var(--transition-base);
    height: 100%;
}

.article-nav-card:hover {
    border-color: var(--brand);
    background-color: var(--bg-card);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-card-direction {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-light);
    margin-bottom: 0.25rem;
}

.nav-card-title {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

/* Mobile Sticky Trigger Bar */
.help-mobile-sticky-bar {
    position: sticky;
    top: 95px; /* Positioned directly under the sticky navbar */
    z-index: 1010;
    padding: 0.6rem 0;
    margin-bottom: 1.5rem;
    background-color: var(--bg-page);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.help-mobile-offcanvas {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.help-mobile-trigger {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.help-mobile-trigger:hover,
.help-mobile-trigger:focus {
    border-color: var(--brand);
    color: var(--brand-light);
    box-shadow: var(--shadow-md);
}

/* Responsive */
@media (max-width: 1400px) {
    .help-container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    .help-grid {
        grid-template-columns: 240px 1fr 240px;
        gap: 2rem;
    }
}

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

@media (max-width: 1100px) {
    .help-grid {
        grid-template-columns: 240px 1fr;
    }
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .help-grid {
        grid-template-columns: 1fr;
    }
    .left-sidebar {
        display: none;
    }
    .help-container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .article-title {
        font-size: 1.75rem;
    }
}
