/* WebSocket Chatbot Styles */

.websocket-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.websocket-chatbot-window {
    width: 400px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.websocket-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.websocket-chatbot-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.websocket-chatbot-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.websocket-chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.websocket-chatbot-status {
    padding: 8px 20px;
    font-size: 12px;
    text-align: center;
    flex-shrink: 0;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.websocket-chatbot-status-connecting {
    color: #666;
}

.websocket-chatbot-status-connected {
    color: #4caf50;
    font-weight: 600;
}

.websocket-chatbot-status-disconnected {
    color: #f44336;
}

.websocket-chatbot-status-error_connection {
    color: #f44336;
    font-weight: 600;
}

.websocket-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.websocket-chatbot-message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-in;
    white-space: pre-wrap;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.websocket-chatbot-message-sent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.websocket-chatbot-message-received {
    background: #e0e0e0;
    color: #333333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.websocket-chatbot-message-error {
    background: #ffebee;
    color: #c62828;
    align-self: center;
    border-radius: 8px;
    max-width: 100%;
    font-size: 14px;
}

.websocket-chatbot-input-container {
    display: flex;
    padding: 16px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
    flex-shrink: 0;
}

.websocket-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.websocket-chatbot-input:focus {
    border-color: #667eea;
}

.websocket-chatbot-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.websocket-chatbot-send {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.websocket-chatbot-send:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.05);
}

.websocket-chatbot-send:active:not(:disabled) {
    transform: scale(0.98);
}

.websocket-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar styling */
.websocket-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.websocket-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.websocket-chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.websocket-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive design */
@media (max-width: 480px) {
    .websocket-chatbot-container {
        bottom: 0;
        right: 0;
        left: 0;
    }

    .websocket-chatbot-window {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
