/**
 * Search UI Styles
 * Responsive styles for Arabic search interface
 */
:root {
    --font-headings: var(--font-family-arabic, 'Cairo', sans-serif);
    --font-content: var(--font-family-arabic, 'Cairo', sans-serif);
}

/* Search Container */
.search-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 11000;
    display: none;
    padding: 2rem;
    overflow-y: auto;
    direction: rtl;
}

.search-container.search-active {
    display: flex;
    flex-direction: column;
    animation: searchFadeIn 0.3s ease-out;
}

@keyframes searchFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Header */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: white;
}

.search-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.search-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Search Input Wrapper */
.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Input Container */
.search-input-container {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    direction: rtl;
    font-family: var(--font-content);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.search-input::placeholder {
    color: #999;
    font-style: italic;
}

.search-input-container .search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #666;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    color: #666;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-suggestion {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    direction: rtl;
    font-family: var(--font-content);
}

.search-suggestion:last-child {
    border-bottom: none;
}

.search-suggestion:hover,
.search-suggestion.active {
    background-color: #f8f9fa;
}

.search-suggestion.active {
    background-color: rgba(var(--color-primary-rgb), 0.1);
}

/* Enhanced Suggestion Styles */
.suggestion-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-icon {
    font-size: 0.9rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.suggestion-text {
    flex: 1;
    font-weight: 500;
}

.suggestion-category {
    font-size: 0.8rem;
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Different suggestion types */
.suggestion-basic {
    background: #fff;
}

.suggestion-contextual {
    background: rgba(var(--color-primary-rgb), 0.02);
    border-right: 3px solid var(--color-primary);
}

.suggestion-related {
    background: #f0f8f0;
    border-right: 3px solid #28a745;
}

.suggestion-phrase {
    background: #fff8f0;
    border-right: 3px solid #ffc107;
}

.suggestion-phrase .suggestion-text {
    font-style: italic;
}

/* Suggestion hover effects */
.suggestion-contextual:hover {
    background: rgba(var(--color-primary-rgb), 0.05);
}

.suggestion-related:hover {
    background: #e8f5e8;
}

.suggestion-phrase:hover {
    background: #fff5e8;
}

/* Advanced Search Toggle (next to search input) */
.advanced-search-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.advanced-search-checkbox:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.advanced-search-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Advanced Search Modal */
.advanced-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 11100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.advanced-search-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.advanced-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.advanced-search-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-family: 'Cairo', sans-serif;
    color: #333;
}

.advanced-search-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.advanced-search-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.advanced-search-body {
    padding: 1.5rem;
}

.advanced-search-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.advanced-search-apply {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.advanced-search-apply:hover {
    background-color: var(--color-primary-dark);
}

.advanced-search-apply:active {
    transform: scale(0.98);
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-family: 'Cairo', sans-serif;
}

.search-match-mode,
.search-type-filter,
.search-sort-filter {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    direction: rtl;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-match-mode:hover,
.search-type-filter:hover,
.search-sort-filter:hover {
    border-color: var(--color-primary);
}

.search-match-mode:focus,
.search-type-filter:focus,
.search-sort-filter:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.search-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

/* Search Help Section */
.search-help {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    margin-top: 0.5rem;
}

.search-tip {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
}

.search-tip:last-child {
    margin-bottom: 0;
}

.search-tip strong {
    color: #007cba;
    font-family: 'Courier New', monospace;
    background: #e3f2fd;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.8rem;
}

.search-help-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
}

/* Search Results */
.search-results {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    max-height: 70vh;
    overflow-y: auto;
}

.search-results-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-results-header h3 {
    margin: 0;
    color: #333;
    font-family: 'Cairo', sans-serif;
    font-size: 1.2rem;
}

.results-count {
    color: #666;
    font-size: 0.9rem;
    font-family: 'Cairo', sans-serif;
}

.search-results-list {
    padding: 0;
}

/* Search Result Item */
.search-result {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s, transform 0.2s;
    opacity: 0;
    transform: translateY(15px);
    animation: resultAppear 0.4s ease-out forwards;
}

@keyframes resultAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover {
    background-color: #f8f9fa;
    transform: translateX(-5px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.result-title {
    margin: 0;
    flex: 1;
}

.result-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-headings);
    line-height: 1.4;
    transition: color 0.2s;
}

.result-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.occurrence-count {
    color: #666;
    font-size: 0.85rem;
    font-weight: normal;
    font-family: 'Cairo', sans-serif;
    margin-right: 0.5rem;
}

.result-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.result-type {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
}

.result-occurrences {
    background: #fff3e0;
    color: #e65100;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.result-snippet {
    margin: 0.5rem 0;
    color: #555;
    line-height: 1.6;
    font-family: var(--font-content);
}

.result-snippet .search-highlight,
.result-snippet mark {
    background: #ffcc00;
    /* More vibrant orange-yellow */
    color: #000;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
    font-weight: 700;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

.result-actions {
    margin-top: 0.75rem;
}

.result-read-link {
    color: #28a745;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    transition: color 0.2s;
}

.result-read-link:hover {
    color: #1e7e34;
    text-decoration: underline;
}

/* No Results */
.search-no-results {
    padding: 3rem 2rem;
    text-align: center;
    color: #666;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.search-no-results h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-family: 'Cairo', sans-serif;
}

.search-no-results p {
    margin: 0 0 1.5rem 0;
    font-family: var(--font-content);
}

.search-suggestions-text {
    text-align: right;
    max-width: 400px;
    margin: 0 auto;
}

.search-suggestions-text ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.search-suggestions-text li {
    padding: 0.25rem 0;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
}

.search-suggestions-text li:before {
    content: "• ";
    color: var(--color-primary);
    margin-left: 0.5rem;
}

/* Search Error */
.search-error {
    padding: 3rem 2rem;
    text-align: center;
    color: #dc3545;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.search-error h3 {
    margin: 0 0 1rem 0;
    color: #dc3545;
    font-family: 'Cairo', sans-serif;
}

.search-error p {
    margin: 0;
    font-family: var(--font-content);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-container {
        padding: 1rem;
    }

    .search-header h2 {
        font-size: 1.3rem;
    }

    .search-input-wrapper {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .advanced-search-checkbox {
        justify-content: center;
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }

    .search-input {
        font-size: 1rem;
        padding: 0.875rem 2.5rem 0.875rem 0.875rem;
    }

    .search-options {
        flex-direction: column;
        gap: 0.5rem;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-meta {
        align-self: flex-end;
    }

    .search-results {
        max-height: 60vh;
    }

    .search-results-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .search-result {
        padding: 1rem;
    }

    .advanced-search-modal {
        padding: 1rem;
    }

    .advanced-search-content {
        max-width: 100%;
    }

    .advanced-search-header {
        padding: 1rem;
    }

    .advanced-search-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .search-container {
        padding: 0.5rem;
    }

    .search-input {
        font-size: 0.9rem;
    }

    .result-link {
        font-size: 1rem;
    }

    .search-no-results,
    .search-error {
        padding: 2rem 1rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .search-input {
        border-color: #000;
    }

    .search-input:focus {
        border-color: #000;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
    }

    .search-suggestion:hover,
    .search-suggestion.active {
        background-color: #000;
        color: #fff;
    }

    .result-link {
        color: #000;
    }

    .result-link:hover {
        color: #000;
        text-decoration: underline;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .search-container.search-active {
        animation: none;
    }

    .search-input,
    .search-clear,
    .search-suggestion,
    .result-link {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .search-container {
        display: none !important;
    }
}

/* Focus Styles for Accessibility */
.search-input:focus,
.search-close:focus,
.search-clear:focus,
.result-link:focus,
.result-read-link:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* Dark Theme for Search UI */
[data-theme="dark"] .search-container {
    background: rgba(26, 26, 26, 0.95);
}

[data-theme="dark"] .search-header {
    color: #ecf0f1;
}

[data-theme="dark"] .search-header h2 {
    color: #ecf0f1;
}

[data-theme="dark"] .search-close {
    color: #ecf0f1;
}

[data-theme="dark"] .search-close:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .search-input {
    background: #2c3e50;
    color: #ecf0f1;
    border-color: #4a5568;
}

[data-theme="dark"] .search-input:focus {
    border-color: #5dade2;
    box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.2);
}

[data-theme="dark"] .search-input::placeholder {
    color: #bdc3c7;
}

[data-theme="dark"] .search-icon {
    color: #bdc3c7;
}

[data-theme="dark"] .search-clear {
    color: #bdc3c7;
}

[data-theme="dark"] .search-clear:hover {
    color: #ecf0f1;
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .search-filters {
    background: #2c3e50;
    border-color: #4a5568;
}

[data-theme="dark"] .filter-group label {
    color: #ecf0f1;
}

[data-theme="dark"] .search-match-mode,
[data-theme="dark"] .search-type-filter,
[data-theme="dark"] .search-sort-filter {
    background: #2c3e50;
    color: #ecf0f1;
    border-color: #4a5568;
}

[data-theme="dark"] .search-match-mode:hover,
[data-theme="dark"] .search-type-filter:hover,
[data-theme="dark"] .search-sort-filter:hover {
    border-color: #5dade2;
}

[data-theme="dark"] .search-match-mode:focus,
[data-theme="dark"] .search-type-filter:focus,
[data-theme="dark"] .search-sort-filter:focus {
    border-color: #5dade2;
    box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.2);
}

[data-theme="dark"] .filter-checkbox:checked+.filter-label {
    background: #5dade2;
    color: #fff;
}

[data-theme="dark"] .search-results-container {
    background: #2c3e50;
    border-color: #4a5568;
}

[data-theme="dark"] .search-results-header {
    color: #ecf0f1;
    border-bottom-color: #4a5568;
}

[data-theme="dark"] .search-result-item {
    background: #34495e;
    border-color: #4a5568;
}

[data-theme="dark"] .search-result-item:hover {
    background: #3d5a73;
    border-color: #5dade2;
}

[data-theme="dark"] .result-title {
    color: #5dade2;
}

[data-theme="dark"] .result-chapter {
    color: #85c1e9;
}

[data-theme="dark"] .result-snippet {
    color: #bdc3c7;
}

[data-theme="dark"] .result-snippet mark {
    background: #f8c471;
    color: #1a1a1a;
}

[data-theme="dark"] .result-meta {
    color: #95a5a6;
}

[data-theme="dark"] .no-results {
    color: #bdc3c7;
}

[data-theme="dark"] .no-results-icon {
    color: #7f8c8d;
}

[data-theme="dark"] .search-suggestions {
    background: #2c3e50;
    border-color: #4a5568;
}

[data-theme="dark"] .suggestion-item {
    color: #ecf0f1;
    border-bottom-color: #4a5568;
}

[data-theme="dark"] .suggestion-item:hover {
    background: #34495e;
}

[data-theme="dark"] .search-stats {
    color: #bdc3c7;
}

[data-theme="dark"] .search-loading {
    color: #ecf0f1;
}

[data-theme="dark"] .search-error {
    background: #c0392b;
    color: #ecf0f1;
    border-color: #e74c3c;
}


/* Search Result Highlighting */
.result-snippet mark,
.search-result-item mark {
    background: #ff9800;
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Dark mode highlighting */
[data-theme="dark"] .result-snippet mark,
[data-theme="dark"] .search-result-item mark {
    background: #ff9800;
    color: #1a1a1a;
}


/* ========================================
   SEPIA THEME SUPPORT
   ======================================== */

[data-theme="sepia"] .search-container {
    background: rgba(244, 236, 216, 0.98);
}

[data-theme="sepia"] .search-header,
[data-theme="sepia"] .search-header h2 {
    color: #5c4b37;
}

[data-theme="sepia"] .search-close {
    color: #5c4b37;
}

[data-theme="sepia"] .search-close:hover {
    background-color: rgba(92, 75, 55, 0.1);
}

[data-theme="sepia"] .search-input {
    background: #faf7f0;
    color: #5c4b37;
    border-color: #d4c8b4;
}

[data-theme="sepia"] .search-input:focus {
    border-color: #8b6914;
    box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.2);
}

[data-theme="sepia"] .search-input::placeholder {
    color: #9a8a76;
}

[data-theme="sepia"] .search-icon {
    color: #9a8a76;
}

[data-theme="sepia"] .search-clear {
    color: #9a8a76;
}

[data-theme="sepia"] .search-clear:hover {
    color: #5c4b37;
    background-color: rgba(92, 75, 55, 0.1);
}

[data-theme="sepia"] .search-filters {
    background: #e8dcc8;
    border-color: #d4c8b4;
}

[data-theme="sepia"] .filter-group label {
    color: #5c4b37;
}

[data-theme="sepia"] .search-match-mode,
[data-theme="sepia"] .search-type-filter,
[data-theme="sepia"] .search-sort-filter {
    background: #faf7f0;
    color: #5c4b37;
    border-color: #d4c8b4;
}

[data-theme="sepia"] .search-match-mode:hover,
[data-theme="sepia"] .search-type-filter:hover,
[data-theme="sepia"] .search-sort-filter:hover {
    border-color: #8b6914;
}

[data-theme="sepia"] .search-match-mode:focus,
[data-theme="sepia"] .search-type-filter:focus,
[data-theme="sepia"] .search-sort-filter:focus {
    border-color: #8b6914;
    box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.2);
}

[data-theme="sepia"] .filter-checkbox:checked+.filter-label {
    background: #8b6914;
    color: #fff;
}

[data-theme="sepia"] .search-results-container {
    background: #faf7f0;
    border-color: #d4c8b4;
}

[data-theme="sepia"] .search-results-header {
    color: #5c4b37;
    border-bottom-color: #d4c8b4;
}

[data-theme="sepia"] .search-result-item {
    background: #f4ecd8;
    border-color: #d4c8b4;
}

[data-theme="sepia"] .search-result-item:hover {
    background: #e8dcc8;
    border-color: #8b6914;
}

[data-theme="sepia"] .result-title {
    color: #8b6914;
}

[data-theme="sepia"] .result-chapter {
    color: #a67c00;
}

[data-theme="sepia"] .result-snippet {
    color: #7a6a56;
}

[data-theme="sepia"] .result-snippet mark {
    background: #f39c12;
    color: #5c4b37;
}

[data-theme="sepia"] .result-meta {
    color: #9a8a76;
}

[data-theme="sepia"] .no-results {
    color: #7a6a56;
}

[data-theme="sepia"] .no-results-icon {
    color: #9a8a76;
}

[data-theme="sepia"] .search-suggestions {
    background: #faf7f0;
    border-color: #d4c8b4;
}

[data-theme="sepia"] .suggestion-item {
    color: #5c4b37;
    border-bottom-color: #d4c8b4;
}

[data-theme="sepia"] .suggestion-item:hover {
    background: #e8dcc8;
}

[data-theme="sepia"] .search-stats {
    color: #7a6a56;
}

[data-theme="sepia"] .search-loading {
    color: #5c4b37;
}

[data-theme="sepia"] .search-error {
    background: #d4a574;
    color: #5c4b37;
    border-color: #c49464;
}

/* ========================================
   HIGH CONTRAST THEME SUPPORT
   ======================================== */

[data-theme="high-contrast"] .search-container {
    background: rgba(0, 0, 0, 0.98);
}

[data-theme="high-contrast"] .search-header,
[data-theme="high-contrast"] .search-header h2 {
    color: #ffffff;
}

[data-theme="high-contrast"] .search-close {
    color: #ffffff;
}

[data-theme="high-contrast"] .search-close:hover {
    background-color: #333333;
}

[data-theme="high-contrast"] .search-input {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #ffffff;
}

[data-theme="high-contrast"] .search-input:focus {
    border-color: #00ff00;
    box-shadow: 0 0 0 3px rgba(0, 255, 0, 0.3);
}

[data-theme="high-contrast"] .search-input::placeholder {
    color: #cccccc;
}

[data-theme="high-contrast"] .search-icon {
    color: #ffffff;
}

[data-theme="high-contrast"] .search-clear {
    color: #ffffff;
}

[data-theme="high-contrast"] .search-clear:hover {
    color: #00ff00;
    background-color: #333333;
}

[data-theme="high-contrast"] .search-filters {
    background: #1a1a1a;
    border-color: #ffffff;
}

[data-theme="high-contrast"] .filter-group label {
    color: #ffffff;
}

[data-theme="high-contrast"] .search-match-mode,
[data-theme="high-contrast"] .search-type-filter,
[data-theme="high-contrast"] .search-sort-filter {
    background: #000000;
    color: #ffffff;
    border-color: #ffffff;
}

[data-theme="high-contrast"] .search-match-mode:hover,
[data-theme="high-contrast"] .search-type-filter:hover,
[data-theme="high-contrast"] .search-sort-filter:hover {
    border-color: #00ff00;
}

[data-theme="high-contrast"] .search-match-mode:focus,
[data-theme="high-contrast"] .search-type-filter:focus,
[data-theme="high-contrast"] .search-sort-filter:focus {
    border-color: #00ff00;
    box-shadow: 0 0 0 3px rgba(0, 255, 0, 0.3);
}

[data-theme="high-contrast"] .filter-checkbox:checked+.filter-label {
    background: #00ff00;
    color: #000000;
}

[data-theme="high-contrast"] .search-results-container {
    background: #000000;
    border-color: #ffffff;
}

[data-theme="high-contrast"] .search-results-header {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

[data-theme="high-contrast"] .search-result-item {
    background: #1a1a1a;
    border-color: #ffffff;
}

[data-theme="high-contrast"] .search-result-item:hover {
    background: #333333;
    border-color: #00ff00;
}

[data-theme="high-contrast"] .result-title {
    color: #00ff00;
}

[data-theme="high-contrast"] .result-chapter {
    color: #66ff66;
}

[data-theme="high-contrast"] .result-snippet {
    color: #f0f0f0;
}

[data-theme="high-contrast"] .result-snippet mark {
    background: #ffff00;
    color: #000000;
}

[data-theme="high-contrast"] .result-meta {
    color: #cccccc;
}

[data-theme="high-contrast"] .no-results {
    color: #ffffff;
}

[data-theme="high-contrast"] .no-results-icon {
    color: #cccccc;
}

[data-theme="high-contrast"] .search-suggestions {
    background: #000000;
    border-color: #ffffff;
}

[data-theme="high-contrast"] .suggestion-item {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

[data-theme="high-contrast"] .suggestion-item:hover {
    background: #333333;
}

[data-theme="high-contrast"] .search-stats {
    color: #cccccc;
}

[data-theme="high-contrast"] .search-loading {
    color: #ffffff;
}

[data-theme="high-contrast"] .search-error {
    background: #ff0000;
    color: #ffffff;
    border-color: #ffffff;
}

[data-theme="high-contrast"] .result-snippet mark,
[data-theme="high-contrast"] .search-result-item mark {
    background: #ffff00;
    color: #000000;
}
