.sources-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.sources-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.source-item {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.9em;
    border-radius: var(--radius-sm);
    background: var(--background);
    border: 1px solid var(--border);
}

.source-file {
    font-weight: 500;
    color: var(--text-primary);
}

.source-page {
    color: var(--primary-color);
    font-weight: 500;
}

.source-score {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-left: auto;
}


.clickable-source {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.clickable-source .source-file,
.clickable-source .source-page {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.clickable-source:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.clickable-source:hover .source-file,
.clickable-source:hover .source-page {
    text-decoration-style: solid;
    color: var(--primary-color);
}




.thumbnail-preview {
    position: fixed;
    z-index: 9999;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    max-height: 400px;
    background: var(--surface);
    padding: 8px;
    border: 1px solid var(--border);
    animation: thumbnailFadeIn 0.2s ease;
}

@keyframes thumbnailFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.thumbnail-preview img {
    max-width: 100%;
    max-height: 380px;
    border-radius: var(--radius-md);
    display: block;
}


.source-page-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.source-page-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 95vw;
    max-height: 95vh;
    width: 75vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.source-page-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: white;
    flex-shrink: 0;
    z-index: 10;
    position: relative;
}

.source-page-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}



.source-page-modal-body {
    padding: 20px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: #e0e0e0;
    min-height: 0;
    position: relative;
}

.source-page-modal-body img {
    display: block;
    cursor: grab;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: none !important;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    will-change: transform;
}

.source-page-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}


.source-page-modal-body img:active {
    cursor: grabbing;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}
.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}
.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}


.close-modal {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #dc3545;
    font-weight: bold;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
}

.close-modal:hover {
    color: #ff0000;
    transform: scale(1.1);
}


.help-feedback-content {
    width: 600px;
    max-width: 90vw;
    height: auto;
    max-height: 80vh;
}
.help-feedback-body {
    padding: 20px;
    overflow-y: auto;
}



.feedback-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    background: #ffffff;
}

.feedback-form textarea:focus {
    outline: none;
    border-color: #8a00e5;
    box-shadow: 0 0 0 3px rgba(138, 0, 229, 0.1);
}
