/* ===================================
   HELP CENTRE STYLES
   =================================== */

/* Help Content Container */
.help-content {
    padding: 0 0 5rem;
    background: var(--rp-ground);
    position: relative;
    z-index: 2;
    margin-top: -6vh;
}

/* Search Bar */
.help-search {
    margin-bottom: 2rem;
    position: relative;
}

.search-wrapper {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1rem;
    border: 1px solid var(--rp-line);
    border-radius: 50px;
    background: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--rp-primary);
    box-shadow: 0 4px 12px rgba(68, 114, 202, 0.15);
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    line-height: 0;
    color: var(--rp-muted);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: var(--rp-r-lg);
    box-shadow: 0 8px 24px rgba(19, 44, 80, 0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--rp-line);
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: var(--rp-ground);
}

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

.search-result-title {
    font-weight: 600;
    color: var(--rp-ink);
    margin-bottom: 0.25rem;
}

.search-result-snippet {
    font-size: 0.9rem;
    color: var(--rp-muted);
    line-height: 1.4;
}

.search-result-category {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--rp-primary);
    background: var(--rp-reef-50);
    padding: 0.2rem 0.6rem;
    border-radius: var(--rp-r-lg);
    margin-top: 0.5rem;
}

/* Tab Navigation */
.help-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 3rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
    flex-wrap: wrap;
}

.help-tab {
    padding: 1rem 2rem;
    background: white;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(19, 44, 80, 0.05);
}

.help-tab:hover {
    border-color: var(--rp-primary);
    background: var(--rp-reef-50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 114, 202, 0.15);
}

.help-tab.active {
    background: var(--rp-navy);
    color: white;
    border-color: var(--rp-primary);
    box-shadow: 0 4px 16px rgba(68, 114, 202, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.tab-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.tab-intro h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--rp-ink);
    letter-spacing: var(--rp-tracking-tight);
}

.tab-intro p {
    font-size: 1.1rem;
    color: var(--rp-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Help Categories */
.help-category {
    margin-bottom: 2rem;
    background: white;
    border-radius: var(--rp-r-lg);
    box-shadow: 0 2px 8px rgba(19, 44, 80, 0.06);
    overflow: hidden;
}

.help-category h3 {
    font-size: 1.4rem;
    margin-bottom: 0;
    color: var(--rp-ink);
    padding: 1.5rem;
    background: var(--rp-ground);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 2px solid var(--rp-line);
}

.help-category h3:hover {
    background: var(--rp-reef-50);
    color: var(--rp-primary);
}

.help-category h3::after {
    content: '▼';
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: var(--rp-primary);
}

.help-category.collapsed h3 {
    border-bottom: none;
}

.help-category.collapsed h3::after {
    transform: rotate(-90deg);
}

.help-category .help-articles {
    max-height: 10000px;
    opacity: 1;
    transition: all 0.4s ease;
    overflow: hidden;
    padding: 1.5rem;
}

.help-category.collapsed .help-articles {
    max-height: 0;
    opacity: 0;
    padding: 0 1.5rem;
}

.help-article {
    background: white;
    padding: 1.5rem;
    border-radius: var(--rp-r-lg);
    box-shadow: 0 2px 8px rgba(19, 44, 80, 0.06);
    transition: all 0.3s ease;
}

.help-article:hover {
    box-shadow: 0 4px 16px rgba(19, 44, 80, 0.1);
    transform: translateY(-2px);
}

.help-article h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--rp-ink);
}

.help-article > p {
    color: var(--rp-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    background: var(--rp-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--rp-r-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.read-more:hover {
    background: var(--rp-primary-hover);
    transform: translateX(4px);
}

.article-content {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--rp-line);
    text-align: left;
}

.article-content.hidden {
    display: none;
}

.article-content h5 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--rp-ink);
}

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

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--rp-ink-2);
}

.article-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--rp-ink-2);
}

.article-content strong {
    color: var(--rp-ink);
}

.article-content a {
    color: var(--rp-primary);
    text-decoration: underline;
}

.article-content a:hover {
    color: var(--rp-primary-hover);
}

/* Category Grid (for How-To Guides, Admin Guides) */
.help-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: var(--rp-r-lg);
    box-shadow: 0 2px 8px rgba(19, 44, 80, 0.06);
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    box-shadow: 0 6px 20px rgba(19, 44, 80, 0.12);
    transform: translateY(-4px);
}

.category-icon {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: var(--rp-r-lg);
    background: var(--rp-harbour-50);
    color: var(--rp-harbour-700);
    margin-bottom: 1rem;
}

.category-icon .tbl-icon {
    width: 26px;
    height: 26px;
    stroke-width: 1.75;
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--rp-ink);
}

.category-topics {
    list-style: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
    text-align: left;
    flex-grow: 1;
}

.category-topics li {
    padding: 0.5rem 0;
    color: var(--rp-muted);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--rp-line);
}

.category-topics li:last-child {
    border-bottom: none;
}

.category-topics li::before {
    content: "→ ";
    color: var(--rp-primary);
    margin-right: 0.5rem;
}

.expand-category {
    background: var(--rp-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--rp-r-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.expand-category:hover {
    background: var(--rp-primary-hover);
}

/* FAQ Styles */
.faq-category {
    margin-bottom: 3rem;
}

.faq-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--rp-ink);
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--rp-primary);
}

.faq-list {
    background: white;
    border-radius: var(--rp-r-lg);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(19, 44, 80, 0.06);
}

.faq-item {
    border-bottom: 1px solid var(--rp-line);
}

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

.faq-question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: white;
    border: none;
    text-align: left;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--rp-ink);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: var(--rp-ground);
}

.faq-question.active {
    color: var(--rp-primary);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--rp-primary);
    transition: transform 0.3s ease;
}

.faq-question.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: left;
}

.faq-answer.active {
    padding: 0 1.5rem 1.5rem;
    max-height: 1000px;
}

.faq-answer p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--rp-ink-2);
}

.faq-answer ul,
.faq-answer ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--rp-ink-2);
}

.faq-answer strong {
    color: var(--rp-ink);
}

.faq-answer a {
    color: var(--rp-primary);
    text-decoration: underline;
}

.faq-answer a:hover {
    color: var(--rp-primary-hover);
}

/* Troubleshooting Styles */
.troubleshooting-category {
    margin-bottom: 3rem;
}

.troubleshooting-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--rp-ink);
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--rp-primary);
}

.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.trouble-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--rp-r-lg);
    box-shadow: 0 2px 8px rgba(19, 44, 80, 0.06);
    text-align: left;
}

.trouble-item h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--rp-ink);
}

.trouble-item p {
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--rp-ink-2);
}

.trouble-item ul {
    margin-left: 1.5rem;
}

.trouble-item li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: var(--rp-muted);
    font-size: 0.95rem;
}

.trouble-item a {
    color: var(--rp-primary);
    text-decoration: underline;
}

/* Help Footer */
.help-footer {
    background: var(--rp-navy);
    padding: 4rem 0;
    color: white;
    text-align: center;
}

.help-footer h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    letter-spacing: var(--rp-tracking-tight);
}

.help-footer p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.help-footer-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.help-footer-actions .btn-primary,
.help-footer-actions .btn-secondary {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--rp-r-md);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.help-footer-actions .btn-primary {
    background: var(--rp-on-navy);
    color: var(--rp-harbour-800);
    border: 1px solid var(--rp-on-navy);
}

.help-footer-actions .btn-primary:hover {
    background: var(--rp-harbour-100);
    border-color: var(--rp-harbour-100);
}

.help-footer-actions .btn-secondary {
    background: transparent;
    color: var(--rp-on-navy);
    border: 1px solid rgba(157, 187, 214, 0.55);
}

.help-footer-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.help-trust-badges {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    opacity: 0.95;
    flex-wrap: wrap;
}

.help-trust-badges .trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-trust-badges .trust-badge span {
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .help-hero h1 {
        font-size: 2rem;
        letter-spacing: var(--rp-tracking-tight);
    }

    .help-hero p {
        font-size: 1rem;
    }

    .help-tabs {
        gap: 0.25rem;
    }

    .help-tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .tab-intro h2 {
        font-size: 1.6rem;
        letter-spacing: var(--rp-tracking-tight);
    }

    .tab-intro p {
        font-size: 1rem;
    }

    .help-category h3 {
        font-size: 1.3rem;
    }

    .help-category-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .troubleshooting-grid {
        grid-template-columns: 1fr;
    }

    .help-footer-content h2 {
        font-size: 1.6rem;
        letter-spacing: var(--rp-tracking-tight);
    }

    .help-footer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .help-footer-actions .btn-primary,
    .help-footer-actions .btn-secondary {
        width: 100%;
    }

    .search-wrapper {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .help-content {
        padding: 2rem 0 3rem;
    }

    .help-article {
        padding: 1rem;
    }

    .category-card {
        padding: 1.5rem;
    }

    .help-footer {
        margin-top: 2rem;
        padding: 2rem 1rem;
    }
}

/* The help footer's badges use the shared .trust-badges markup */
.help-footer .trust-badges {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}
