body {
    background-color: #f5f8fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#dropZone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

#dropZone.highlight {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 10px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#visualization {
    width: 100%;
    height: 400px;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.progress {
    height: 8px;
    border-radius: 4px;
}

.vector-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.search-result {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.similarity-score {
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 10px;
    background-color: #0d6efd;
    color: white;
}

/* Chat Interface Styles */
.chat-container {
    height: 450px;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-width: thin;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-message {
    display: flex;
    margin-bottom: 1rem;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
}

chat-message.user .chat-bubble {
    background-color: #0d6efd;
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-message.assistant .chat-bubble {
    background-color: #f0f2f5;
    color: #333;
    border-bottom-left-radius: 0.25rem;
}

.chat-message.system .chat-bubble {
    background-color: #fff3cd;
    color: #856404;
    border-radius: 0.75rem;
    width: 100%;
    text-align: center;
}

.chat-message.error .chat-bubble {
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 0.75rem;
    width: 100%;
    text-align: center;
}

.chat-bubble p {
    margin-bottom: 0;
}

.chat-bubble .sources {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.chat-bubble .sources a {
    color: inherit;
    text-decoration: underline;
}

.document-stats {
    font-size: 0.9rem;
}

.document-stats .badge {
    font-weight: normal;
}

/* Animation for processing */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.processing {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Code block styling */
pre {
    background-color: #272822;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Source citation styling */
.source-citation {
    display: inline-block;
    font-size: 0.7rem;
    background: rgba(13, 110, 253, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    color: #0d6efd;
    margin: 0 0.2rem;
    vertical-align: super;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.source-citation:hover {
    background: rgba(13, 110, 253, 0.2);
    text-decoration: underline;
}

/* Source text highlighting in modal */
.source-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 1rem;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    border-left: 3px solid #0d6efd;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Loading indicator */
.typing-indicator {
    display: flex;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #ccc;
    border-radius: 50%;
    margin: 0 2px;
    display: inline-block;
    animation: typing 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Document Library Styles */
.document-card {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.document-card .document-actions {
    position: absolute;
    right: 15px;
    top: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.document-card:hover .document-actions {
    opacity: 1;
}

.document-card .document-info {
    font-size: 0.85rem;
    color: #6c757d;
}

.document-card .document-info span {
    margin-right: 1rem;
}

.document-card .document-tags {
    margin-top: 0.5rem;
}

.document-card .document-tags .badge {
    margin-right: 0.25rem;
}

/* Better Progress Indicators */
.file-progress {
    height: 6px;
    background-color: #e9ecef;
    margin-top: 10px;
    border-radius: 3px;
    overflow: hidden;
}

.file-progress-bar {
    height: 100%;
    background-color: #0d6efd;
    width: 0;
    transition: width 0.3s ease;
}

.file-progress-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
    margin-top: 2px;
}

/* Multiple file upload area */
.multi-file-item {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
}

.multi-file-item .file-name {
    flex-grow: 1;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-file-item .file-size {
    color: #6c757d;
    margin-right: 10px;
    white-space: nowrap;
}

.multi-file-item .remove-file {
    color: #dc3545;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.multi-file-item .remove-file:hover {
    background-color: #f8d7da;
}

/* Document Selection Panel */
.document-selection-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0.5rem;
    background-color: #f8f9fa;
}

.document-selection-item {
    display: flex;
    align-items: flex-start;
    padding: 0.4rem 0.2rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.document-selection-item:hover {
    background-color: #f0f4f8;
}

.document-selection-item .form-check {
    margin: 0;
}

.document-selection-item .form-check-input {
    margin-top: 0.25rem;
}

.document-selection-item .document-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 0.1rem 0;
    line-height: 1.2;
    word-break: break-word;
}

.document-selection-item .document-info {
    font-size: 0.75rem;
    color: #6c757d;
    display: block;
}

.document-active-badge {
    display: inline-block;
    font-size: 0.65rem;
    background-color: #198754;
    color: white;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    margin-left: 0.3rem;
}

/* Multiple document indicator in chat messages */
.document-indicator {
    background: rgba(13, 110, 253, 0.1);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #0d6efd;
}

.document-indicator .document-tag {
    display: inline-block;
    background: rgba(13, 110, 253, 0.2);
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    margin: 0.1rem;
    font-size: 0.7rem;
}

/* Upload queue styles */
.upload-queue {
    margin-top: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
    padding: 1rem;
}

.upload-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.queue-actions {
    display: flex;
    gap: 0.5rem;
}

.queued-files {
    max-height: 300px;
    overflow-y: auto;
}

.queued-file {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    gap: 1rem;
}

.queued-file:last-child {
    border-bottom: none;
}

.queued-file.processing {
    background-color: rgba(13, 110, 253, 0.05);
}

.queued-file.completed {
    background-color: rgba(25, 135, 84, 0.05);
}

.queued-file.error {
    background-color: rgba(220, 53, 69, 0.05);
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 1.25rem;
    color: #6c757d;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-size {
    font-size: 0.75rem;
    color: #6c757d;
}

.file-progress {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.file-progress-bar {
    height: 100%;
    background-color: #0d6efd;
    transition: width 0.3s ease;
}

.file-status {
    white-space: nowrap;
    margin: 0 1rem;
    font-size: 0.875rem;
}

.file-actions {
    display: flex;
    align-items: center;
}

.remove-file:hover {
    background-color: rgba(220, 53, 69, 0.1);
}
