/* Topic page specific styles */
.help-topic-container {
    max-width: 1200px;
    margin: 0 auto;
}

.topic-header {
    margin-bottom: 20px;
}

.breadcrumb-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: #8b5cf6;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #7c3aed;
    transform: translateX(-4px);
}

.back-link svg {
    margin-right: 8px;
}

.topic-search {
    display: flex;
    align-items: center;
}

.topic-search .search-box,
.mobile-search .search-box {
    position: relative;
    height: 36px;
}

.topic-search .search-input,
.mobile-search .search-input {
    height: 36px;
    padding: 6px 70px 6px 12px !important;
    font-size: 14px;
    line-height: 1.4;
}

.topic-search .search-btn,
.mobile-search .search-btn {
    height: 36px;
    width: 36px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Clear button styling */
.clear-btn,
.clear-btn-mobile {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    padding: 3px !important;
    height: 26px !important;
    width: 26px !important;
    background: transparent;
    border: none;
    display: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover svg,
.clear-btn-mobile:hover svg {
    fill: #ef4444;
}

.topic-title {
    font-size: 36px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.topic-number-text {
    color: #8b5cf6;
}

.mobile-search {
    display: none;
    margin-bottom: 15px;
}

/* Progress Bar */
.progress-bar-container {
    height: 4px;
    background-color: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #116dff 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* Topic Layout */
.topic-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 60px;
}

/* Content Styles */
.topic-content {
    min-width: 0;
}

.help-content {
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
}

.help-content h2 {
    font-size: 28px;
    font-weight: 600;
    color: #000;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.help-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: #000;
    margin-top: 32px;
    margin-bottom: 16px;
}

.help-content h4, .help-content h5, .help-content h6 {
    font-weight: 600;
    color: #000;
    margin-top: 24px;
    margin-bottom: 12px;
}

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

.help-content img {
    max-width: 100%;
    height: auto;
    margin: 24px auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.help-content ul, .help-content ol {
    margin: 16px 0;
    padding-left: 32px;
}

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

.help-content a {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.help-content a:hover {
    color: #7c3aed;
    text-decoration: underline;
}

.help-content code {
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.help-content pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.help-content blockquote {
    border-left: 4px solid #8b5cf6;
    padding-left: 20px;
    margin: 20px 0;
    color: #4b5563;
    font-style: italic;
}

/* Desktop Table of Contents */
.desktop-toc {
    display: block;
}

.toc-sticky {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 16px;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-link {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 14px;
    color: #6b7280;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.toc-link:hover {
    color: #000;
    background-color: #f9fafb;
}

.toc-link.active {
    color: #8b5cf6;
    background-color: #f3e8ff;
}

.toc-indicator {
    width: 3px;
    height: 16px;
    background-color: transparent;
    border-radius: 2px;
    margin-right: 12px;
    transition: all 0.3s ease;
}

.toc-link.active .toc-indicator {
    background-color: #8b5cf6;
}

/* Mobile Table of Contents */
.mobile-toc {
    display: none;
    margin-bottom: 30px;
}

.mobile-toc-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-toc-toggle:hover {
    background-color: #f3f4f6;
}

.mobile-toc-toggle svg {
    transition: transform 0.3s ease;
}

.mobile-toc-toggle.active svg {
    transform: rotate(180deg);
}

.mobile-toc-nav {
    margin-top: 8px;
    padding: 12px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.mobile-toc-link {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #6b7280;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-toc-link:hover {
    color: #000;
    background-color: #fff;
}

.mobile-toc-link.active {
    color: #8b5cf6;
    background-color: #f3e8ff;
}

/* Fix for details/summary arrow */
details summary::-webkit-details-marker {
    display: none;
}

details summary::marker {
    display: none;
}

/* Ensure the custom arrow is positioned correctly */
details summary {
    list-style: none;
}

details summary::-webkit-details-marker,
details summary::marker {
    display: none;
}

/* Style the details container properly */
.mobile-toc details {
    border: none;
}

.mobile-toc summary {
    outline: none;
    cursor: pointer;
}

/* Ensure Tailwind-like classes work */
.mobile-toc .group-open\:rotate-180 {
    transition: transform 0.3s ease;
}

details[open] .group-open\:rotate-180 {
    transform: rotate(180deg);
}

/* Navigation Cards */
.topic-navigation {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e5e7eb;
}

.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.nav-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-card:hover {
    background-color: #f3e8ff;
    border-color: #8b5cf6;
    transform: translateY(-2px);
}

.nav-card.prev {
    text-align: left;
}

.nav-card.next {
    text-align: right;
}

.nav-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 8px;
}

.nav-title {
    font-size: 16px;
    font-weight: 500;
    color: #000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-card.next .nav-title {
    justify-content: flex-end;
}

.help-cta {
    text-align: center;
    padding: 24px;
    background-color: #f3e8ff;
    border-radius: 8px;
}

.help-cta p {
    margin: 0;
    font-size: 16px;
    color: #374151;
}

.cta-link {
    color: #8b5cf6;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cta-link:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .topic-layout {
        grid-template-columns: 1fr;
    }
    
    .desktop-toc {
        display: none;
    }
    
    .mobile-toc {
        display: block;
    }
    
    .topic-search {
        display: none;
    }
    
    .breadcrumb-nav {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .topic-title {
        font-size: 28px;
    }
    
    .topic-search {
        display: none;
    }
    
    .mobile-search {
        display: block;
    }
    
    .nav-grid {
        grid-template-columns: 1fr;
    }
    
    .help-content h2 {
        font-size: 24px;
    }
    
    .help-content h3 {
        font-size: 20px;
    }
}