/* Main Wrapper Container */
#sfwa-floating-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: row-reverse;
    /* Right to left (Phone then WA) */
    align-items: flex-end;
    gap: 15px;
    /* Space between buttons */
    pointer-events: none;
    /* Let clicks pass through container */
}

/* Common Wrapper Properties */
.sfwa-wrapper {
    position: relative;
    /* Reset fixed positioning since they are now in a container */
    bottom: auto;
    right: auto;
    z-index: 9999;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* center relative to itself */
    pointer-events: auto;
    /* Re-enable clicks */
}

/* Greeting Tooltip */
.sfwa-greeting {
    background: #fff;
    color: #333;
    padding: 10px 20px 10px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    font-size: 14px;
    position: absolute;
    bottom: 70px;
    /* Above WA button */
    right: 0;
    width: 200px;
    /* Max width */
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10002;
    text-align: center;
}

.sfwa-greeting.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.sfwa-close-greeting {
    margin-left: 8px;
    cursor: pointer;
    color: #999;
    font-weight: bold;
    position: absolute;
    top: 2px;
    right: 6px;
}

/* Trigger Button Common */
.sfwa-trigger {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.sfwa-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* WhatsApp Specific */
.sfwa-trigger-wa {
    background-color: #25D366;
    /* Official WA Green */
    animation: sfwa-pulse 2s infinite;
}

/* Phone Specific */
.sfwa-trigger-phone {
    background-color: #000000;
    /* Black */
}

.sfwa-icon {
    display: flex;
}

/* Badge */
.sfwa-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* Stacked Items (Hidden by default) */
.sfwa-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 15px;
    /* Spacing from trigger */
    gap: 10px;
    /* Hide initially */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: absolute;
    bottom: 60px;
    /* Above the trigger */
    right: 0;
    /* Align with trigger */
    width: 250px;
    /* Width for labels */
    pointer-events: none;
    padding-bottom: 10px;
    z-index: 10001;
}

/* Show Stack State */
.sfwa-wrapper.active .sfwa-stack {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Change Trigger Icon to 'X' (Close) when active - Advanced CSS magic */
.sfwa-wrapper.active .sfwa-trigger {
    background-color: #333;
    /* Darker when open */
    transform: rotate(45deg);
    /* Optional effect */
    animation: none;
    /* Stop pulsing when open */
}

.sfwa-trigger-phone.active {
    background-color: #333;
}

/* Individual Stack Items */
/* Individual Stack Items */
.sfwa-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Icon on left */
    text-decoration: none;
    color: #333;
    background: #fff;
    /* Single background for entire button */
    padding: 8px 12px;
    /* Internal spacing */
    border-radius: 50px;
    /* Pill shape */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Shadow on parent */
    transform: scale(0.9);
    transition: all 0.2s ease;
    opacity: 0;
    /* Stagger start */
    width: auto;
    /* Fit content */
    min-width: 180px;
    /* Minimum width for consistency */
}

.sfwa-item span.sfwa-label {
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin-right: 0;
    margin-left: 10px;
    /* Spacing between icon and text */
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: #333;
}

.sfwa-item span.sfwa-icon-small {
    width: 32px;
    height: 32px;
    background: #25D366;
    /* Green Circle for WA Icon */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    color: #fff;
    /* White icon */
    flex-shrink: 0;
}

/* Phone Item specific */
.sfwa-phone .sfwa-item span.sfwa-icon-small {
    background: #000;
    color: #fff;
}

/* Hover effects */
.sfwa-item:hover {
    transform: scale(1);
    background: #f8f8f8;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.sfwa-item:hover span.sfwa-label,
.sfwa-item:hover span.sfwa-icon-small {
    background: transparent;
    /* Reset any hover overrides */
}

/* Keep icon bg dynamic on hover */
.sfwa-item:hover span.sfwa-icon-small {
    background: #25D366;
}

.sfwa-phone .sfwa-item:hover span.sfwa-icon-small {
    background: #000;
}

.sfwa-wrapper.active .sfwa-item {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Animation delays */
.sfwa-wrapper.active .sfwa-item:nth-child(1) {
    transition-delay: 0.2s;
}

.sfwa-wrapper.active .sfwa-item:nth-child(2) {
    transition-delay: 0.15s;
}

.sfwa-wrapper.active .sfwa-item:nth-child(3) {
    transition-delay: 0.1s;
}

.sfwa-wrapper.active .sfwa-item:nth-child(4) {
    transition-delay: 0.05s;
}

.sfwa-wrapper.active .sfwa-item:nth-child(5) {
    transition-delay: 0s;
}


/* Animations */
@keyframes sfwa-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    #sfwa-floating-container {
        bottom: 15px;
        right: 15px;
        gap: 10px;
    }

    .sfwa-greeting {
        bottom: 60px;
    }

    .sfwa-stack {
        bottom: 55px;
        right: -10px;
        /* Adjust for smaller screens ? */
    }
}