#ai-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    background-color: rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s;
    z-index: 1040;
}

    #ai-overlay.active {
        opacity: 1;
        visibility: visible;
    }

#voice-container {
    width: 50%;
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    /*display: flex;*/
    align-items: center;
    font-family: Verdana, Arial;
    gap: 8px;
    background: white;
    padding: 5px 10px 20px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transition: bottom 0.5s ease, opacity 0.5s ease;
    z-index: 1050;
}

    #voice-container #voice-container-child {
        width: 100%;
        display: flex;
    }

    #voice-container.active {
        bottom: 80px;
        opacity: 1;
    }

.voice-text {
    width: 100%;
    height: 20px; /* Chiều cao cho 1 dòng */
    color: #555555;
    padding: 5px 0px 7px 0px;
    /*border: 1px solid #ccc;*/ /* Màu viền mặc định */
    border: transparent;
    /*border-radius: 8px;*/
    resize: none; /* Tắt khả năng kéo để thay đổi kích thước */
    overflow-y: hidden; /* Không hiển thị thanh cuộn */
    font-family: inherit;
    font-size: 14px;
    outline: none; /* Loại bỏ outline */
}

    .voice-text:focus {
        /*border: 1px solid #eeeeee !important;*/ /* Màu viền khi focus (màu xám) */
        
        /*box-shadow: 0 0 5px rgba(136, 136, 136, 0.5);*/ /* Hiệu ứng bóng nhẹ khi focus */
    }
.insertimg-group {
    align-content: center;
    align-self: center;
    position: absolute !important;
    left: 2px !important;
    bottom: 0px !important;
}

.micro-button{
    position:absolute !important;
    left:3px !important;
    bottom:0px !important;
}
.send-button {
    position: absolute !important;
    right: 2px !important;
    bottom: 1px !important;
}
.check-button {
    position: absolute !important;
    right: 30px !important;
    bottom: 1px !important;
}
.ai-icon-button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #555;
    transition: color 0.3s;
}

    .ai-icon-button.listening {
        color: red;
    }

    .ai-icon-button.hasimage {
        color: orange;
    }

/* Nút tròn với chữ "AI" */
#ai-toggle-button {
    position: fixed;
    bottom: 20px;
    right: 45px;
    background-color: white;
    border-radius: 50%; /* Đảm bảo nút có hình tròn */
    padding: 20px; /* Điều chỉnh để nút có kích thước đều */
    border: 2px solid #efefef; /* Viền màu xám */
    text-align: center;
    font-size: 28px; /* Chữ AI to hơn */
    color: #808080; /* Màu xám cho chữ AI */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Hiệu ứng shadow */
    width: 40pt; /* Đảm bảo nút có chiều rộng phù hợp */
    height: 40pt; /* Đảm bảo nút có chiều cao phù hợp */
    z-index: 1050;
}

    /* Chữ AI */
    #ai-toggle-button span {
        font-size: 20px; /* Chữ AI lớn hơn */
        font-weight: bold;
        color: #aaaaaa; /* Màu xám cho chữ AI */
        margin-top: 0px;
    }

    #ai-toggle-button:hover span {
        color: #777777; /* Màu xám cho chữ AI */
    }

    /* Các chấm tròn cho hiệu ứng nhấp nháy */
    #ai-toggle-button .dots {
        display: flex;
        justify-content: space-between;
        width: 30px; /* Khoảng cách giữa các chấm */
        margin-top: 0px;
    }

    #ai-toggle-button .dot {
        width: 6px; /* Kích thước chấm nhỏ hơn */
        height: 6px; /* Kích thước chấm nhỏ hơn */
        border-radius: 50%;
        background-color: #4CAF50; /* Màu xanh mặc định */
        opacity: 0.5;
    }

        /* Chấm tròn với các màu khác nhau giống như màu của Google Assistant */
        #ai-toggle-button .dot:nth-child(1) {
            background-color: #FF4D4D; /* Đỏ */
        }

        #ai-toggle-button .dot:nth-child(2) {
            background-color: #FF9F00; /* Vàng */
        }

        #ai-toggle-button .dot:nth-child(3) {
            background-color: #4CAF50; /* Xanh lá cây */
        }

        #ai-toggle-button .dot:nth-child(4) {
            background-color: #2196F3; /* Xanh dương */
        }

/* Hiệu ứng nhấp nháy cho các chấm tròn */
@keyframes blink {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* Khi hover vào nút AI, các chấm tròn nhấp nháy lần lượt */
#ai-toggle-button:hover .dot:nth-child(1) {
    animation: blink 1s infinite;
    animation-delay: 0s; /* Nhấp nháy đầu tiên ngay lập tức */
}

#ai-toggle-button:hover .dot:nth-child(2) {
    animation: blink 1s infinite;
    animation-delay: 0.3s; /* Nhấp nháy chậm hơn */
}

#ai-toggle-button:hover .dot:nth-child(3) {
    animation: blink 1s infinite;
    animation-delay: 0.6s; /* Nhấp nháy chậm hơn nữa */
}

#ai-toggle-button:hover .dot:nth-child(4) {
    animation: blink 1s infinite;
    animation-delay: 0.9s; /* Nhấp nháy muộn hơn */
}

/* Hiệu ứng nhấp nháy khi nút AI được nhấn */
#ai-toggle-button.active .dot {
    animation: blink 1s infinite;
}


/* Các chấm tròn cho hiệu ứng nhấp nháy */
#voice-container #loadingdots {
    display: flex;
    justify-content: space-between;
    width: 30px; /* Khoảng cách giữa các chấm */
    margin-top: 0px;
    position:absolute;
    right:65px;
    bottom:10px;
}

#voice-container .dot {
    width: 6px; /* Kích thước chấm nhỏ hơn */
    height: 6px; /* Kích thước chấm nhỏ hơn */
    border-radius: 50%;
    background-color: #4CAF50; /* Màu xanh mặc định */
    opacity: 0.5;
}

    /* Chấm tròn với các màu khác nhau giống như màu của Google Assistant */
    #voice-container .dot:nth-child(1) {
        background-color: #FF4D4D; /* Đỏ */
    }

    #voice-container .dot:nth-child(2) {
        background-color: #FF9F00; /* Vàng */
    }

    #voice-container .dot:nth-child(3) {
        background-color: #4CAF50; /* Xanh lá cây */
    }

    #voice-container .dot:nth-child(4) {
        background-color: #2196F3; /* Xanh dương */
    }

/* Hiệu ứng nhấp nháy cho các chấm tròn */
@keyframes blink {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* Khi hover vào nút AI, các chấm tròn nhấp nháy lần lượt */
#voice-container .dot:nth-child(1) {
    animation: blink 1s infinite;
    animation-delay: 0s; /* Nhấp nháy đầu tiên ngay lập tức */
}

#voice-container .dot:nth-child(2) {
    animation: blink 1s infinite;
    animation-delay: 0.3s; /* Nhấp nháy chậm hơn */
}

#voice-container .dot:nth-child(3) {
    animation: blink 1s infinite;
    animation-delay: 0.6s; /* Nhấp nháy chậm hơn nữa */
}

#voice-container .dot:nth-child(4) {
    animation: blink 1s infinite;
    animation-delay: 0.9s; /* Nhấp nháy muộn hơn */
}

.ai-icon-button.active i {
    display: none; /* Ẩn micro khi đang chờ */
}

.ai-icon-button.active #loadingdots {
    display: flex; /* Hiển thị các chấm xoay khi đang chờ */
}

.ai-stop-btn {
    position: absolute;
    bottom:0px;
    right: 0px; /* Khoảng cách từ cạnh phải của textbox */
    transform: translate(-2px, -95%);
    /*padding: 5px;*/
    background-color: transparent;
    border: 0px;
    border-radius: 5px;
    cursor: pointer;
    display: none;
}

    .ai-stop-btn i {
        font-size: 18px;
        color: #555555;
    }

    .ai-stop-btn:hover i {
        color: #222222;
    }

#insert-image-btn {
    position:absolute !important;
    left:25px !important;
    bottom:0px !important;
}

#camera-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    /*margin: 20px;*/
    z-index: 1050;
}

#video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Tạo hiệu ứng cho nút chụp ảnh */
.capture-button {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: transparent;
    border: 1px solid #fff; /* Đường viền trắng giống Camera Android */
    border-radius: 50%; /* Hình tròn */
    padding: 15px;
    border-radius: 50%;
    font-size: 24px;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

    .capture-button:hover {
        background-color: rgba(255, 255, 255, 0.3); /* Màu nền nhẹ khi hover */
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4); /* Làm nổi bật bóng đổ khi hover */
        transform: translateX(-50%) scale(1.05); /* Phóng to nút một chút */
    }

    .capture-button i {
        font-size: 40px;
        color: #fff; /* Màu của icon */
    }

    /* Đổi màu khi nhấn */
    .capture-button:active {
        background-color: rgba(255, 255, 255, 0.4); /* Hiệu ứng khi nhấn */
    }

/* Khi màn hình là điện thoại (kích thước nhỏ hơn 600px) */
@media (max-width: 600px) {
    #camera-container {
        margin: 10px;
    }

    #capture-button {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        padding: 12px;
    }

    #start-record-btn {
        /*padding: 18px;*/
    }

    #voice-text {
        
    }

    #stop-record-btn {
        padding: 8px;
        font-size: 14px;
    }
}

/* Nút chụp ảnh */
@media (max-width: 400px) {
    #capture-button {
        padding: 10px;
        font-size: 20px;
    }

    #start-record-btn {
        /*padding: 18px;*/
    }
}
/* Thay đổi kích thước nút AI cho các màn hình nhỏ hơn (ví dụ điện thoại) */
@media (max-width: 1000px) {
    #voice-container {
        width: 60%;
    }

    /*#ai-toggle-button {
width: 7vw;
height: 7vw;
font-size: 4vw;*/ /* Đảm bảo chữ "AI" lớn hơn một chút trên màn hình nhỏ */
    /*}*/
}

@media (max-width: 768px) {
    #voice-container {
        width: 70%;
    }
    /*#ai-toggle-button {
width: 7vw;
height: 7vw;
font-size: 4vw;*/ /* Đảm bảo chữ "AI" lớn hơn một chút trên màn hình nhỏ */
    /*}*/
}

/* Thêm một số điều chỉnh cho kích thước nhỏ hơn nếu cần thiết */
@media (max-width: 480px) {
    #voice-container {
        width: 80%;
    }

    # /*ai-toggle-button {
width: 12vw;
height: 12vw;
font-size: 5vw;*/ /* Chữ lớn hơn khi thiết bị có màn hình nhỏ hơn */
    /*}*/
}

/* Modal chọn hình ảnh */
.aimodal {
    display: none; /* Modal ẩn đi khi chưa mở */
    position: absolute; /* Vị trí cố định trên màn hình */
    transform: translate(90%, -100%);
    background-color: rgba(0, 0, 0, 0.1); /* Màu nền mờ */
    z-index: 1000; /* Đảm bảo modal hiển thị lên trên các phần tử khác */
    /*width: 80%;*/ /* Chiều rộng modal */
    /*max-width: 400px;*/ /* Giới hạn chiều rộng tối đa */
    border-radius: 8px; /* Bo góc cho modal */
}

    .aimodal .aimodal-content {
        /*background-color: white;*/ /* Nền của modal */
        padding: 0px; /* Khoảng cách bên trong */
        border-radius: 0px; /* Bo góc */
        text-align: center; /* Căn giữa nội dung */
    }

        .aimodal .aimodal-content ul {
            list-style-type: none;
            list-style: none;
            padding: 3px;
            margin: 0px;
            display: inline-flex;
        }

        .aimodal .aimodal-content li {
            margin: 0px 5px;
            text-align: center;
        }

        .aimodal .aimodal-content button {
            width: 100%;
            padding: 0px;
            /*background-color: #4CAF50;
    color: white;*/
            color: #555555;
            border: none;
            border-radius: 0px;
            cursor: pointer;
            background-color: transparent;
            transition: background-color 0.3s ease;
        }

            .aimodal .aimodal-content button:hover {
                color: #333333;
            }

            .aimodal .aimodal-content button i {
                font-size: 16pt;
            }

        .aimodal .aimodal-content .close-btn {
            background-color: #f44336;
            margin-top: 0px;
        }

            .aimodal .aimodal-content .close-btn:hover {
                background-color: #e53935;
            }


/* Hiệu ứng nhấp nháy khi nút AI được nhấn */
/*#voice-container.active .dot {
animation: blink 1s infinite;
}*/

/* Hiệu ứng hover (khi hover vào nút AI) */
/*#ai-toggle-button:hover {
background-color: rgba(0, 0, 0, 0.1);*/ /* Đổi màu nền khi hover */
/*box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);*/ /* Hiệu ứng shadow khi hover */
/*}*/