body {
    font-family: 'Arial', sans-serif;
    max-width: 800px;
    margin: 0 auto;
    background-color: #000000;
    /* Thay đổi thành nền đen */
    color: #e0e0e0;
    /* Thay đổi thành văn bản sáng */
    max-width: 650px;
    padding: 12px;
    overflow: hidden;
}

#background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0;
    transition: opacity 1s ease;
}

#background-video.show {
    opacity: 1;
}

/* Thay đổi kiểu dáng cho chat-container và input-area khi ẩn */
.hide-chat #chat-container,
.hide-chat #input-area {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#chat-container {
    background: rgba(30, 30, 30, 0.8);
    /* Nền đen nửa trong suốt */
    border-radius: 8px;
    padding: 20px;
    height: 400px;
    overflow-y: auto;
    color: #e0e0e0;
    background: transparent;
    border-radius: 8px;
    padding: 20px;
    height: calc(100vh - 170px);
    overflow-y: auto;
    /* Giữ nguyên thanh cuộn của chat-container */
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 70px;
    margin-bottom: 40px;
    scrollbar-width: none;
    /* Giấu thanh cuộn trong Firefox */
    -ms-overflow-style: none;
}

.user-message {
    background-color: rgba(0, 100, 200, 0.5);
    /* Nền xanh lam sâu */
    color: #ffffff;
}

.bot-message {
    background-color: rgba(50, 50, 50, 0.7);
    /* Nền xám sâu */
    color: #ffffff;
}

#input-area {
    display: flex;
    gap: 10px;
    position: fixed;
    /* Cố định ở cuối màn hình */
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 760px;
    backdrop-filter: blur(10px);
    /* Hiệu ứng màng mờ */
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    /* Nền nửa trong suốt */
}

#user-input {
    flex: 1;
    padding: 12px 15px;
    /* Tăng khoảng cách bên trong bên trái và bên phải */
    border: 1px solid rgba(221, 221, 221, 0.7);
    /* Tăng độ đen của viền */
    border-radius: 8px;
    /* Tăng độ bo tròn */
    background: rgba(255, 255, 255, 0.4);
    /* Tăng độ trong suốt */
    backdrop-filter: blur(8px);
    /* Tăng độ mờ */
    font-size: 15px;
    /* Tăng kích thước chữ */
    color: #333;
    /* Tăng độ đen của văn bản */
    transition: all 0.3s ease;
    /* Thêm hiệu ứng chuyển đổi mượt mà */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* Thêm bóng sáng nhẹ */
}

#user-input:focus {
    outline: none;
    border-color: rgba(0, 123, 255, 0.5);
    /* Khi focus, viền trở thành xanh lam */
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
    /* Khi focus, thêm hiệu ứng sáng */
}

#user-input::placeholder {
    color: rgba(102, 102, 102, 0.7);
    /* Tối ưu màu sắc của placeholder */
}

button {
    background-color: rgba(0, 123, 255, 0.7);
    /* Nền xanh lam nửa trong suốt */
    color: white;
    padding: 0 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 80px;
    font-weight: bold;
    /* Font đậm */
    backdrop-filter: blur(5px);
    /* Hiệu ứng màng mờ */
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    display: inline-block;
    backdrop-filter: blur(8px);
    word-wrap: break-word;
}

/* Kiểu dáng mặc định cho màn hình hẹp */
.user-message {
    max-width: 80%;
}

.bot-message {
    max-width: 80%;
}

/* Thêm kiểu dáng phản hồi cho màn hình rộng */
@media (min-width: 768px) {
    .user-message {
        max-width: 30%;
        margin-left: auto !important;
        margin-right: 10px;
    }

    .bot-message {
        max-width: 30%;
        margin-right: auto !important;
        margin-left: 10px;
    }
}

.user-message {
    background-color: rgba(227, 242, 253, 0.7);
    margin-left: auto;
    margin-right: 0;
    text-align: left;
    display: block;
    width: fit-content;
    max-width: 80%;
    /* Định nghĩa này sẽ bị ghi đè bởi định nghĩa sau */
}

.bot-message {
    background-color: rgba(241, 241, 241, 0.7);
    margin-right: auto;
    margin-left: 0;
    text-align: left;
    display: block;
    width: fit-content;
    max-width: 80%;
    /* Định nghĩa này sẽ bị ghi đè bởi định nghĩa sau */
}

/* Di chuyển media query sau tất cả định nghĩa về tin nhắn */
@media (min-width: 768px) {
    .user-message {
        max-width: 30% !important;
        margin-left: auto !important;
        margin-right: 10px !important;
    }

    .bot-message {
        max-width: 30% !important;
        margin-right: auto !important;
        margin-left: 10px !important;
    }
}

/* Xóa các định nghĩa lặp lại cho .user-message và .bot-message */
.bot-message {
    background-color: rgba(241, 241, 241, 0.7);
    margin-right: auto;
    margin-left: 0;
    text-align: left;
    display: block;
    width: fit-content;
    max-width: 80%;
    /* Định nghĩa này sẽ bị ghi đè bởi định nghĩa sau */
}

/* Thêm kiểu dáng cho loading-spinner */
/* Thêm keyframes cho animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Thay đổi kiểu dáng cho loading-spinner */
.loading-spinner {
    display: block;
    width: 30px;
    height: 30px;
    border: 4px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s linear infinite;
    /* Sử dụng linear để làm cho animation trơn hơn */
    margin: 15px 0 15px 15px;
}

/* Thay đổi kiểu dáng cho header-container */
.header-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(241, 241, 241, 0.5);
    padding: 6px 16px;
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    width: fit-content;
    position: absolute;
    top: 20px;
}

.title-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
}

h1 {
    font-size: 24px;
    margin: 0;
    padding: 0;
}


/* Thay đổi kiểu dáng cho header-container */
.header-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;

}

/* Thay đổi kiểu dáng cho pull-up-menu */
/* Thay đổi kiểu dáng cho menu-toggle */
#menu-toggle {
    position: absolute;
    right: 115px;
    top: 50%;
    width: 0;
    transform: translateY(-50%);
    background-color: transparent;
    font-size: 20px;
}

#pull-up-menu {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(100px);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.preset-btn {
    background: rgba(30, 30, 30, 0.8) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.preset-btn:hover {
    background: rgba(50, 50, 50, 0.8) !important;
}


.message {
    background-color: rgba(0, 0, 0, 0.7);
    /* Nền đen */
    color: white;
    /* Văn bản trắng */
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Viền sáng */
}

.bot-message {
    background-color: rgba(20, 20, 20, 0.7);
    /* Nền xám sâu */
    color: white;
    /* Văn bản trắng */
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Viền sáng */
}

#input-area {
    background: rgba(0, 0, 0, 0.3); /* Nền đen nửa trong suốt */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
}

/* Tùy chọn: Thay đổi kiểu dáng cho input-area */
#user-input {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
}


#user-input {
    background: rgba(30, 30, 30, 0.8);
    /* Nền xám sâu */
    color: white;
    /* Văn bản trắng */

    border: 1px solid rgba(255, 255, 255, 0.1);  /* Giảm độ trong suốt của viền */
    box-shadow: none;  /* Xóa bóng sáng mặc định */
}

#user-input:focus {
    border-color: rgba(0, 123, 255, 0.3);  /* Thay đổi màu sắc của viền khi focus */
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.1);  /* Giảm độ sáng của bóng sáng */
}

#user-input::placeholder {
    color: rgba(200, 200, 200, 0.7);
    /* Màu sắc của placeholder */
}

#send-button {
    background: rgba(0, 100, 200, 0.7);
    /* Nền xanh lam */
    color: white;
}

#menu-toggle {
    background: rgba(0, 0, 0, 0);
    /* Nền xanh lam */
    color: white;
}

.header-container {
    padding: 6px 16px;
    /* 8px 20px */
    border-radius: 14px;
    /* 16px */
}

.title-avatar {
    width: 35px;
    /* 40px */
    height: 35px;
    /* 40px */
}

h1 {
    font-size: 18px;
    /* 20px */
}

/* Khôi phục kiểu dáng ban đầu của message */
.message {
    padding: 12px 16px;
    font-size: inherit;
}

#input-area {
    padding: 6px;
    /* 8px */
}

#user-input {
    padding: 8px;
    /* 10px */
    font-size: 14px;
}

button {
    font-size: 14px;
    padding: 0 16px;
    /* 0 20px */
}

/* Thay đổi kiểu dáng cho back-button */
.back-button {
    position: absolute;
    left: 20px;
    top: 20px;
    background: rgba(0, 123, 255, 0.5);
    /* Điều chỉnh thành nền xanh lam nửa trong suốt */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    /* Nhỏ hơn */
    height: 30px;
    /* Nhỏ hơn */
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.back-button svg {
    stroke: white;
    /* Mũi tên trắng */
    width: 26px;
    /* Tăng kích thước mũi tên */
    height: 26px;
    /* Tăng kích thước mũi tên */
}

/* Điều chỉnh vị trí của header-container */
.header-container {
    left: 20px;
    /* Các kiểu dáng khác giữ nguyên */
}

.rephrase-btn {
    -webkit-user-select: none;
    /* Chrome/Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+ */
    user-select: none;
    cursor: default;
}

/* Thay đổi kiểu dáng cho rephrase-btn */
.rephrase-btn {
    display: block;
    margin: 10px 0 0 0;
    /* Điều chỉnh thành trái căn */
    padding: 8px 16px;
    background: rgba(0, 123, 255, 0.8);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.rephrase-btn:hover {
    background: rgba(0, 123, 255, 1);
    transform: scale(1.05);
}

.rephrase-btn:active {
    transform: scale(0.98);
}

.message-container {
    margin-bottom: 15px;
}


/* Thêm kiểu dáng cho video-playing */
.video-playing #chat-container,
.video-playing #input-area {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Thêm kiểu dáng cho video-ended */
.video-ended #chat-container,
.video-ended #input-area {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.8s ease;
}

/* Thêm kiểu dáng cho message */
.message {
    animation: messageFadeIn 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes messageFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.idea {
    margin-right: 15px;
    -webkit-user-select: none;
    /* Chrome/Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE/Edge */
    user-select: none;
    /* Cú pháp chuẩn */
}

.play-btn {
    -webkit-user-select: none;
    /* Chrome/Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+ */
    user-select: none;
    cursor: default;
}

.play-btn {
    position: absolute;
    left: 10px;
    top: 10px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.play-btn:hover {
    opacity: 1;
}

.message-container.bot {
    position: relative;
    padding-left: 30px;
}