/* Continuous Conversation Chat UI Styles */

.conversation-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 80vh;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    overflow: hidden;
    margin: 20px 0;
}

.conversation-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: between;
    align-items: center;
}

.conversation-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex-grow: 1;
}

.conversation-status {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

.conversation-status.active {
    background: #27ae60;
    color: white;
}

.conversation-status.waiting {
    background: #f39c12;
    color: white;
}

.conversation-status.completed {
    background: #95a5a6;
    color: white;
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-bubble.user {
    background: #007bff;
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message-bubble.assistant {
    background: #e9ecef;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-bubble.system {
    background: #fff3cd;
    color: #856404;
    align-self: center;
    max-width: 90%;
    text-align: center;
    font-style: italic;
    border-radius: 12px;
}

.message-content {
    margin: 0;
    white-space: pre-wrap;
}

.message-meta {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.message-bubble.assistant .message-meta {
    text-align: left;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #e9ecef;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 100px;
    align-self: flex-start;
}

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

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

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.conversation-input {
    border-top: 1px solid #ddd;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-area {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 12px 16px;
    resize: none;
    min-height: 20px;
    max-height: 120px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
}

.message-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.message-input:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

.send-button {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background: #0056b3;
}

.send-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.conversation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.conversation-info {
    display: flex;
    gap: 15px;
}

.conversation-actions {
    display: flex;
    gap: 10px;
}

.end-conversation-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.end-conversation-btn:hover {
    background: #c82333;
}

.export-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.export-btn:hover {
    background: #218838;
}

/* Loading states */
.conversation-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6c757d;
}

.conversation-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 10px;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .conversation-container {
        height: 500px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .conversation-header {
        padding: 12px 15px;
    }
    
    .conversation-title {
        font-size: 16px;
    }
    
    .conversation-messages {
        padding: 15px;
    }
    
    .conversation-input {
        padding: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .conversation-container {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .conversation-messages {
        background: #1a202c;
    }
    
    .message-bubble.assistant {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .message-bubble.system {
        background: #553c4e;
        color: #fbd38d;
    }
    
    .conversation-input {
        background: #2d3748;
        border-top-color: #4a5568;
    }
    
    .message-input {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .message-input:focus {
        border-color: #3182ce;
    }
    
    .typing-indicator {
        background: #4a5568;
    }
    
    .conversation-controls {
        color: #a0aec0;
    }
}

/* Scrollbar styling */
.conversation-messages::-webkit-scrollbar {
    width: 6px;
}

.conversation-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

.conversation-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}