/* Reset mặc định */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    animation: pulse 10s infinite;
    z-index: 0;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.3; }
    100% { transform: scale(1); opacity: 0.5; }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 960px; /* Gấp đôi 801px */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

h1 {
    color: #ff6f61;
    font-size: 24px;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-log {
    flex: 1;
    height: 51px; /* Chiều cao ban đầu 51px */
    overflow-y: auto;
    padding: 15px;
    background: rgba(240, 248, 255, 0.9);
    border-radius: 10px;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Khoảng cách giữa các tin nhắn */
}

.scroll-up {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #ff6f61;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.scroll-up:hover {
    opacity: 1;
}

.upload-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: #ff6f61;
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.upload-btn:hover {
    opacity: 1;
}

.message {
    padding: 12px 15px;
    border-radius: 10px;
    max-width: 50%; /* Giới hạn chiều rộng tin nhắn */
    word-wrap: break-word;
    display: inline-block;
}

.message.assistant {
    background: #cce5ff; /* Màu xanh nhạt cho bot */
    color: #1a3c34;
    margin-left: 20px; /* Cách lề trái một chút */
    text-align: left;
}

.message.user {
    background: #ff99cc; /* Màu hồng cho người dùng */
    color: #fff;
    margin-right: 20px; /* Cách lề phải một chút */
    margin-left: auto; /* Đẩy sang phải */
    text-align: left;
}

.message.error {
    background: #ffe6e6;
    color: #d32f2f;
    margin-left: 20px; /* Lỗi cũng sang trái như bot */
    text-align: left;
}

input[type="text"] {
    padding: 12px 15px;
    border: none;
    border-radius: 25px;
    background: #f0f2f5;
    font-size: 16px;
    color: #333;
    outline: none;
    width: 100%;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 111, 97, 0.5);
}