/* PDF Embedding Chat Node Styles */
.pdf-embedding-chat-node {
    width: 400px;
    min-height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.pdf-embedding-chat-node .node-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 16px;
    padding: 16px;
}

/* PDF Upload Section */
.pdf-upload-section {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.pdf-upload-section.has-file {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.upload-area {
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.upload-area:hover {
    background-color: #f9fafb;
}

.upload-area.drag-over {
    background-color: #eff6ff;
    border-color: #3b82f6;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #6b7280;
}

.upload-placeholder i {
    width: 32px;
    height: 32px;
}

.upload-placeholder small {
    font-size: 12px;
    color: #9ca3af;
}

.upload-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #3b82f6;
}

.upload-loading i {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

.upload-loading small {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px;
    border-radius: 6px;
}

.file-info i {
    width: 24px;
    height: 24px;
    color: #10b981;
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 500;
    color: #111827;
    word-break: break-word;
}

.file-status {
    font-size: 12px;
    color: #10b981;
}

.remove-pdf-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.remove-pdf-btn:hover {
    background-color: #fee2e2;
}

.remove-pdf-btn i {
    width: 16px;
    height: 16px;
}

/* Chat Section */
.chat-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 300px;
}

.chat-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.chat-header {
    margin-bottom: 12px;
}

.chat-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.chat-header small {
    color: #6b7280;
    font-size: 12px;
}

.chat-messages {
    flex: 1;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    overflow-y: auto;
    max-height: 350px;
    margin-bottom: 12px;
    min-height: 200px;
}

.no-messages {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 40px 20px;
    font-size: 14px;
}

.message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.user-message {
    align-items: flex-end;
}

.assistant-message {
    align-items: flex-start;
}

.message-content {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 14px;
}

.user-message .message-content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 6px;
}

.assistant-message .message-content {
    background: white;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-text {
    word-wrap: break-word;
}

.message-text p {
    margin: 0 0 8px 0;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text strong {
    font-weight: 600;
}

.message-text em {
    font-style: italic;
}

.message-text code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
}

.assistant-message .message-text code {
    background: #f3f4f6;
    color: #1f2937;
}

.message-text pre {
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid #e5e7eb;
}

.message-text pre code {
    background: transparent;
    padding: 0;
    font-size: 13px;
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    resize: none;
    min-height: 40px;
    max-height: 100px;
}

.chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-input:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.send-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.send-btn i {
    width: 16px;
    height: 16px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .pdf-embedding-chat-node {
        width: 350px;
    }
    
    .message-content {
        max-width: 90%;
    }
} 