/* Chat Box */

button {
    -webkit-box-shadow: none !important;
    text-shadow: none !important;
}
.chat-box {
    width: 100%;
    max-width: 420px;
    background: #2668b2;
    border-radius: 0px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    height: 520px; /* Increased height to allow space for the options and footer */
    overflow: hidden;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform: translateY(20px);
    opacity: 0;
    z-index: 9999; /* Ensure it stays above all elements */
}

.chat-box.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

/* Chat Header */
.chat-header {
    padding: 14px;
    background: linear-gradient(135deg, #2668b2, #2668b2);
    color: white;
    text-align: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.chat-title {
    flex-grow: 1; /* This will push the title to the center */
    text-align: center;
}

.chat-close {
    font-size: 24px;
    cursor: pointer;
    color: white;
    transition: color 0.3s ease;
}

.chat-close:hover {
    color: #ff4d4d;  /* Change color on hover */
}

/* Chat Body with Scroll */
.chat-body {
    height: 227px;
    max-height: 227px; /* Set a maximum height for the chat body */
    overflow-y: auto; /* Add scrollbar if messages exceed max height */
    padding: 12px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px; /* Add padding to ensure last message is not cut off */
}

/* Message Alignment */
.message-sent {
    background: #dcf8c6;
    align-self: flex-end;
    text-align: right;
    width: auto;
    max-width: 80%;
    border-radius: 15px 15px 0 15px;
    margin-left: 20px;
    padding: 10px;
    font-size:13px;
}

.message-received {
    background: #e9ecef;
    align-self: flex-start;
    text-align: left;
    width: auto;
    max-width: 80%;
    border-radius: 15px 15px 15px 0;
    margin-right: 20px;
    padding: 10px;
    font-size:13px;
}

/* Ensure Footer & Options Stay Fixed */
.chat-footer, .options {
    background: white;
    padding: 10px;
    border-top: 1px solid #ddd;
    z-index: 2; /* Ensure footer is above the chat body */
}

/* Footer Content */
.chat-footer {
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: white;
}

/* Input Field */
.chat-footer input {
    flex-grow: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-right: 10px;
    height: 57px !important;
}

.chat-footer button {
    background: #2668b2;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.chat-footer button:hover {
    background: #2668b2;
}

/* Options Area */
.options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
    /* No max-height or scrollbar here as per your request */
}

/* Option Button */
.option-button {
    padding: 12px;
    background: #2668b2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    transition: background 0.3s;
}

.option-button:hover {
    background: #2668b2;
}

/* Chat Toggle Button */


#sendMessage {
    background-color: #25D366;
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .chat-box {
        width: 100%;
        bottom: 44px;
        right: 0%;
    }
    .option-button {
        font-size: 12px;
        padding: 10px;
    }
    .chat-header {
        font-size: 14px;
    }
}
