/* Base Reset */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

/* The Floating Container */
#chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Modern Chat Window */
#chat-window {
    width: 350px;
    max-height: 600px; /* Increased to accommodate the taller chat-box */
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #chat-window {
        width: 90vw;
        right: 5vw;
        bottom: 80px;
    }
}

/* Header Style */
.chat-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

/* Chat History Area (#chat-box) */
.chat-history, #chat-box {
    flex: 1;
    display: flex;
    flex-direction: column; 
    gap: 12px; 
    padding: 20px;
    height: 400px; /* Updated to 400px per new code */
    min-height: 250px;
    overflow-y: auto;
    background: #f9f9f9; /* Updated to lighter grey per new code */
}

/* --- MESSAGE BUBBLE STYLES --- */

/* Base style for all bubbles */
.msg-bubble {
    max-width: 75%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Admin/Operator Messages (Grey, Left side) */
.admin-msg {
    align-self: flex-start;
    background-color: #ffffff;
    color: #333;
    border-radius: 18px 18px 18px 2px; /* Pointy bottom-left */
    border: 1px solid #e0e0e0;
}

/* User Messages (Green, Right side) */
.user-msg {
    align-self: flex-end;
    background-color: #8BC34A; /* DMCA Green */
    color: white;
    border-radius: 18px 18px 2px 18px; /* Pointy bottom-right */
    text-align: left; /* Kept text left-aligned for readability in bubbles */
}

/* --- END MESSAGE BUBBLE STYLES --- */

/* Modern Input Area */
.chat-footer {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Styling the Textarea to look like a modern Pill input */
#msg-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    resize: none;
    height: 40px;
    font-size: 14px;
    background: #fdfdfd;
}

/* Modern Send Button */
#send-btn, .send-btn {
    background: #8BC34A;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

#send-btn:hover {
    transform: scale(1.05);
    background: #7CB342;
}