/* Modal overlay styles */
.modal-overlay {
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    padding: 28px 32px 24px 32px;
    border-radius: 16px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.18);
    max-width: 95vw;
    width: 400px;
    text-align: center;
}
.modal-content h2 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 1.4rem;
    color: #183353;
}
.modal-content p {
    font-size: 1rem;
    color: #2d2d2d;
    margin-bottom: 18px;
}
#start-chat-btn {
    padding: 10px 30px;
    border-radius: 24px;
    background: #3b5998;
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}
#start-chat-btn:hover {
    background: #2d4373;
}

/* Chat container */
#wit-chatbot-container {
    max-width: 450px;
    margin: 40px auto;
    border: 1px solid #ccc;
    border-radius: 12px;
    background-color: #fff;
    padding: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-family: sans-serif;
}

/* Messages */
#wit-messages {
    height: 420px;           /* Fixed height */
    overflow-y: auto;        /* Enable vertical scroll */
    margin-bottom: 10px;
    padding: 4px;
    background: #fafbfd;
    border-radius: 12px;
    box-sizing: border-box;
}

/* Each message row with spacing */
.message-row {
    display: flex;
    align-items: flex-end;
    margin-bottom: 20px;
}

/* Chat bubble styling */
.message-bubble {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Circular avatar container */
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bot messages (Wit) on the left */
.message-row.bot {
    justify-content: flex-start;
}
.message-row.bot .message-bubble {
    background-color: #ECECEC;
    margin-left: 8px;
}
.message-row.bot .message-avatar {
    margin-right: 4px;
    order: 1;
}

/* User messages on the right */
.message-row.user {
    justify-content: flex-end;
}
.message-row.user .message-bubble {
    background-color: #DCF8C6;
    margin-right: 8px;
}
.message-row.user .message-avatar {
    margin-left: 4px;
    order: 2;
}

/* Avatar images fill the circle */
.message-avatar img {
    width: 100%;
    height: auto;
    display: block;
}

/* Error messages */
.error-message {
    color: red;
    margin: 10px 0;
}
