.deepseek-chatbot-container {
    max-width: 500px;
    margin: 30px auto;
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(74, 151, 130, 0.2);
    background: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    height: 650px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-header {
    background: linear-gradient(135deg, #4A9782 0%, #80A1BA 100%);
    color: white;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(74, 151, 130, 0.3);
    position: relative;
    z-index: 10;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header::before {
    content: "";
    width: 40px;
    height: 40px;
    background-image: url('chat_image.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-header h3 {
    margin: 0;
    font-size: 1.25em;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.chat-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75em;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #DEE791;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: linear-gradient(to bottom, #f8fafb 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.message {
    padding: 14px 18px;
    border-radius: 18px;
    max-width: 85%;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    position: relative;
    animation: messageSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    font-size: 0.95em;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-message {
    background: linear-gradient(135deg, #4A9782 0%, #5ab598 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px rgba(74, 151, 130, 0.3);
}

.assistant-message {
    background: white;
    border: 2px solid #e8f2f0;
    color: #2d3748;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.assistant-message::before {
    content: "";
    position: absolute;
    left: -40px;
    top: 10px;
    width: 28px;
    height: 28px;
    background-image: url('chat_image.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(74, 151, 130, 0.25);
}

.user-message::before {
    content: "👤";
    position: absolute;
    right: -40px;
    top: 10px;
    font-size: 18px;
    background: #4A9782;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 151, 130, 0.25);
}

.chat-input-area {
    padding: 16px 20px 20px;
    border-top: 2px solid #e8f2f0;
    background: white;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#deepseek-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e8f2f0;
    border-radius: 14px;
    resize: none;
    font-family: inherit;
    font-size: 0.95em;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: #f8fafb;
    max-height: 120px;
    overflow-y: auto;
}

#deepseek-chat-input:focus {
    outline: none;
    border-color: #4A9782;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 151, 130, 0.1);
}

.chat-controls {
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.chat-submit-btn, .chat-stop-btn {
    border: none;
    padding: 7px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 48px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(74, 151, 130, 0.18);
}

.chat-submit-btn {
    background: linear-gradient(135deg, #4A9782 0%, #5ab598 100%);
    color: white;
}

.chat-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 151, 130, 0.4);
}

.chat-submit-btn:active {
    transform: translateY(0);
}

.chat-submit-btn:disabled {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.chat-stop-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    display: none;
}

.chat-stop-btn.visible {
    display: flex;
}

.chat-stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.chat-stop-btn::before {
    content: "⏹";
    font-size: 16px;
}

.chat-submit-btn::before {
    content: "📤";
    font-size: 16px;
}

.chat-status {
    padding: 10px 20px;
    font-size: 0.85em;
    text-align: center;
    border-top: 1px solid #e8f2f0;
    display: none;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.status-info {
    background: linear-gradient(135deg, #DEE791 0%, #f0f7d4 100%);
    color: #5a6b2e;
    border-color: #DEE791;
}

.status-error {
    background: linear-gradient(135deg, #fed7d7 0%, #fecaca 100%);
    color: #c53030;
    border-color: #feb2b2;
}

.status-success {
    background: linear-gradient(135deg, #DEE791 0%, #c8e06f 100%);
    color: #4A9782;
    border-color: #DEE791;
}

.loading-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    font-style: normal;
    color: #22c55e;
    font-weight: bold;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: loading-bounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-bounce {
    0%, 80%, 100% { 
        transform: scale(0.8); 
        opacity: 0.5; 
    }
    40% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

.json-response {
    background: #f8fafb;
    padding: 12px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.85em;
    border: 2px solid #e8f2f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    max-width: 100%;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e8f2f0;
    border-radius: 18px;
    max-width: fit-content;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.typing-indicator .thinking-text {
    font-size: 0.9em;
    color: #22c55e;
    font-weight: bold;
    font-style: normal;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Scrollbar styling */
.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #80A1BA 0%, #4A9782 100%);
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4A9782 0%, #80A1BA 100%);
}

#deepseek-chat-input::-webkit-scrollbar {
    width: 6px;
}

#deepseek-chat-input::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#deepseek-chat-input::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#deepseek-chat-input::-webkit-scrollbar-thumb:hover {
    background: #4A9782;
}

.json-response::-webkit-scrollbar {
    height: 6px;
}

.json-response::-webkit-scrollbar-track {
    background: #e8f2f0;
    border-radius: 3px;
}

.json-response::-webkit-scrollbar-thumb {
    background: #4A9782;
    border-radius: 3px;
}

/* Processing state */
.chat-container.processing {
    opacity: 0.95;
}

/* Responsive design */
@media (max-width: 768px) {
    .deepseek-chatbot-container {
        margin: 10px;
        height: 550px;
        border-radius: 16px;
        max-width: 100%;
    }
    
    .message {
        max-width: 90%;
        padding: 12px 16px;
        font-size: 0.9em;
    }
    
    .assistant-message::before,
    .user-message::before {
        display: none;
    }
    
    .chat-input-area {
        padding: 14px 16px 16px;
        flex-direction: column;
        gap: 10px;
    }
    
    .chat-controls {
        width: 100%;
        gap: 10px;
    }
    
    .chat-submit-btn,
    .chat-stop-btn {
        flex: 1;
        padding: 12px;
    }
    
    .chat-header {
        padding: 20px 16px;
    }
    
    .chat-container {
        padding: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .deepseek-chatbot-container {
        background: #1a202c;
        color: #e2e8f0;
    }
    
    .chat-container {
        background: linear-gradient(to bottom, #2d3748 0%, #1a202c 100%);
    }
    
    .assistant-message {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    #deepseek-chat-input {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    #deepseek-chat-input:focus {
        border-color: #4A9782;
        background: #2d3748;
    }
    
    .json-response {
        background: #374151;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .typing-indicator {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .chat-input-area {
        background: #1a202c;
        border-top-color: #4a5568;
    }
}

/* Smooth fade-in animation */
.deepseek-chatbot-container {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}