/**
 * Help Modal Styles
 * Provides styling for the help system modal interface
 * Integrates with existing design system and theme system
 */

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal.show {
    display: flex;
}

/* Modal Dialog */
.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal-dialog-lg {
    max-width: 800px;
}

.modal.show .modal-dialog {
    transform: translateY(0);
}

/* Modal Content */
.modal-content {
    position: relative;
    background-color: var(--theme-bg-primary, #ffffff);
    border: 1px solid var(--theme-border-light, #e9ecef);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-teal, #1f5f7a) 0%, var(--brand-blue, #6699cc) 100%);
    color: var(--theme-text-inverse, #ffffff);
    border-bottom: 1px solid var(--theme-border-light, #e9ecef);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-text-inverse, #ffffff);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--theme-text-inverse, #ffffff);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Modal Body */
.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 140px); /* Account for header and footer */
}

/* Modal Footer */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    background-color: var(--theme-bg-secondary, #f8f9fa);
    border-top: 1px solid var(--theme-border-light, #e9ecef);
}

/* Help Search Container */
.help-search-container {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--theme-border-light, #e9ecef);
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--theme-text-primary, #333333);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--theme-text-primary, #333333);
    background-color: var(--theme-bg-primary, #ffffff);
    border: 1px solid var(--theme-border-medium, #ced4da);
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--brand-teal, #1f5f7a);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(31, 95, 122, 0.25);
}

.text-muted {
    color: var(--theme-text-secondary, #6c757d);
    font-size: 0.875rem;
}

/* Help Content Container */
.help-content-container {
    min-height: 300px;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--theme-border-light, #e9ecef);
    border-top: 4px solid var(--brand-teal, #1f5f7a);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert Styles */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* Enhanced No Results Styling */
.no-results-suggestions {
    margin-top: 1rem;
}

.no-results-suggestions ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.no-results-suggestions li {
    margin-bottom: 0.25rem;
}

.btn-link {
    color: var(--brand-teal, #1f5f7a);
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
}

.btn-link:hover {
    color: var(--brand-blue, #6699cc);
}

/* Fallback Content Styling */
.help-fallback-content {
    padding: 1rem;
}

.fallback-topics {
    margin: 1.5rem 0;
}

.fallback-actions {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--theme-border-light, #e9ecef);
}

.fallback-actions .btn {
    margin: 0 0.5rem;
}

/* Error State Enhancements */
#help-error {
    position: relative;
}

#help-error .btn {
    margin-left: 1rem;
}

/* Retry Button States */
#help-retry {
    transition: all 0.2s ease;
}

#help-retry:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#help-retry:active {
    transform: translateY(0);
}

/* Loading State Improvements */
.loading-state {
    min-height: 200px;
}

.loading-spinner {
    margin: 0 auto 1rem auto;
}

/* Error Recovery Suggestions */
.error-suggestions {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--theme-bg-secondary, #f8f9fa);
    border-radius: 4px;
    border-left: 4px solid var(--brand-blue, #6699cc);
}

.error-suggestions h4 {
    margin: 0 0 0.5rem 0;
    color: var(--brand-blue, #6699cc);
    font-size: 1rem;
}

.error-suggestions ul {
    margin: 0;
    padding-left: 1.5rem;
}

.error-suggestions li {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* Help Categories */
.help-categories {
    margin-top: 1rem;
}

/* Contextual Help Highlighting */
.help-category.has-contextual-topics {
    border-color: var(--brand-teal, #1f5f7a);
    box-shadow: 0 2px 8px rgba(31, 95, 122, 0.15);
}

.help-category.has-contextual-topics .help-category-toggle {
    background-color: rgba(31, 95, 122, 0.05);
    border-bottom: 2px solid var(--brand-teal, #1f5f7a);
}

.contextual-indicator {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
    background-color: var(--brand-teal, #1f5f7a);
    color: var(--theme-text-inverse, #ffffff);
    padding: 0.2em 0.5em;
    border-radius: 12px;
    font-weight: 500;
}

.help-topic-item.contextual-topic {
    border-color: var(--brand-teal, #1f5f7a);
    background-color: rgba(31, 95, 122, 0.03);
    box-shadow: 0 2px 4px rgba(31, 95, 122, 0.1);
}

.help-topic-item.contextual-topic .help-topic-link {
    color: var(--brand-teal, #1f5f7a);
    font-weight: 600;
}

.contextual-badge {
    display: inline-block;
    background-color: var(--brand-teal, #1f5f7a);
    color: var(--theme-text-inverse, #ffffff);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2em 0.5em;
    border-radius: 12px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.help-contextual-notice {
    background-color: rgba(31, 95, 122, 0.1);
    border-color: var(--brand-teal, #1f5f7a);
    color: var(--brand-teal, #1f5f7a);
}

.contextual-explanation {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: rgba(31, 95, 122, 0.05);
    border-left: 3px solid var(--brand-teal, #1f5f7a);
    border-radius: 0 4px 4px 0;
}

.contextual-reason {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(31, 95, 122, 0.02);
    border-radius: 4px;
    border-left: 2px solid var(--brand-teal, #1f5f7a);
}

.contextual-reason .text-muted {
    color: var(--brand-teal, #1f5f7a);
    font-style: italic;
}

.help-category {
    margin-bottom: 1rem;
    border: 1px solid var(--theme-border-light, #e9ecef);
    border-radius: 4px;
    overflow: hidden;
}

.help-category-toggle {
    width: 100%;
    padding: 1rem;
    background-color: var(--theme-bg-secondary, #f8f9fa);
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--theme-text-primary, #333333);
    transition: background-color 0.2s ease;
}

.help-category-toggle:hover {
    background-color: var(--theme-bg-tertiary, #e9ecef);
}

.help-category-toggle:focus {
    outline: 2px solid var(--brand-teal, #1f5f7a);
    outline-offset: -2px;
}

.toggle-icon {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.category-name {
    flex: 1;
}

.category-count {
    font-size: 0.875rem;
    color: var(--theme-text-secondary, #6c757d);
    font-weight: normal;
}

.help-category-content {
    padding: 1rem;
    background-color: var(--theme-bg-primary, #ffffff);
    border-top: 1px solid var(--theme-border-light, #e9ecef);
}

.category-description {
    margin-bottom: 1rem;
    color: var(--theme-text-secondary, #6c757d);
}

/* Help Topics List */
.help-topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.help-topic-item {
    padding: 0.75rem;
    border: 1px solid var(--theme-border-light, #e9ecef);
    border-radius: 4px;
    background-color: var(--theme-bg-primary, #ffffff);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.help-topic-item:hover {
    border-color: var(--brand-teal, #1f5f7a);
    box-shadow: 0 2px 4px rgba(31, 95, 122, 0.1);
}

.help-topic-link {
    color: var(--brand-teal, #1f5f7a);
    text-decoration: none;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.help-topic-link:hover {
    text-decoration: underline;
    color: var(--brand-blue, #6699cc);
}

.topic-description {
    margin: 0;
    font-size: 0.875rem;
    color: var(--theme-text-secondary, #6c757d);
    line-height: 1.4;
}

/* Search Results */
.help-search-results {
    margin-top: 1rem;
}

.search-results-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--theme-border-light, #e9ecef);
}

.search-results-header h3 {
    margin: 0 0 0.25rem 0;
    color: var(--theme-text-primary, #333333);
}

.search-results-header p {
    margin: 0;
    color: var(--theme-text-secondary, #6c757d);
    font-size: 0.875rem;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.help-search-result {
    padding: 1rem;
    border: 1px solid var(--theme-border-light, #e9ecef);
    border-radius: 4px;
    background-color: var(--theme-bg-primary, #ffffff);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.help-search-result:hover {
    border-color: var(--brand-teal, #1f5f7a);
    box-shadow: 0 2px 4px rgba(31, 95, 122, 0.1);
}

.result-category {
    margin: 0.25rem 0;
    font-size: 0.75rem;
    color: var(--theme-text-secondary, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-excerpt {
    margin: 0.5rem 0 0 0;
    font-size: 0.875rem;
    color: var(--theme-text-secondary, #6c757d);
    line-height: 1.4;
}

/* Search Highlighting */
mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

/* Topic Detail View */
.help-topic-detail {
    margin-top: 1rem;
}

.help-topic-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--theme-border-light, #e9ecef);
}

.help-topic {
    max-width: none;
}

.topic-header {
    margin-bottom: 1.5rem;
}

.topic-header h2 {
    margin: 0 0 0.5rem 0;
    color: var(--theme-text-primary, #333333);
}

.topic-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--theme-text-secondary, #6c757d);
}

.topic-content {
    line-height: 1.6;
    color: var(--theme-text-primary, #333333);
}

.topic-content h1,
.topic-content h2,
.topic-content h3,
.topic-content h4,
.topic-content h5,
.topic-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--theme-text-primary, #333333);
}

.topic-content h1:first-child,
.topic-content h2:first-child,
.topic-content h3:first-child {
    margin-top: 0;
}

.topic-content p {
    margin-bottom: 1rem;
}

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

.topic-content li {
    margin-bottom: 0.25rem;
}

.topic-content code {
    background-color: var(--theme-bg-secondary, #f8f9fa);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.875em;
    color: var(--theme-text-primary, #333333);
}

.topic-content pre {
    background-color: var(--theme-bg-secondary, #f8f9fa);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.topic-content blockquote {
    border-left: 4px solid var(--brand-teal, #1f5f7a);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--theme-text-secondary, #6c757d);
    font-style: italic;
}

/* Enhanced Visual Content Styles */

/* Step-by-Step Instructions */
.help-steps-container {
    margin: 1.5rem 0;
    background-color: var(--theme-bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--brand-teal, #1f5f7a);
}

.steps-title {
    margin: 0 0 1rem 0;
    color: var(--brand-teal, #1f5f7a);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.steps-title::before {
    content: "📋";
    font-size: 1.2rem;
}

.help-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step-counter;
}

.help-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--theme-bg-primary, #ffffff);
    border-radius: 6px;
    border: 1px solid var(--theme-border-light, #e9ecef);
    transition: box-shadow 0.2s ease;
}

.help-step:hover {
    box-shadow: 0 2px 8px rgba(31, 95, 122, 0.1);
}

.help-step:last-child {
    margin-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background-color: var(--brand-teal, #1f5f7a);
    color: var(--theme-text-inverse, #ffffff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 1rem;
}

.step-content {
    flex: 1;
    line-height: 1.5;
    color: var(--theme-text-primary, #333333);
}

/* Example Blocks */
.help-example-block {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--theme-border-medium, #ced4da);
    background-color: var(--theme-bg-primary, #ffffff);
}

.example-header {
    background: linear-gradient(135deg, var(--brand-blue, #6699cc) 0%, var(--brand-teal, #1f5f7a) 100%);
    color: var(--theme-text-inverse, #ffffff);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-header::before {
    content: "💻";
    font-size: 1rem;
}

.example-code {
    margin: 0;
    padding: 1rem;
    background-color: var(--theme-bg-secondary, #f8f9fa);
    border: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--theme-text-primary, #333333);
    overflow-x: auto;
}

.help-example-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background-color: rgba(102, 153, 204, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--brand-blue, #6699cc);
}

.example-label {
    font-weight: 600;
    color: var(--brand-blue, #6699cc);
    font-size: 0.875rem;
}

.example-content {
    color: var(--theme-text-primary, #333333);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Note and Tip Blocks */
.help-note,
.help-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid;
}

.help-note {
    background-color: rgba(23, 162, 184, 0.1);
    border-left-color: #17a2b8;
}

.help-tip {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
}

.note-icon,
.tip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.note-content,
.tip-content {
    flex: 1;
    color: var(--theme-text-primary, #333333);
    line-height: 1.5;
}

/* Enhanced Image Styles */
.help-image-container {
    margin: 1.5rem 0;
    text-align: center;
}

.help-image-container.screenshot-container {
    background-color: var(--theme-bg-secondary, #f8f9fa);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--theme-border-light, #e9ecef);
}

.help-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.help-screenshot {
    border: 2px solid var(--theme-border-medium, #ced4da);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.help-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.help-screenshot:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.image-caption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--theme-text-secondary, #6c757d);
    font-style: italic;
    line-height: 1.4;
}

.help-image-container.image-error .help-image {
    display: none;
}

.help-image-container.image-error::after {
    content: "📷 Image could not be loaded";
    display: block;
    padding: 2rem;
    background-color: var(--theme-bg-secondary, #f8f9fa);
    border: 2px dashed var(--theme-border-medium, #ced4da);
    border-radius: 6px;
    color: var(--theme-text-secondary, #6c757d);
    font-style: italic;
}

/* Enhanced Code Styling */
.topic-content code {
    background-color: rgba(31, 95, 122, 0.1);
    color: var(--brand-teal, #1f5f7a);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.875em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 500;
}

/* Enhanced List Styling */
.topic-content ul,
.topic-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.topic-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.topic-content ul li {
    list-style-type: none;
    position: relative;
}

.topic-content ul li::before {
    content: "•";
    color: var(--brand-teal, #1f5f7a);
    font-weight: bold;
    position: absolute;
    left: -1rem;
}

/* Related Topics */
.topic-related {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--theme-border-light, #e9ecef);
}

.topic-related h3 {
    margin: 0 0 1rem 0;
    color: var(--theme-text-primary, #333333);
}

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

.related-topics-list li {
    margin-bottom: 0.5rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-secondary {
    color: var(--theme-text-primary, #333333);
    background-color: var(--theme-bg-secondary, #f8f9fa);
    border-color: var(--theme-border-medium, #ced4da);
}

.btn-secondary:hover {
    background-color: var(--theme-bg-tertiary, #e9ecef);
    border-color: var(--theme-border-dark, #adb5bd);
}

.btn-outline {
    color: var(--brand-teal, #1f5f7a);
    background-color: transparent;
    border-color: var(--brand-teal, #1f5f7a);
}

.btn-outline:hover {
    color: var(--theme-text-inverse, #ffffff);
    background-color: var(--brand-teal, #1f5f7a);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
    }
    
    .modal-dialog-lg {
        max-width: 100%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-body {
        max-height: calc(90vh - 120px);
    }
    
    .help-category-toggle {
        padding: 0.75rem;
    }
    
    .help-topic-item,
    .help-search-result {
        padding: 0.75rem;
    }
    
    .topic-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    /* Form controls */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Steps container */
    .help-steps-container {
        padding: 1rem;
    }

    .help-step {
        padding: 0.75rem;
    }

    .step-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
        margin-right: 0.75rem;
    }

    /* Example blocks */
    .help-example-block {
        margin: 1rem 0;
    }

    .example-code {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    /* Images */
    .help-image-container {
        margin: 1rem 0;
    }

    .help-image-container.screenshot-container {
        padding: 0.75rem;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-height: 36px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .modal {
        padding: 0;
    }

    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }

    .modal-content {
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-close {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.75rem;
    }

    .modal-body {
        max-height: calc(100vh - 100px);
    }

    .help-category-toggle {
        padding: 0.625rem;
        font-size: 0.9rem;
    }

    .category-name {
        font-size: 0.9rem;
    }

    .category-count {
        font-size: 0.75rem;
    }

    .help-topic-item,
    .help-search-result {
        padding: 0.625rem;
    }

    .help-topic-link {
        font-size: 0.9rem;
    }

    .topic-description,
    .result-excerpt {
        font-size: 0.8rem;
    }

    .help-steps-container {
        padding: 0.75rem;
    }

    .help-step {
        padding: 0.625rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .step-number {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.7rem;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .step-content {
        font-size: 0.875rem;
    }

    .example-header {
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
    }

    .example-code {
        font-size: 0.7rem;
        padding: 0.625rem;
    }

    .help-note,
    .help-tip {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .image-caption {
        font-size: 0.8rem;
    }

    .topic-content {
        font-size: 0.9rem;
    }

    .topic-content code {
        font-size: 0.8em;
    }

    .topic-content pre {
        padding: 0.75rem;
        font-size: 0.75rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 896px) and (orientation: landscape) {
    .modal-body {
        max-height: 60vh;
    }

    .help-category-content {
        max-height: 40vh;
        overflow-y: auto;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .help-category-toggle,
    .help-topic-link,
    .btn {
        min-height: 44px;
    }

    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .help-category-toggle:hover,
    .help-topic-item:hover,
    .help-search-result:hover,
    .help-image:hover {
        background-color: inherit;
        transform: none;
        box-shadow: inherit;
    }

    /* Add active states instead */
    .help-category-toggle:active {
        background-color: var(--theme-bg-tertiary, #e9ecef);
    }

    .help-topic-item:active,
    .help-search-result:active {
        background-color: var(--theme-bg-secondary, #f8f9fa);
    }

    .btn:active {
        transform: scale(0.98);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background-color: var(--theme-bg-primary, #2d2d2d);
        border-color: var(--theme-border-light, #555555);
    }
    
    .modal-footer {
        background-color: var(--theme-bg-secondary, #404040);
        border-color: var(--theme-border-light, #555555);
    }
    
    .form-control {
        background-color: var(--theme-bg-primary, #2d2d2d);
        border-color: var(--theme-border-medium, #555555);
        color: var(--theme-text-primary, #ffffff);
    }
    
    .help-category-toggle {
        background-color: var(--theme-bg-secondary, #404040);
    }
    
    .help-category-toggle:hover {
        background-color: var(--theme-bg-tertiary, #555555);
    }
    
    .help-category-content,
    .help-topic-item,
    .help-search-result {
        background-color: var(--theme-bg-primary, #2d2d2d);
        border-color: var(--theme-border-light, #555555);
    }
    
    .topic-content code,
    .topic-content pre {
        background-color: var(--theme-bg-secondary, #404040);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .modal-backdrop,
    .modal-dialog,
    .loading-spinner,
    .toggle-icon,
    .help-topic-item,
    .help-search-result,
    .btn {
        transition: none;
        animation: none;
    }
}

/* Focus Styles for Better Accessibility */
.help-topic-link:focus,
.btn:focus {
    outline: 2px solid var(--brand-teal, #1f5f7a);
    outline-offset: 2px;
}

/* Accessibility Improvements for Visual Content */
@media (prefers-reduced-motion: reduce) {
    .help-image,
    .help-step {
        transition: none;
    }
    
    .help-image:hover {
        transform: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .modal-content {
        border-width: 2px;
    }
    
    .help-category,
    .help-topic-item,
    .help-search-result {
        border-width: 2px;
    }
    
    .help-topic-link,
    .btn-outline {
        border-width: 2px;
    }
    
    .help-steps-container,
    .help-example-block,
    .help-note,
    .help-tip {
        border-width: 2px;
    }
    
    .help-image,
    .help-screenshot {
        border-width: 3px;
    }
}

/* Print Styles for Visual Content */
@media print {
    .help-image {
        max-width: 100%;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .help-steps-container,
    .help-example-block {
        break-inside: avoid;
        border: 1px solid #000;
    }
    
    .example-header {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .step-number {
        background: #000 !important;
        color: #fff !important;
    }
}