@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

body {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(#EEEEFF, #C8C7FF);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot {
    width: 420px;
    height: 600px;
    overflow: hidden;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
        0 32px 64px -48px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 22px;
    background: #282494;
    justify-content: flex-start;
    /* Align items to the left */
    gap: 15px;
    /* Add spacing between elements */
}

.chat-header .header-info {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: 0;
    /* Reset margin to align with the arrow */
}

.logo-text {
    color: #f1f1ff;
}

.return-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: background-color 0.3s ease;
    border-radius: 50%;
}

.return-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-body {
    padding: 25px 22px;
    gap: 20px;
    display: flex;
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #ccccf5 transparent;
}

.chat-body .message {
    display: flex;
    gap: 11px;
    align-items: center;
}

.chat-body .message .bot-avatar {
    width: 35px;
    height: 35px;
    padding: 6px;
    fill: #fff;
    flex-shrink: 0;
    margin-bottom: 2px;
    align-self: flex-end;
    border-radius: 50%;
    background: #5350C4;
}

.chat-body .message .message-text {
    padding: 12px 16px;
    max-width: 75%;
    font-size: 0.95rem;
}

.chat-body .bot-message .message-text {
    background: #F2F2FF;
    border-radius: 13px 13px 13px 3px;
}

.chat-body .user-message {
    flex-direction: column;
    align-items: flex-end;
}

.chat-body .user-message .message-text {
    color: #fff;
    background: #5350C4;
    border-radius: 13px 13px 3px 13px;
}

/* New attachment styling */
.chat-body .user-message .attachment {
    width: 200px;
    /* Adjust width to be fixed */
    height: 250px;
    /* Add fixed height */
    margin-top: 8px;
    border-radius: 12px;
    /* Adjust border radius to match design */
    object-fit: cover;
    /* Ensure image covers the fixed dimensions */
}

.chat-footer {
    padding: 15px 22px 20px;
    background: #fff;
}

.chat-form {
    display: flex;
    align-items: center;
    position: relative;
    background: #fff;
    border-radius: 32px;
    outline: 1px solid #CCCCE5;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.06);
}

.chat-form:focus-within {
    outline: 2px solid #5350C4;
}

.chat-form .message-input {
    width: 100%;
    height: 47px;
    outline: none;
    resize: none;
    border: none;
    max-height: 180px;
    scrollbar-width: thin;
    border-radius: inherit;
    font-size: 0.95rem;
    padding: 14px 0 12px 18px;
}

.chat-form .chat-controls {
    gap: 3px;
    height: 47px;
    display: flex;
    padding-right: 6px;
    align-items: center;
}

.chat-form .chat-controls button {
    height: 35px;
    width: 35px;
    border: none;
    cursor: pointer;
    color: #706DB0;
    border-radius: 50%;
    font-size: 1.15rem;
    background: none;
    transition: 0.2s ease;
}

.chat-form .chat-controls button:hover {
    color: #3d39ac;
    background: #f1f1ff;
}

.chat-form .chat-controls #send-message {
    color: #fff;
    display: none;
    background: #5350C4;
}

.chat-form .chat-controls #send-message:hover {
    background: #3d39ac;
}

.chat-form .message-input:valid~.chat-controls #send-message {
    display: block;
}

.chat-form .file-upload-wrapper {
    position: relative;
    height: 35px;
    width: 35px;
}

.chat-form .file-upload-wrapper :where(button, img) {
    position: absolute;
}

.chat-form .file-upload-wrapper img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-form .file-upload-wrapper #file-cancel {
    color: #ff0000;
    background: #fff;
}

.chat-form .file-upload-wrapper :where(img, #file-cancel),
.chat-form .file-upload-wrapper.file-uploaded #file-upload {
    display: none;
}

.chat-form .file-upload-wrapper.file-uploaded img,
.chat-form .file-upload-wrapper.file-uploaded:hover #file-cancel {
    display: block;
}

em-emoji-picker {
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 100%;
    max-width: 350px;
    visibility: hidden;
    max-height: 330px;
    transform: translateX(-50%);
}

body.show-emoji-picker em-emoji-picker {
    visibility: visible;
}

@media (max-width: 520px) {
    .chatbot {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .chat-header {
        padding: 12px 15px;
    }

    .chat-body {
        padding: 25px 15px;
    }

    .chat-footer {
        padding: 10px 15px 15px;
    }
}