* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 80vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

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

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.chat-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.chat-header p {
    opacity: 0.9;
    font-size: 14px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

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

.message-content {
    padding: 15px 20px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 15px;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.bot-message .message-content {
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 5px;
    border: 1px solid #dee2e6;
}

.bot-message .message-content strong {
    color: #667eea;
}

.chat-input-form {
    padding: 25px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.input-container {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

#messageInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    min-height: 50px;
    max-height: 120px;
}

#messageInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#sendButton {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    height: 50px;
    min-width: 80px;
}

#sendButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#sendButton:active {
    transform: translateY(0);
}

#sendButton:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #667eea;
    font-style: italic;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    color: #dc3545;
    text-align: center;
    padding: 10px;
    background: #f8d7da;
    border-radius: 10px;
    margin: 10px 0;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .chat-container {
        height: 90vh;
        border-radius: 15px;
    }
    
    .chat-header {
        padding: 20px;
        border-radius: 15px 15px 0 0;
    }
    
    .chat-header h1 {
        font-size: 20px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .message-content {
        max-width: 95%;
        font-size: 14px;
    }
    
    .chat-input-form {
        padding: 15px;
    }
    
    .input-container {
        flex-direction: column;
        gap: 10px;
    }
    
    #sendButton {
        align-self: flex-end;
        min-width: 100px;
    }
}