#chat-widget-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px; 
    height: 500px; 
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px; 
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1); 
    display: none;
    flex-direction: column;
    z-index: 1000;
    opacity: 0; 
    transform: scale(0.95);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

#chat-widget-container.visible {
    opacity: 1;
    transform: scale(1);
}

#chat-open-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #333; 
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease-out; /* Smooth hover effect */
    z-index: 1001;
}

#chat-open-btn:hover {
    background-color: #555;
    transform: scale(1.05);
}

#chat-open-btn svg {
    width: 26px;
    height: 26px;
}

#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #fcfcfc;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.agent-name {
    font-weight: bold;
    font-size: 1.2em;
    color: #1e1e1e; 
}

.agent-status {
    font-size: 0.85em;
    color: #a0a0a0;
}

#chat-close-btn {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: #555;
    transition: color 0.2s ease;
}

#chat-close-btn:hover {
    color: #333;
}

#chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f7f9fc; 
    display: flex;
    flex-direction: column;
}

#chat-body::-webkit-scrollbar {
    width: 6px;
}
#chat-body::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 20px;
    margin-bottom: 10px;
    font-size: 0.95em;
    line-height: 1.5;
    animation: fadeIn 0.3s ease-out; 
}

.ai-message {
    align-self: flex-start;
    background-color: #e8e8e8; 
    color: #333;
    border-bottom-left-radius: 6px; 
}

.user-message {
    align-self: flex-end;
    background-color: #99AAB5; 
    color: white;
    border-bottom-right-radius: 6px; 
}

.timestamp {
    display: block;
    font-size: 0.75em;
    margin-top: 5px;
    text-align: right;
    color: inherit; 
    opacity: 0.7; 
}

#chat-footer {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    background-color: white;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

#user-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #eee;
    border-radius: 25px;
    margin-right: 10px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

#user-input:focus {
    border-color: #333; 
    outline: none;
}

#send-btn {
    background-color: #333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px; 
    height: 45px;
    transition: background-color 0.3s ease, transform 0.2s ease-out;
    display: flex;
    align-items: center;
}

#send-btn:not(:disabled):hover {
    background-color: #555;
    transform: scale(1.05);
}

#send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#send-btn svg {
    width: 22px;
    height: 22px;
    transform: rotate(45deg) translate(2px, -2px); 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media only screen and (max-width: 767px) {
    #chat-open-btn {
        bottom: 80px;
    }
    #chat-widget-container {
        right: 10px;
        width: 95%;
    }
}