/* semantic.css - استایل‌های اختصاصی صفحه جستجوی معنایی */

#semanticForm {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

/* Search Input Wrapper */
.search-input-wrapper {
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: visible;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
    border-color: #86b7fe;
}

.search-input-wrapper .input-group-text {
    border-color: #dee2e6;
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within .input-group-text {
    border-color: #86b7fe;
    background-color: #f8f9ff;
}

#semanticInput {
    border-color: #dee2e6;
    transition: all 0.2s ease;
    font-size: 1rem;
}

#semanticInput:focus {
    border-color: #86b7fe;
    box-shadow: none;
    background-color: #fff;
}

#semanticInput::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

/* Search Button */
#semanticSearchBtn {
    min-height: 48px;
    font-weight: 600;
    border-radius: 8px 0 0 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#semanticSearchBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

#semanticSearchBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

#semanticSearchBtn i {
    transition: transform 0.2s ease;
}

#semanticSearchBtn:hover i {
    transform: scale(1.1);
}

/* File Select */
#fileSelect {
    border-color: #dee2e6;
    transition: all 0.2s ease;
    font-size: 1rem;
    cursor: pointer;
}

#fileSelect:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

.input-group-lg .input-group-text {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.input-group-lg .form-control,
.input-group-lg .form-select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

/* Form Labels */
#semanticForm .form-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

#semanticForm .form-label:hover {
    color: #495057 !important;
}

#semanticForm .form-label i {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#semanticForm .form-label:hover i {
    opacity: 1;
}

/* Input Group Enhancements */
.input-group-lg>.input-group-text {
    border-radius: 8px 0 0 8px;
}

.input-group-lg>.form-control:not(:first-child),
.input-group-lg>.form-select:not(:first-child) {
    border-radius: 0;
}

.input-group-lg>.btn:not(:first-child) {
    border-radius: 0 8px 8px 0;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .search-input-wrapper {
        margin-bottom: 0.5rem;
    }

    #semanticSearchBtn {
        width: 100%;
        border-radius: 0 0 8px 8px;
    }

    .input-group-lg>.btn:not(:first-child) {
        border-radius: 0 0 8px 8px;
    }
}

@media (max-width: 575.98px) {
    #semanticForm {
        padding: 1rem;
    }

    .input-group-lg .form-control,
    .input-group-lg .form-select,
    .input-group-lg .input-group-text {
        font-size: 0.95rem;
        padding: 0.65rem 0.85rem;
    }
}

/* Advanced Options Section */
#advancedOptions {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

#advancedOptions .border-top {
    border-color: #e2e8f0 !important;
}

#advancedOptions .form-label {
    transition: color 0.2s ease;
}

#advancedOptions .form-label:hover {
    color: #495057 !important;
}

/* Hybrid Settings Container */
#hybridSettingsContainer {
    transition: opacity 0.3s ease;
}

#hybridBalance:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Rerank Settings Container */
#rerankSettingsContainer {
    transition: opacity 0.3s ease;
}

#rerankStrategy:disabled,
#maxRerankTime:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

/* Form Controls Enhancement */
#advancedOptions .form-control-sm,
#advancedOptions .form-select-sm {
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

#advancedOptions .form-control-sm:focus,
#advancedOptions .form-select-sm:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

#advancedOptions .form-range {
    cursor: pointer;
}

#advancedOptions .form-range::-webkit-slider-thumb {
    background: #0d6efd;
    transition: all 0.2s ease;
}

#advancedOptions .form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

#advancedOptions .form-range::-moz-range-thumb {
    background: #0d6efd;
    transition: all 0.2s ease;
}

#advancedOptions .form-range::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

/* Switch Enhancement */
#advancedOptions .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

#advancedOptions .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Button Enhancement */
#advancedOptions .btn-outline-secondary {
    border-color: #6c757d;
    transition: all 0.2s ease;
}

#advancedOptions .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

/* Rerank Strategy Select */
#rerankStrategy {
    min-height: 38px;
}

/* Max Rerank Time Input */
#maxRerankTime {
    min-height: 38px;
}

/* Enhanced Badge Styling */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-outline-secondary {
    color: #6c757d;
    border: 1px solid #6c757d;
    background-color: transparent;
}

.badge-outline-info {
    color: #0dcaf0;
    border: 1px solid #0dcaf0;
    background-color: transparent;
}

.badge-outline-warning {
    color: #ffc107;
    border: 1px solid #ffc107;
    background-color: transparent;
}

/* Score Badges Container */
.score-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

/* Component Scores Row */
.component-scores-row {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    justify-content: flex-end;
}

/* Strategy Weights */
.strategy-weights {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.strategy-weights .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Meta Bar Badges */
.meta-bar .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.meta-bar .badge.bg-info {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
    border: 1px solid #bee5eb;
}

.meta-bar .badge.bg-secondary {
    background-color: #e2e3e5 !important;
    color: #383d41 !important;
    border: 1px solid #d6d8db;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .score-badges-container {
        flex-direction: column;
        align-items: flex-end;
    }

    .component-scores-row {
        justify-content: flex-start;
    }
}

#resultsContainer {
    background-color: var(--surface-muted);
    border-radius: 0 0 12px 12px;
}

#resultsEmptyState {
    padding: 3rem;
}

/* تب‌های نتایج */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--muted-text);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
}

.nav-tabs .nav-link.active {
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary-light);
    background-color: transparent;
}

.tab-content {
    padding: 1rem;
    flex-grow: 1;
    overflow: auto;
}

/* رسپانسیو */
@media (max-width: 576px) {
    #semanticForm .col-lg-1 {
        margin-top: 0.5rem;
    }

    #semanticSearchBtn {
        width: 100%;
    }
}

/* Snippet Content Styling */
.snippet-content {
    white-space: pre-line;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.source-text {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.5rem;
}

/* Highlight styling */
.snippet-content mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.1em 0.2em;
    border-radius: 3px;
    font-weight: 500;
}

/* Section Info Styling */
.section-info {
    margin-bottom: 0.75rem;
}

.section-info .badge {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.6rem;
    border: 1px solid #d6d3d1;
    background-color: #f5f5f4 !important;
    color: #57534e !important;
}

.section-info .fas {
    color: #78716c;
    margin-right: 0.25rem;
}

/* Enhanced section display for better readability */
.section-info .badge:hover {
    background-color: #e7e5e4 !important;
    border-color: #a8a29e;
}

/* Autocomplete Dropdown Styles */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 2px;
}

.autocomplete-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.autocomplete-list {
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

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

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #e3f2fd;
    color: #1976d2;
}

.autocomplete-item .fas {
    font-size: 0.875rem;
    opacity: 0.7;
}

.autocomplete-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Clear history button */
#clearHistoryBtn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

#clearHistoryBtn:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Responsive adjustments for autocomplete */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        font-size: 0.9rem;
    }

    .autocomplete-item {
        padding: 0.6rem;
    }

    .autocomplete-header {
        padding: 0.4rem 0.6rem;
    }
}

/* New Result Item Design - Matching Image */
.list-group .result-item-new {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.list-group .result-item-new:hover {
    border-color: #d8b4fe;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.1);
    transform: translateY(-2px);
}

.result-item-new {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: visible;
}

.result-item-new:hover {
    border-color: #d8b4fe;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
    transform: translateY(-2px);
}

/* Clickable result items (with payload data) */
.result-item-new[data-file-id][data-payload-id] {
    cursor: pointer;
}

.result-item-new[data-file-id][data-payload-id]:hover {
    border-color: #c084fc;
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.2);
}

.result-item-new:last-child {
    margin-bottom: 0;
}

.result-item-new:last-child .result-separator {
    display: none;
}

/* List group container styling */
.list-group {
    padding: 0;
    background: transparent;
    border: none;
    gap: 0;
}

.list-group-item {
    border: none;
    padding: 0;
    background: transparent;
    margin-bottom: 0;
}

/* Additional card styling for better separation */
.result-item-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #d8b4fe 50%, transparent 100%);
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-item-new:hover::before {
    opacity: 1;
}

.result-item-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
}

/* Main Content Area */
.result-main-content {
    flex: 1;
    min-width: 0;
}

/* Source Reference */
.result-source-reference {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    direction: rtl;
    text-align: right;
}

.source-title {
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 500;
}

.source-volume-page {
    background-color: #e9d5ff;
    color: #6b21a8;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Quoted Text */
.result-quote-text {
    color: #1f2937;
    font-size: 1.0rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    direction: rtl;
    text-align: right;
    font-weight: 400;
}

/* Purple Circular Number Badge (Right Side) */
.result-number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #9333ea;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Creative Separator Design with Elegant Pattern - Islamic Style */
.result-separator {
    position: relative;
    height: 16px;
    margin: 0.5rem 0 0.25rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Main gradient line - thinner and more subtle */
.result-separator::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 0.5px;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(180, 155, 100, 0.2) 15%,
            rgba(180, 155, 100, 0.4) 30%,
            rgba(180, 155, 100, 0.5) 40%,
            rgba(180, 155, 100, 0.6) 50%,
            rgba(180, 155, 100, 0.5) 60%,
            rgba(180, 155, 100, 0.4) 70%,
            rgba(180, 155, 100, 0.2) 85%,
            transparent 100%);
}

/* Decorative pattern on sides - Islamic geometric style */
.result-separator::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 12px;
    background-image:
        repeating-linear-gradient(90deg,
            transparent,
            transparent 6px,
            rgba(180, 155, 100, 0.25) 6px,
            rgba(180, 155, 100, 0.25) 7px);
    opacity: 0.4;
    z-index: 0;
}

/* Enhanced Diamond with Islamic golden style - thinner and more elegant */
.separator-diamond {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #d4af37 0%, #c9a227 25%, #b8941e 50%, #a67c00 75%, #8b6914 100%);
    transform: rotate(45deg);
    position: relative;
    z-index: 2;
    box-shadow:
        0 0 0 3px white,
        0 0 0 4px rgba(180, 155, 100, 0.15),
        0 0 6px rgba(180, 155, 100, 0.25),
        0 0 12px rgba(180, 155, 100, 0.15),
        inset 0 0 4px rgba(255, 255, 255, 0.4);
    animation: separatorPulse 5s ease-in-out infinite;
    transition: all 0.3s ease;
}

.separator-diamond:hover {
    transform: rotate(45deg) scale(1.1);
    box-shadow:
        0 0 0 3px white,
        0 0 0 4px rgba(180, 155, 100, 0.2),
        0 0 8px rgba(180, 155, 100, 0.35),
        0 0 16px rgba(180, 155, 100, 0.2),
        inset 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Inner highlight */
.separator-diamond::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 3px;
    height: 3px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.6) 100%);
    border-radius: 1px;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.9);
}

/* Outer glow effect - subtle golden glow */
.separator-diamond::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 155, 100, 0.12) 0%, transparent 70%);
    z-index: -1;
    animation: separatorGlow 5s ease-in-out infinite;
}

@keyframes separatorPulse {

    0%,
    100% {
        box-shadow:
            0 0 0 3px white,
            0 0 0 4px rgba(180, 155, 100, 0.15),
            0 0 6px rgba(180, 155, 100, 0.25),
            0 0 12px rgba(180, 155, 100, 0.15),
            inset 0 0 4px rgba(255, 255, 255, 0.4);
    }

    50% {
        box-shadow:
            0 0 0 3px white,
            0 0 0 4px rgba(180, 155, 100, 0.2),
            0 0 8px rgba(180, 155, 100, 0.35),
            0 0 16px rgba(180, 155, 100, 0.2),
            inset 0 0 5px rgba(255, 255, 255, 0.5);
    }
}

@keyframes separatorGlow {

    0%,
    100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Small decorative dots on extreme sides - golden subtle */
.result-separator {
    background-image:
        radial-gradient(circle, rgba(180, 155, 100, 0.3) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(180, 155, 100, 0.3) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    background-position:
        calc(50% - 50px) center,
        calc(50% + 50px) center;
    background-repeat: no-repeat;
}

/* Component Scores and Strategy Info - Hidden by default, can be shown on hover or toggle */
.result-item-new .component-scores-row,
.result-item-new .strategy-weights {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

/* JSON Metadata Styling */
.result-item-new .json-metadata {
    margin-top: 0.5rem;
    margin-bottom: 0.5;
    padding: 0.7rem 1rem;
    background: rgba(249, 250, 251, 0.6);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.425rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.result-item-new .json-metadata span:not(.json-separator) {
    color: #4b5563;
    font-weight: 500;
    padding: 0.25rem 0;
}

.result-item-new .json-metadata .json-separator {
    color: #d1d5db;
    font-weight: 300;
    margin: 0 0.125rem;
    opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .result-item-content {
        gap: 0.75rem;
    }

    .result-number-badge {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }



    .source-title {
        font-size: 0.85rem;
    }

    .source-volume-page {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }

    .result-item-new .json-metadata {
        padding: 0.475rem 1rem;
        font-size: 0.7rem;
        gap: 0.3rem;
        margin-top: 0.375rem;
        margin-bottom: 0.425rem;
    }
}

/* Payload Modal Styles */
#payloadModal .modal-dialog {
    max-width: 90%;
}

#payloadModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

#payloadModal .modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    background-color: #f9fafb;
}

#payloadModal .modal-header .modal-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

#payloadModal .modal-body {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 1.5rem;
}

#payloadModal .payload-item {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

#payloadModal .payload-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

#payloadModal .payload-item dt {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

#payloadModal .payload-item dd {
    word-break: break-word;
    line-height: 1.6;
}

#payloadModal .payload-item .text-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
    color: #1f2937;
}

#payloadModal .payload-item pre {
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.85rem;
    margin-bottom: 0;
    border-radius: 6px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

/* Responsive adjustments for payload modal */
@media (max-width: 768px) {
    #payloadModal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem;
    }

    #payloadModal .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 120px);
    }

    #payloadModal .modal-header {
        padding: 0.75rem 1rem;
    }

    #payloadModal .payload-item dt {
        margin-bottom: 0.25rem;
        font-size: 0.8rem;
    }

    #payloadModal .payload-item dd {
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }
}

/* RAG Response Container Styling */
.rag-response-box {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.rag-response-header {
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.rag-response-header:hover {
    background-color: #f9fafb;
}

.rag-response-header .fa-chevron-up,
.rag-response-header .fa-chevron-down {
    transition: transform 0.2s ease;
}

.rag-response-body {
    padding: 0;
    background-color: #ffffff;
}

.rag-response-content {
    padding: 1rem 1.25rem;
    line-height: 1.8;
    color: #1f2937;
    direction: rtl;
    text-align: right;
}

.rag-generate-btn {
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #374151;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.rag-generate-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rag-generate-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.rag-response-content.markdown-content {
    padding: 1rem 1.25rem;
}

.rag-response-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.rag-response-content h3,
.rag-response-content h4,
.rag-response-content h5 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #111827;
}

.rag-response-content h3 {
    font-size: 1.5rem;
}

.rag-response-content h4 {
    font-size: 1.25rem;
}

.rag-response-content h5 {
    font-size: 1.1rem;
}

.rag-response-content ul,
.rag-response-content ol {
    margin-bottom: 1rem;
    padding-right: 2rem;
    line-height: 1.8;
}

.rag-response-content li {
    margin-bottom: 0.5rem;
}

.rag-response-content code {
    background-color: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: #dc2626;
}

.rag-response-content strong {
    font-weight: 600;
    color: #111827;
}

.rag-response-content em {
    font-style: italic;
    color: #4b5563;
}

/* Responsive adjustments for RAG response */
@media (max-width: 768px) {
    .rag-response-header {
        padding: 0.625rem 0.875rem;
    }

    .rag-response-content {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .rag-generate-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .rag-response-content h3 {
        font-size: 1.25rem;
    }

    .rag-response-content h4 {
        font-size: 1.1rem;
    }

    .rag-response-content h5 {
        font-size: 1rem;
    }

    .rag-response-content ul,
    .rag-response-content ol {
        padding-right: 1.5rem;
    }
}