/* WhatsApp Floating Action Button (FAB) */
.whatsapp-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #d32f2f;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex; /* Changed by JS if needed */
    justify-content: center;
    align-items: center;
    font-size: 30px; /* Increased icon size */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* WhatsApp Chat Box */
.whatsapp-chat-box {
    position: fixed;
    /* Default open means it doesn't need to be positioned relative to FAB initially */
    bottom: 30px;
    right: 30px;
    width: 370px; /* Slightly wider */
    max-width: calc(100% - 20px); /* Ensure padding on small screens */
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    display: none; /* Initially none, JS adds 'active' */
    flex-direction: column;
    z-index: 1001;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    overflow: hidden;
}

.whatsapp-chat-box.active {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
    background-color: #d32f2f;
    color: white;
    padding: 15px 20px; /* Increased padding */
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-title {
    font-size: 20px; /* Increased font size */
    font-weight: bold;
    display: flex;
    align-items: center;
}

.live-support-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.header-subtitle {
    font-size: 15px; /* Increased font size */
    opacity: 0.9;
    margin-top: 4px;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 26px; /* Increased icon size */
    cursor: pointer;
    padding: 5px;
}

/* Chat Body */
.chat-body {
    padding: 20px; /* Increased padding */
    min-height: 170px; /* Increased height */
    max-height: 350px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.chat-message {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
}

.avatar {
    width: 48px; /* Slightly larger avatar */
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
    background-color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #757575;
    font-size: 24px; /* Increased icon size */
    flex-shrink: 0;
}

/* Avatar icon for Font Awesome 4 */
.avatar::before {
    font-family: "FontAwesome"; /* Correct for FA4 */
    content: "\f007"; /* fa-user */
}

.welcome-message p {
    background-color: #ffffff;
    padding: 15px 20px; /* Increased padding */
    border-radius: 22px;
    border-top-left-radius: 7px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: calc(100% - 63px); /* Account for new avatar size */
    margin: 0;
    font-size: 16px; /* Increased font size */
    line-height: 1.65; /* Improved line height */
    color: #333;
}

/* Chat Footer */
.chat-footer {
    padding: 15px 20px; /* Increased padding */
    background-color: #fff;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.chat-footer input[type="text"] {
    flex-grow: 1;
    border: 1px solid #ced4da;
    border-radius: 25px;
    padding: 14px 20px; /* Increased padding */
    font-size: 16px; /* Increased font size */
    margin-right: 12px;
    background-color: #f8f9fa;
    outline: none;
}
.chat-footer input[type="text"]::placeholder {
    color: #6c757d;
    font-size: 16px; /* Increased font size */
}

.chat-footer .send-message-link {
    display: inline-flex;
    text-decoration: none;
}

.chat-footer .send-btn {
    background-color: #d32f2f;
    color: white;
    border: none;
    width: 50px; /* Slightly larger button */
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px; /* Increased icon size */
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.chat-footer .send-btn:hover {
    background-color: #b71c1c;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .whatsapp-chat-box {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 10px;
    }
    .whatsapp-fab { /* In case it becomes visible */
        right: 15px;
        bottom: 15px;
        width: 55px;
        height: 55px;
    }
    .header-title { font-size: 18px; }
    .header-subtitle { font-size: 14px; }
    .welcome-message p { font-size: 14px; }
    .chat-footer input[type="text"], .chat-footer input[type="text"]::placeholder { font-size: 14px; }
    .chat-footer .send-btn { width: 45px; height: 45px; font-size: 20px;}
    .avatar { width: 40px; height: 40px; font-size: 20px;}

}

.chat-body {
    padding: 20px;
    min-height: 170px;
    max-height: 400px; /* Increased max-height for more content */
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex; /* To manage flow of prompt and selector */
    flex-direction: column; /* Stack items vertically */
}

.chat-message.initial-prompt {
    margin-bottom: 15px; /* Space below the prompt */
}

#locationSelectorContainer {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between location buttons */
    margin-top: 10px;
    align-items: stretch; /* Make buttons take available width if desired */
}

.location-btn {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 12px 15px;
    border-radius: 20px;
    cursor: pointer;
    text-align: center;
    font-size: 15px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    width: 100%; /* Full width buttons */
    box-sizing: border-box;
}

.location-btn:hover {
    background-color: #e9e9e9;
    border-color: #ccc;
}

.location-btn.selected { /* Optional: style for selected button */
    background-color: #d32f2f;
    color: white;
    border-color: #b71c1c;
}

/* Ensure chat-footer still looks good when it appears */
.chat-footer {
    padding: 15px 20px;
    background-color: #fff;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    border-top: 1px solid #e9ecef;
    display: flex; /* This should be set by JS when it's made visible if it's initially display:none */
    align-items: center;
}