/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =========================
   BODY
========================= */

body {
    font-family: Arial, Helvetica, sans-serif;

    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #f1f3f6;

    padding: 20px;
}


/* =========================
   CHAT CONTAINER
========================= */

.chat-container {
    width: 500px;
    height: 700px;

    background: white;

    border-radius: 20px;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
}


/* =========================
   HEADER
========================= */

.chat-header {
    height: 100px;

    background: #4f46e5;

    color: white;

    display: flex;
    align-items: center;

    padding: 20px;

    gap: 15px;
}


.bot-icon {
    width: 55px;
    height: 55px;

    background: white;

    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 28px;
}


.header-text h1 {
    font-size: 22px;

    margin-bottom: 5px;
}


.header-text p {
    font-size: 14px;

    opacity: 0.85;
}


/* =========================
   CHAT BOX
========================= */

.chat-box {
    flex: 1;

    padding: 20px;

    overflow-y: auto;

    background: #f8fafc;
}


/* =========================
   MESSAGE
========================= */

.message {
    display: flex;

    margin-bottom: 20px;

    max-width: 85%;
}


/* BOT */

.bot-message {
    align-items: flex-start;
}


/* USER */

.user-message {
    margin-left: auto;

    justify-content: flex-end;
}


/* =========================
   AVATAR
========================= */

.avatar {
    width: 38px;
    height: 38px;

    min-width: 38px;

    background: #4f46e5;

    color: white;

    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    margin-right: 10px;

    font-size: 18px;
}


/* =========================
   MESSAGE CONTENT
========================= */

.message-content {
    padding: 13px 16px;

    border-radius: 15px;

    font-size: 15px;

    line-height: 1.6;

    word-wrap: break-word;
}


/* BOT MESSAGE */

.bot-message .message-content {
    background: white;

    color: #222;

    border: 1px solid #e2e8f0;

    border-top-left-radius: 5px;
}


/* USER MESSAGE */

.user-message .message-content {
    background: #4f46e5;

    color: white;

    border-top-right-radius: 5px;
}


/* =========================
   INPUT AREA
========================= */

.chat-input-container {
    height: 85px;

    background: white;

    border-top: 1px solid #e5e7eb;

    padding: 15px;

    display: flex;

    align-items: center;

    gap: 10px;
}


/* INPUT */

#messageInput {
    flex: 1;

    height: 50px;

    border: 1px solid #d1d5db;

    border-radius: 25px;

    padding: 0 20px;

    font-size: 15px;

    outline: none;
}


#messageInput:focus {
    border-color: #4f46e5;

    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}


/* =========================
   SEND BUTTON
========================= */

#sendButton {
    width: 50px;
    height: 50px;

    border: none;

    border-radius: 50%;

    background: #4f46e5;

    color: white;

    font-size: 22px;

    cursor: pointer;

    display: flex;
    justify-content: center;
    align-items: center;

    transition: 0.2s;
}


#sendButton:hover {
    background: #3730a3;

    transform: scale(1.05);
}


#sendButton:disabled {
    background: #9ca3af;

    cursor: not-allowed;

    transform: none;
}


/* =========================
   TYPING
========================= */

.typing {
    display: flex;

    gap: 5px;
}


.typing span {
    width: 7px;
    height: 7px;

    background: #777;

    border-radius: 50%;

    animation: typing 1.2s infinite;
}


.typing span:nth-child(2) {
    animation-delay: 0.2s;
}


.typing span:nth-child(3) {
    animation-delay: 0.4s;
}


@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}


/* =========================
   SCROLLBAR
========================= */

.chat-box::-webkit-scrollbar {
    width: 6px;
}


.chat-box::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 10px;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    body {
        padding: 0;
    }

    .chat-container {
        width: 100%;
        height: 100vh;

        border-radius: 0;
    }

}