.wp-lingo-fab-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--fab-gap, 15px);
    font-family: 'Outfit', 'Inter', sans-serif;
    pointer-events: none;
    /* Allow clicks to pass through invisible areas */
}

.wp-lingo-fab-container * {
    pointer-events: auto;
    /* Re-enable for trigger and items */
}

.wp-lingo-fab-bottom-right {
    bottom: 30px;
    right: 30px;
}

.wp-lingo-fab-bottom-left {
    bottom: 30px;
    left: 30px;
    align-items: flex-start;
}

/* Main Trigger Button */
.wp-lingo-fab-trigger {
    width: var(--fab-icon-box-size, 60px) !important;
    height: var(--fab-icon-box-size, 60px) !important;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wp-lingo-accent, #58a7de), #8b5cf6);
    border: none;
    color: white;
    font-size: var(--fab-icon-size, 24px) !important;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(88, 167, 222, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: wp-lingo-fab-pulse 3s infinite;
}

.wp-lingo-fab-trigger img,
.wp-lingo-fab-trigger svg,
.wp-lingo-fab-trigger .emoji,
.wp-lingo-fab-icon img,
.wp-lingo-fab-icon svg,
.wp-lingo-fab-icon .emoji {
    width: var(--fab-icon-size, 24px) !important;
    height: var(--fab-icon-size, 24px) !important;
    font-size: var(--fab-icon-size, 24px) !important;
    max-width: none !important;
    min-width: var(--fab-icon-size, 24px) !important;
    display: block;
}

@keyframes wp-lingo-fab-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(88, 167, 222, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(88, 167, 222, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(88, 167, 222, 0);
    }
}

.wp-lingo-fab-container.is-open .wp-lingo-fab-trigger {
    animation: none;
}

.wp-lingo-fab-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(88, 167, 222, 0.6);
}

.wp-lingo-fab-trigger:active {
    transform: scale(0.95);
}

.wp-lingo-fab-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0);
    transition: all 0.3s ease;
    display: block;
}

.wp-lingo-fab-icon-main {
    transition: all 0.3s ease;
    display: block;
    transform: rotate(0deg) scale(1);
}

/* Open State */
.wp-lingo-fab-container.is-open .wp-lingo-fab-trigger {
    background: #333;
    transform: rotate(0);
}

.wp-lingo-fab-container.is-open .wp-lingo-fab-icon-main {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

.wp-lingo-fab-container.is-open .wp-lingo-fab-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Menu Items */
.wp-lingo-fab-menu {
    position: absolute;
    bottom: calc(100% + var(--fab-gap, 15px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: max-content;
}

.fab-align-right .wp-lingo-fab-menu {
    right: 0;
    align-items: flex-end;
}

.fab-align-left .wp-lingo-fab-menu {
    left: 0;
    align-items: flex-start;
}

.wp-lingo-fab-container.is-open .wp-lingo-fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wp-lingo-fab-item {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    transform: translateY(20px) scale(0.8);
    opacity: 0;
}

/* Label on the LEFT of the icon (default/right-aligned) */
.fab-align-right .wp-lingo-fab-item {
    flex-direction: row;
}

/* Label on the RIGHT of the icon (left-aligned) */
.fab-align-left .wp-lingo-fab-item {
    flex-direction: row-reverse;
}

.wp-lingo-fab-container.is-open .wp-lingo-fab-item {
    transform: translateY(0) scale(1);
    opacity: 1;
    /* Staggered animation */
    transition-delay: calc(var(--item-index) * 0.05s);
}

.wp-lingo-fab-label {
    background: #ffffff !important;
    opacity: 1 !important;
    padding: 8px 18px;
    border-radius: 12px;
    color: #1e293b !important;
    font-size: var(--fab-label-size, 16px);
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 6px 20px rgba(0,0,0,0.12);
    border: 1.5px solid rgba(99, 102, 241, 0.2) !important;
    position: relative;
    z-index: 10;
    isolation: isolate;
}

.wp-lingo-fab-icon {
    width: var(--fab-icon-box-size, 50px) !important;
    height: var(--fab-icon-box-size, 50px) !important;
    background: #ffffff !important;
    opacity: 1 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fab-icon-size, 22px);
    border: 2px solid rgba(99, 102, 241, 0.2) !important;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 6px 20px rgba(0,0,0,0.12);
}

/* Hover effects for items */
.wp-lingo-fab-item:hover .wp-lingo-fab-icon {
    transform: scale(1.1);
    background: var(--wp-lingo-accent, #8b5cf6) !important;
    border-color: var(--wp-lingo-accent, #8b5cf6) !important;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.wp-lingo-fab-item:hover .wp-lingo-fab-label {
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.14);
}

.wp-lingo-fab-bottom-left .wp-lingo-fab-item:hover .wp-lingo-fab-label {
    transform: translateX(5px);
}

/* Dark Mode */
body.wp-lingo-dark-mode .wp-lingo-fab-label {
    background: #1e1e38 !important;
    color: #f1f5f9 !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 6px 20px rgba(0,0,0,0.35);
}

body.wp-lingo-dark-mode .wp-lingo-fab-icon {
    background: #1e1e38 !important;
    color: #f1f5f9 !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 6px 20px rgba(0,0,0,0.35);
}

body.wp-lingo-dark-mode .wp-lingo-fab-item:hover .wp-lingo-fab-icon {
    background: var(--wp-lingo-accent, #8b5cf6) !important;
    border-color: var(--wp-lingo-accent, #8b5cf6) !important;
}

body.wp-lingo-dark-mode .wp-lingo-fab-item:hover .wp-lingo-fab-label {
    background: #2a2a4a !important;
    border-color: rgba(139, 92, 246, 0.6) !important;
}

body.wp-lingo-dark-mode .wp-lingo-fab-item:hover .wp-lingo-fab-icon {
    background: var(--wp-lingo-accent, #8b5cf6);
    border-color: var(--wp-lingo-accent, #8b5cf6);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

body.wp-lingo-dark-mode .wp-lingo-fab-item:hover .wp-lingo-fab-label {
    background: #32325a;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wp-lingo-fab-bottom-right {
        bottom: 20px;
        right: 20px;
    }

    .wp-lingo-fab-trigger {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .wp-lingo-fab-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}