/* Help Page Styles */
.help-page-container {
    min-height: 100vh;
    background: #f8f9fa;
}

.help-hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.help-hero-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.help-hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.help-hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Search functionality styles */
.help-search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.help-search-box .input-group-text {
    background: white;
    border-right: none;
    color: #6c757d;
}

.help-search-box .form-control {
    border-left: none;
    border-right: none;
}

.help-search-box .form-control:focus {
    box-shadow: none;
    border-color: #ced4da;
}

/* Quick Links */
.help-quick-links {
    padding: 2rem 0;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.help-quick-card {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.help-quick-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #e9ecef;
}

.help-quick-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.help-quick-card h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.help-quick-card p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Main Content */
.help-main-content {
    padding: 3rem 0;
    background: white;
}

.help-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.help-nav-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.help-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-nav-list li {
    margin-bottom: 0.5rem;
}

.help-nav-list a {
    color: #495057;
    text-decoration: none;
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    position: relative;
}

.help-nav-list a:hover {
    background: #e9ecef;
    color: #007bff;
    padding-left: 1rem;
}

.help-nav-list a.active {
    background: #007bff;
    color: white;
    font-weight: 600;
    padding-left: 1rem;
}

.help-nav-list a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: white;
    border-radius: 2px;
}

.help-nav-list a:hover:not(.active) {
    transform: translateX(2px);
}

/* Sections */
.help-section {
    margin-bottom: 3rem;
    scroll-margin-top: 2rem;
}

.help-section-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.help-section-header h2 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.help-section-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

.help-content {
    line-height: 1.7;
}

.help-content h4 {
    color: #2c3e50;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.help-content h5 {
    color: #495057;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.help-content ul, .help-content ol {
    margin-bottom: 1.5rem;
}

.help-content li {
    margin-bottom: 0.5rem;
}

.help-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.875rem;
    color: #e83e8c;
}

.help-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
}

.help-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Table styling for email variables */
.help-content .table {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.help-content .table th {
    background: #f8f9fa;
    font-weight: 600;
    border-top: none;
}

.help-content .table td code {
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Steps */
.help-step {
    display: flex;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.help-step-number {
    background: #007bff;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.help-step-content h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Tips and Warnings */
.help-tip {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    color: #0056b3;
}

.help-warning {
    background: #fff3cd;
    border: 1px solid #ffd69e;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    color: #856404;
}

/* Role Cards */
.help-role-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    height: 100%;
}

.help-role-card h5 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.help-role-card ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Troubleshooting */
.help-troubleshoot-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #ffc107;
}

.help-troubleshoot-item h4 {
    color: #856404;
    margin-top: 0;
    margin-bottom: 1rem;
}

.help-troubleshoot-item h5 {
    color: #856404;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.help-troubleshoot-solution {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

/* FAQ */
.help-faq-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.help-faq-question {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    margin: 0;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    color: #2c3e50;
    font-weight: 600;
}

.help-faq-question:hover {
    background: #e9ecef;
}

.help-faq-answer {
    padding: 1.5rem;
}

.help-faq-answer p {
    margin: 0;
}

/* Contact Support */
.help-contact-method {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    height: 100%;
}

.help-contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.help-contact-method h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.help-support-tips {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 1.5rem;
}

.help-support-tips h4 {
    color: #0056b3;
    margin-top: 0;
}

/* Back to Top */
.help-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.help-back-to-top:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.help-back-to-top.show {
    display: block;
}

/* Search results dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-results-header {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.search-result-preview {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.search-results-more {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.search-no-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
}

.search-results-summary {
    background: #e7f3ff;
    border-bottom: 1px solid #b3d7ff;
    padding: 1rem 0;
}

/* Search highlighting */
.search-highlight {
    background: #fff3cd;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
    font-weight: 600;
}

/* Enhanced input group for search */
.help-search-box .input-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.help-search-box .input-group-text {
    background: white;
    border: 1px solid #ced4da;
    border-right: none;
}

.help-search-box .form-control {
    border: 1px solid #ced4da;
    border-left: none;
    border-right: none;
}

.help-search-box .btn {
    border: 1px solid #007bff;
    border-left: none;
}

.help-search-box .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.help-search-box .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Section visibility for search */
.help-section.d-none {
    display: none !important;
}

/* Improved search result animations */
.search-results-dropdown {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive search */
@media (max-width: 768px) {
    .help-search-box {
        max-width: 100%;
        margin: 0 1rem;
    }
    
    .search-results-dropdown {
        left: 1rem;
        right: 1rem;
    }
    
    .search-result-item {
        padding: 0.75rem;
    }
    
    .search-result-title {
        font-size: 0.9rem;
    }
    
    .search-result-preview {
        font-size: 0.8rem;
    }
}

/* Focus states for accessibility */
.search-result-item:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
    background: #e7f3ff;
}

.help-search-box .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Loading state for search */
.search-loading {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
}

.search-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search result keyboard navigation */
.search-result-item.highlighted {
    background: #e7f3ff;
    border-left: 3px solid #007bff;
}

.search-result-item:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
    background: #e7f3ff;
}

/* Improved search input styling */
.help-search-box .form-control {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

.help-search-box .input-group-lg .form-control {
    font-size: 1.1rem;
}

/* Search icon animation */
.help-search-box .input-group-text i {
    transition: color 0.2s ease;
}

.help-search-box .form-control:focus + .input-group-text i {
    color: #007bff;
}

/* Clear button styling */
.help-search-box .btn-outline-secondary {
    border-left: 1px solid #6c757d !important;
}

/* Search results counter badge */
.search-results-counter {
    background: #007bff;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
}

/* Loading spinner for search */
.search-loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search suggestions */
.search-suggestions {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #6c757d;
}

.search-suggestion-tag {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin: 0.25rem 0.25rem 0.25rem 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-suggestion-tag:hover {
    background: #dee2e6;
    color: #007bff;
}

/* Enhanced accessibility */
.help-search-box .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #007bff;
}

.search-result-item[role="button"] {
    cursor: pointer;
}

.search-result-item[aria-selected="true"] {
    background: #e7f3ff;
    border-left: 3px solid #007bff;
}

/* Print styles for help page */
@media print {
    .help-search-box,
    .search-results-dropdown,
    .search-results-summary,
    .help-back-to-top,
    .help-sidebar {
        display: none !important;
    }
    
    .help-section {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .help-hero-section {
        background: none !important;
        color: black !important;
        padding: 1rem 0;
    }
    
    .help-content {
        font-size: 12pt;
        line-height: 1.4;
    }
}