/**
 * Front-End Styles for the Floating WhatsApp Button
 *
 * Theme: Light & Modern
 * @version 1.2.1 (Flexbox Layout Fix)
 */

/* Main Container */
.fwb-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/*
 * **LAYOUT FIX**: Welcome Message Tooltip now uses Flexbox.
 * This is a robust way to align the text and the close button side-by-side.
 */
.fwb-tooltip {
    display: flex; /* Use flexbox for layout */
    align-items: center; /* Vertically align items in the middle */
    gap: 8px; /* Creates a small space between the text and the close button */
    background-color: #ffffff;
    color: #333333;
    padding: 12px 16px; /* Simpler, even padding */
    border-radius: 16px;
    margin-bottom: 15px;
    max-width: 260px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    /* Animation Properties */
    opacity: 0;
    transform: translateY(15px) scale(0.9);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    visibility: hidden;
}

/* Text content area within the tooltip */
.fwb-tooltip-content {
    font-size: 15px;
    line-height: 1.5;
    flex-grow: 1; /* Allows the text area to take up available space */
}

/* Triangle/tail at the bottom of the tooltip */
.fwb-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 22px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #ffffff;
}

/* Visibility States */
.fwb-tooltip.fwb-tooltip-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}
.fwb-tooltip.fwb-tooltip-hidden {
    display: none;
}

/*
 * **LAYOUT FIX**: Close button is now a flex item.
 * `position: absolute` has been removed to keep it in the document flow.
 */
.fwb-tooltip-close {
    background: #f1f1f1;
    color: #555;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 18px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    flex-shrink: 0; /* Prevents the button from being squished if text is long */
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.fwb-tooltip-close:hover,
.fwb-tooltip-close:focus {
    background: #e0e0e0;
    transform: scale(1.1);
    outline: none;
}

/* Main Floating Button */
.floating-whatsapp-button {
    background-color: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-sizing: border-box;
    text-decoration: none;
}
.floating-whatsapp-button:hover,
.floating-whatsapp-button:focus {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    outline: 2px solid #128C7E;
    outline-offset: 2px;
}

/* Styling for the inline SVG icon */
.floating-whatsapp-button svg {
    color: #ffffff;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fwb-container {
        bottom: 20px;
        right: 20px;
    }
    .fwb-tooltip {
        max-width: calc(100vw - 60px);
    }
    .fwb-tooltip-content {
        font-size: 14px;
    }
}