/* Vice AI Styles */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    margin: 0;
}

.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chat-sidebar {
    max-height: calc(100vh - 56px); /* Account for navbar */
    overflow-y: auto;
}

.chat-main {
    height: calc(100vh - 56px); /* Account for navbar */
}

#chatContainer {
    background-color: #f8f9fa;
}

#chatMessages {
    min-height: 100%;
}

.message {
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    text-align: right;
}

.user-message .message-content {
    background-color: #007bff;
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
    display: inline-block;
    max-width: 70%;
    word-wrap: break-word;
}

.ai-message {
    text-align: left;
}

.ai-message .message-content {
    background-color: white;
    color: #333;
    border: 1px solid #dee2e6;
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
    display: inline-block;
    max-width: 70%;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-timestamp {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
}

.welcome-message {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    margin: 2rem;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.navbar-brand {
    font-size: 1.5rem;
}

.toast {
    min-width: 300px;
}

.card {
    border-radius: 12px;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-sidebar {
        display: none;
    }
    
    .chat-main {
        margin-left: 0;
    }
    
    .user-message .message-content,
    .ai-message .message-content {
        max-width: 85%;
    }
}

/* Scrollbar styling */
.chat-sidebar::-webkit-scrollbar,
#chatContainer::-webkit-scrollbar {
    width: 6px;
}

.chat-sidebar::-webkit-scrollbar-track,
#chatContainer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

.chat-sidebar::-webkit-scrollbar-thumb:hover,
#chatContainer::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Message action buttons */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.ai-message:hover .message-actions {
    opacity: 1;
}

.message-action-btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    background-color: transparent;
    border: 1px solid #dee2e6;
    color: #6c757d;
    cursor: pointer;
    min-width: auto;
    line-height: 1;
}

.message-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.message-action-btn i {
    font-size: 12px;
}

/* Toast notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 1050;
    display: flex;
    align-items: center;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast-info {
    background-color: #17a2b8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Progress message styles */
.progress-message {
    border-left: 4px solid #007bff;
    background-color: #f8f9fa;
}

.progress-message .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.progress-message .alert {
    margin-bottom: 0;
    border: none;
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 4px solid #007bff;
}

.task-cancel-btn {
    font-size: 0.875rem;
}

/* Animation for progress updates */
@keyframes pulseProgress {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.progress-updating {
    animation: pulseProgress 1s ease-in-out;
}

/* Document Upload Styles */
#dropZone {
    transition: all 0.2s ease;
    cursor: pointer;
}

#dropZone:hover {
    background-color: #f8f9fa !important;
    border-color: #6c757d !important;
}

#dropZone.dragover {
    background-color: #e3f2fd !important;
    border-color: #2196f3 !important;
}

.document-item {
    border-bottom: 1px solid #e9ecef;
    padding: 8px 0;
}

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

.document-status {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-details {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.document-remove {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.document-remove:hover {
    background-color: #dc3545;
    color: white;
}

/* Reference section styles */
.reference-item {
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.btn-xs {
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.2;
}

/* Upload progress animation */
@keyframes uploadSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chat message styling for new workspace */
.chat-message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-in;
}

.chat-message.user {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.chat-message.assistant {
    background-color: #f1f8e9;
    border-left: 4px solid #4caf50;
}

.chat-message .message-content {
    margin-top: 0.5rem;
    line-height: 1.6;
}

.chat-message .message-content code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.chat-message .message-content pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.chat-message .message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.chat-references {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.chat-references .references-header {
    font-weight: 600;
    color: #856404;
    margin-bottom: 0.5rem;
}

.reference-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #6c757d;
}

.reference-header {
    font-weight: 500;
}

.reference-snippet {
    font-style: italic;
    color: #6c757d;
    margin-top: 0.25rem;
}

.fa-spinner.fa-spin {
    animation: uploadSpin 1s linear infinite;
}
