body {
    font-family: "Manjari", sans-serif;
    margin: 0;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f7e0a3;
    color: #333;
    overflow-x: hidden;
    background-image: radial-gradient(#55555573 1px, transparent 1px);
    background-size: 20px 20px;
}

.chatbot-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    background-color: #f7f3e9;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 5px solid #ff6f61;
    background-image: radial-gradient(#ff6f61 1px, transparent 1px);
    background-size: 20px 20px;
}

.custom-share-button {
    position: absolute;
    z-index: 10;
    top: 25px;
    right: 18px;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

.custom-share-button:hover {
    transform: translateY(-3px) scale(1);
}

.custom-share-button:active {
    transform: translateY(1px) scale(0.95);
}

.custom-share-button svg {
    width: 35px;
}

.chetan-header {
    background-color: #ffd66b;
    padding: 20px;
    text-align: center;
    border-bottom: 3px dashed #ff6f61;
}

.chetan-header h1 {
    font-family: "Bungee", sans-serif;
    margin: 0;
    font-size: 2.8em;
    color: #333;
    letter-spacing: -1px;
}

.chetan-header p {
    margin: 5px 0 0;
    font-style: italic;
    font-weight: 700;
    color: #555;
}

.chat-window {
    height: 450px;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-container {
    display: flex;
    width: 100%;
}

.bot-message-container {
    justify-content: flex-start;
}

.user-message-container {
    justify-content: flex-end;
}

.message-box {
    padding: 15px;
    border-radius: 25px;
    max-width: 75%;
    word-wrap: break-word;
    line-height: 1.4;
    position: relative;
    box-shadow: 3px 3px 0 #333;
    border: 2px solid #333;
}

.user-message-box {
    background-color: #6a82fb;
    color: #fff;
    border-bottom-right-radius: 5px;
}

.bot-message-box {
    background-color: #ffd66b;
    color: #333;
    border-bottom-left-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.action-button {
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease-in-out;
}

.action-button:hover {
    background-color: #555;
}

.roast-image {
    max-width: 100%;
    max-height: 70vh;
    margin-top: 10px;
    display: block;
    border-radius: 10px;
    box-shadow: 2px 2px 0 #333;
}

.roast-movie-title {
    font-size: 0.8em;
    font-style: italic;
    color: #555;
    margin-top: 8px;
    text-align: right;
}

.chat-input-area {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    border-top: 3px dashed #ff6f61;
    background-color: #fff8e1;
    gap: 15px;
}

#user-input {
    flex-grow: 1;
    border: 2px solid #333;
    border-radius: 30px;
    padding: 12px 20px;
    background-color: #fff;
    color: #333;
    outline: none;
    font-size: 1.1em;
    box-shadow: 2px 2px 0 #333;
}

#send-button,
#ai-roast-button,
#exit-button {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    border: 2px solid #333;
    border-radius: 30px;
    padding: 12px 25px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1em;
    box-shadow: 2px 2px 0 #333;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

#roboticon {
    margin: 5%;
    color: #fff;
    font-size: 1.1 em;
    animation: pulse-glow 2s infinite ease-out;
}

@keyframes pulse-glow {
    0% {
        transform: scale(1.0) rotate(0deg);
    }

    25% {
        transform: scale(1.02)rotate(8deg);
    }

    50% {
        transform: scale(1.04)rotate(-8deg);
    }

    75% {
        transform: scale(1.01)rotate(0deg);
    }

    100% {
        transform: scale(1.0)rotate(0deg);
    }
}

#send-button {
    background-color: #ff6f61;
    color: #fff;
}

#send-button:hover {
    background-color: #e55a5a;
}

#ai-roast-button {
    background-color: #528cff;
    color: #fff;
}

#ai-roast-button:hover {
    background-color: #3361c3;
}

#exit-button {
    background-color: #4b4b4b;
    color: #fff;
}

#exit-button:hover {
    background-color: #272727;
}

.loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #d45942;
    font-size: 1.5rem;
    height: 3rem;
}

.loading-dots i {
    animation: bounce 1.2s infinite ease-in-out;
    transform-origin: center bottom;
}

.loading-dots i:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots i:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Modal Styles */
#message-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.3s ease-in-out;
    visibility: hidden;
    opacity: 0;
}

#message-modal.visible {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 24rem;
    width: 100%;
    margin: 1rem;
    transform: scale(0.95);
    transition: all 0.3s ease-in-out;
}

#message-modal.visible .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1rem;
}

.modal-body {
    color: #4b5563;
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

#close-modal-button {
    background-color: #e5e7eb;
    color: #1f2937;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

#close-modal-button:hover {
    background-color: #d1d5db;
}

.tts-loading-dots {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-left: 5px;
}

.tts-loading-dot {
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    animation: tts-wave 1.2s infinite ease-in-out;
    transform-origin: center bottom;
}

.tts-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.tts-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.tts-loading-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes tts-wave {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    .chetan-header h1 {
        font-size: 2.2em;
        display: flex;
        flex-direction: column;
    }

    .chat-window {
        height: 350px;
    }

    .chat-input-area {
        flex-direction: row;
        gap: 10px;
        flex-wrap: wrap;
    }

    #send-button,
    #ai-roast-button,
    #exit-button {
        flex-grow: 1;
    }

    #send-button,
    #ai-roast-button {
        margin-left: 0;
    }
}