/* Help Center Global Styles */
.help-center-header {
    background: linear-gradient(135deg, #667eea 0%, #147dab 100%);
    color: white;
    padding: 60px 0;
    margin-top: 100px;
}

.help-center-header .search-box .btn {
    border-radius: 0rem .3rem .3rem 0rem;
    background-color: rgb(42, 58, 146);
    border-color: rgb(42, 58, 146);
}

html[dir="rtl"] .help-center-header .search-box .btn {
    border-radius: .3rem 0rem 0rem .3rem;
}

.help-center-header .search-box .form-control-lg {
    border-radius: .3rem 0rem 0rem .3rem;
}

html[dir="rtl"] .help-center-header .search-box .form-control-lg {
    border-radius: 0rem .3rem .3rem 0rem;
}

/* Search Box */
.search-box {
    max-width: 600px;
    margin: 0 auto;
}

.light-icon {
    color: #f0f0f0 !important;
}

.sidebar {
    background: #fff;
    border-right: 1px solid #e0e0e0;
    height: 100%;
}

.sidebar .nav-link {
    color: #1e1e60;
    font-weight: 500;
    padding: 15px 15px;
}

.sidebar .nav-link.active {
    background-color: #273C9C;
    color: white;
    border-radius: 8px;
}

.sidebar .nav-link i {
    margin-right: 10px;
}

.footer-support {
    max-width: 647px;
    margin: 40px auto 20px;
    margin-top: 40px;
    padding: 25px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.footer-text {
    max-width: 70%;
}

.footer-text .headline {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin: 0 0 5px 0;
    font-family: SF Pro DisplayMedium;
}

.footer-text .subline {
    font-size: 14px;
    font-weight: 400;
    color: #555;
    margin: 0;
}

.footer-support .support-btn {
    background: #1a73e8;
    color: #fff;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-btn:hover {
    background-color: #1b2c74;
}

/* Right side container */
.right-section {
    background: #fffdfb;
}

/* Left side topics container */
.topic-item {
  display: flex;
  align-items: center;
  margin: 3px 0;
}

.topic-item i {
  width: 24px; /* same width for all icons */
  text-align: center;
  margin-right: 10px;
  font-size: 18px;
}

.topic-item span {
  flex: 1;
}

.text-decoration-underline
{
    text-decoration: underline;
}

/* Help cards */
.help-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Card hover effect */
.help-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Card title */
.help-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-bottom: 6px;
}

/* Card body with flex column */
.help-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

/* Card text */
.help-card .card-text {
    font-size: 14px;
    margin: 0;
    color: #555;
}

/* Topic & Category Cards */
.topic-card {
    border: none;
    border-radius: 10px;
    background-color: #f5f8ff;
    transition: 0.3s;
    height: 100%;
    text-align: center;
}

.topic-card:hover {
    transform: translateY(-5px);
    background-color: #e6edff;
}

.category-card {
    transition: all 0.3s;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Icons */
.topic-icon {
    font-size: 24px;
    color: #273C9C;
}
.topic-icon img
{
    height: 60px;
}
.category-icon {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

/* Article Cards */
.article-card {
    border-left: 4px solid #667eea;
    transition: border-color 0.2s;
}

.article-card:hover {
    border-left-color: #764ba2;
}

.category-page .article-card {
    transition: all 0.3s;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: 100%;
    border-left: 4px solid transparent;
}

.category-page .article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-left-color: #667eea;
}

.category-page .article-card.featured {
    border-left-color: #ffc107;
    background: linear-gradient(45deg, #fff9e6 0%, #ffffff 100%);
}

/* Article Content */
.article-meta {
    font-size: 0.9rem;
    opacity: 0.9;
}

.category-page .article-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

.article-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    color: #333;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content a {
    text-decoration: underline;
    font-size: 18px;
}

.article-content h1 {
    font-size: 1.8rem;
}

.article-content h2 {
    font-size: 1.5rem;
}

.article-content h3 {
    font-size: 1.3rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.article-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #666;
}

/* Category Stats */
.category-stats {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Article Items */
.article-item {
    transition: all 0.2s;
    border-left: 3px solid transparent;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.article-item:hover {
    background-color: #f8f9fa;
    border-left-color: #667eea;
}

/* Badges */
.badge-featured {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
}

/* Search Results */
.search-results-header {
    border-bottom: 3px solid #667eea;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
.search-results-header .btn-group {
    margin-right: 5px;
}

html[dir="rtl"] .search-results-header .btn-group {
    margin-left: 5px;
}

html[dir="rtl"] .search-results-header .btn-group>.btn-group:not(:last-child)>.btn,
.btn-group>.btn:not(:last-child):not(.dropdown-toggle) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

html[dir="rtl"] .search-results-header .btn-group>.btn-group:not(:first-child)>.btn,
.btn-group>.btn:not(:first-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.search-result-item {
    border-left: 4px solid #e9ecef;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.search-result-item:hover {
    border-left-color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-highlight {
    background-color: #fff3cd;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* Flexible Select Dropdowns */
.search-filters .form-select {
    width: 100%;
    min-width: 200px;
    white-space: normal;
    word-wrap: break-word;
}

.search-filters .form-select option {
    white-space: normal;
    word-wrap: break-word;
    padding: 8px 12px;
    line-height: 1.4;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Header sort dropdown flexibility */
.search-results-header .form-select {
    min-width: 120px;
    max-width: 200px;
    width: auto;
}

/* Category titles in search results - text wrapping */
.search-result-item .category-title,
.search-result-card .category-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.search-result-card .category-title {
    line-height: 2;
}

.search-result-item .category-title {
    line-height: 1.3;
}

/* Make search results header responsive */
@media (max-width: 768px) {
    .search-results-header .d-flex {
        flex-direction: column;
        gap: 15px !important;
        align-items: flex-start !important;
    }

    .search-results-header .d-flex .d-flex {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .search-results-header .form-select {
        min-width: 140px;
        flex: 1;
    }

    .search-filters .form-select {
        min-width: 150px;
    }

    .search-filters {
        padding: 15px;
    }

    /* Stack sort options on very small screens */
    @media (max-width: 576px) {
        .search-results-header .d-flex .d-flex {
            flex-direction: column;
            gap: 10px;
        }

        .btn-group {
            width: 100%;
            justify-content: center;
        }

        .search-results-header .form-select {
            width: 100%;
            min-width: unset;
        }
    }
}

/* Category dropdown improvements */
.search-filters .form-select option {
    padding: 10px 15px;
    font-size: 14px;
    line-height: 1.5;
    border-bottom: 1px solid #f0f0f0;
}

.search-filters .form-select option:last-child {
    border-bottom: none;
}

/* Improve category title display */
.category-title {
    display: inline-block;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

@media (max-width: 768px) {
    .category-title {
        max-width: 180px;
    }
}

@media (max-width: 576px) {
    .category-title {
        max-width: 150px;
    }
}

/* Grid view responsive improvements */
.search-result-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 576px) {
    .grid-view .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .search-result-card .card-body {
        padding: 1rem;
    }

    .search-result-card .card-title {
        font-size: 1rem;
        line-height: 1.3;
    }
}
.search-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.no-results {
    text-align: center;
    color: #6c757d;
    margin: 3rem 0;
}

/* Article Content Extensions */
.article-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow-x: auto;
}

.table-of-contents {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.table-of-contents ul {
    margin-bottom: 0;
}

.table-of-contents a {
    text-decoration: none;
    color: #667eea;
}

.table-of-contents a:hover {
    text-decoration: underline;
}

.article-sidebar {
    position: sticky;
    top: 2rem;
}

.feedback-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 3rem 0;
}

.feedback-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.feedback-btn {
    border: 2px solid #dee2e6;
    background: white;
    color: #6c757d;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.2s;
    cursor: pointer;
}

.feedback-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.feedback-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.related-articles {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.article-actions {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    z-index: 1000;
}

.action-btn {
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}


.print-only {
    display: none;
}

.featured-section {
    background: linear-gradient(45deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.topic-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.article-grid {
    display: grid;
    gap: 1rem;
}

.topic-page .article-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    transition: all 0.2s;
}

.topic-page .article-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.popular-articles {
    position: sticky;
    top: 2rem;
}

/* Search Page Styles */
.search-suggestion {
    background: linear-gradient(45deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.view-toggle {
    border: 1px solid #dee2e6;
    background: white;
    transition: all 0.2s;
}

.view-toggle:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.view-toggle.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.search-result-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 100%;
}

.search-result-card:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    transform: translateY(-2px);
}

.search-result-card .card-title a {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
}

.search-result-card .card-title a:hover {
    color: #667eea;
}

.search-result-card .card-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #6c757d;
}

.list-view .search-result-item {
    border-left: 4px solid #e9ecef;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.list-view .search-result-item:hover {
    border-left-color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.grid-view,
.list-view {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badge.bg-light {
    color: #495057 !important;
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
    font-size: 0.75rem;
}

.badge.bg-warning {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%) !important;
    border: none;
}

.category-page .article-card.featured {
    border-left-color: #ffc107;
    background: linear-gradient(45deg, #fff9e6 0%, #ffffff 100%);
}

.category-page .article-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

.article-list-item {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.article-list-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.category-page .view-toggle {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.25rem;
}

.category-page .view-toggle .btn {
    border-radius: 6px;
    border: none;
    padding: 0.5rem 1rem;
}

.category-page .view-toggle .btn.active {
    background: #667eea;
    color: white;
}

.section-header {
    margin: 2rem 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.section-title {
    color: #495057;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
}

.section-count {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: normal;
}

.unsectioned-articles {
    margin-top: 3rem;
}

.unsectioned-title {
    color: #6c757d;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.filters-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-tag {
    background: #e9ecef;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.filter-tag.active {
    background: #667eea;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 1rem 0rem 0.2rem;
}

/* Breadcrumbs */
.breadcrumb-item+.breadcrumb-item::before {
    content: var(--bs-breadcrumb-divider, "/") !important;
}
.article-header .breadcrumb-item+.breadcrumb-item::before {
    content: var(--bs-breadcrumb-divider, "/") !important;
    color: white;
}

@media (max-width: 992px) {
    .grid-view .col-lg-6 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .article-actions {
        right: 1rem;
        bottom: 1rem;
    }

    .grid-view .col-xl-4 {
        margin-bottom: 0.75rem;
    }

    .view-toggle {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

}

.top-articles-section h4 {
    color: #495057;
    font-weight: 600;
}

.top-article-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
}

.top-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.top-article-card .article-rank .badge {
    font-size: 0.8rem;
    font-weight: 600;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-article-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.top-article-card .card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-article-card .card-title a:hover {
    color: #667eea;
}

.top-article-card .article-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.top-article-card .article-meta a {
    color: inherit;
    text-decoration: none;
}

.top-article-card .article-meta a:hover {
    color: #667eea;
}

.top-article-card .article-meta i {
    opacity: 0.8;
}

.top-article-card .badge.bg-warning {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%) !important;
    color: white;
    font-size: 0.7rem;
}

#showMoreArticles {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transition: all 0.3s ease;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

#showMoreArticles:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.categories-section h4 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .top-articles-section {
        padding: 1.5rem 1rem;
    }

    .top-article-card .card-body {
        padding: 1rem;
    }

    .top-article-card .card-title {
        font-size: 0.95rem;
    }

    .top-article-card .article-meta {
        font-size: 0.75rem;
    }
}

/* Search Suggestions Dropdown */
.search-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}

.search-suggestions-container {
    padding: 0;
}

.suggestions-header {
    padding: 12px 16px 8px 16px;
    border-bottom: 1px solid #f1f3f4;
    background: #f8f9fa;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

.suggestions-header:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
    color: #495057;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: #f8f9fa;
    color: #333;
    text-decoration: none !important;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-icon {
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-content {
    min-width: 0;
}

.suggestion-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
    word-break: break-word;
}

.suggestion-meta {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.2;
}

.suggestion-meta .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
}

.category-suggestion:hover .suggestion-title {
    color: #007bff;
}

.article-suggestion:hover .suggestion-title {
    color: #28a745;
}

.show-all-results {
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.show-all-results .btn {
    font-size: 0.875rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: white;
}

.show-all-results .btn:hover {
    background: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

/* Search input focus state */
#helpSearchInput:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Loading and empty states */
#searchLoading,
#noSearchResults {
    padding: 20px 16px;
    text-align: center;
    color: #6c757d;
}

#searchLoading i {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

#noSearchResults i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    opacity: 0.6;
}

/* Responsive design */
@media (max-width: 768px) {
    .search-suggestions-dropdown {
        max-height: 300px;
        margin-top: 2px;
    }

    .suggestion-item {
        padding: 10px 12px;
    }

    .suggestions-header {
        padding: 10px 12px 6px 12px;
    }

    .suggestion-title {
        font-size: 0.9rem;
    }

    .suggestion-meta {
        font-size: 0.75rem;
    }

    .show-all-results {
        padding: 10px 12px;
    }
}

/* Keyboard navigation highlight */
.suggestion-item.selected {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.category-suggestion.selected {
    background: #e8f4fd;
}

.article-suggestion.selected {
    background: #e8f5e8;
}

/* Animation */
.search-suggestions-dropdown {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search box container positioning */
.search-box .position-relative {
    display: flex;
    align-items: stretch;
}

/* Ensure dropdown doesn't break layout */
.search-suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-suggestions-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* Table of Contents Sidebar */
.toc-sidebar {
    position: sticky;
    top: 120px;
}

.toc-sidebar .card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.toc-sidebar .card-header {
    background: #667eea;
    border-bottom: 1px solid #667eea;
    border-radius: 12px 12px 0 0 !important;
}

.toc-sidebar .list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s ease;
    color: #495057;
    text-decoration: none;
}

.toc-sidebar .list-group-item:hover {
    background-color: #f8f9fa;
    color: #667eea;
    text-decoration: none;
    padding-left: 1.25rem;
}

.toc-sidebar .list-group-item.active {
    background-color: #667eea;
    color: white;
    border-left: 4px solid #5a6fd8;
    font-weight: 600;
}

.toc-sidebar .list-group-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

/* TOC heading levels */
.toc-sidebar .toc-h1 {
    font-weight: 600;
    font-size: 1rem;
}

.toc-sidebar .toc-h2 {
    padding-left: 1.5rem;
    font-size: 0.95rem;
}

.toc-sidebar .toc-h3 {
    padding-left: 2rem;
    font-size: 0.9rem;
}

.toc-sidebar .toc-h4 {
    padding-left: 2.5rem;
    font-size: 0.85rem;
}

.toc-sidebar .toc-h5 {
    padding-left: 3rem;
    font-size: 0.8rem;
}

.toc-sidebar .toc-h6 {
    padding-left: 3.5rem;
    font-size: 0.75rem;
}

/* Article content headings with scroll offset */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    scroll-margin-top: 120px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .toc-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .toc-sidebar {
        position: static;
        top: auto;
    }

    .toc-sidebar .card-header h6 {
        font-size: 0.95rem;
    }

    .toc-sidebar .list-group-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .toc-sidebar .toc-h2 {
        padding-left: 1.2rem;
    }

    .toc-sidebar .toc-h3 {
        padding-left: 1.6rem;
    }

    .toc-sidebar .toc-h4 {
        padding-left: 2rem;
    }

    .toc-sidebar .toc-h5 {
        padding-left: 2.4rem;
    }

    .toc-sidebar .toc-h6 {
        padding-left: 2.8rem;
    }
}

@media print {
    .print-only {
        display: block;
    }

    .no-print,
    .toc-sidebar {
        display: none !important;
    }

    .article-content {
        font-size: 12pt;
        line-height: 1.6;
    }

    .search-suggestions-dropdown {
        display: none !important;
    }
}