/* ==========================================
   BUBBLE MENU COMPONENT
   ========================================== */

/* The main container for the mobile bubble menu */
.bubble-menu-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1050;
}

/* The toggle button itself */
.bubble-menu-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-size: 200% 200%;
    color: #ffffff;
    border: none;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), inset 0 0 20px rgba(236, 72, 153, 0.3);
    animation: gradientShift 3s ease infinite, pulseGlow 2s infinite;
    cursor: pointer;
    position: relative;
    z-index: 1051;
    /* Above the items */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bubble-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5), 0 8px 30px rgba(0, 0, 0, 0.2);
}

.bubble-menu-toggle.is-open {
    color: #ffffff;
    /* Keeps styling mostly consistent but we can alter shadow or animation on open */
    animation: none;
    background: #ef4444;
    /* Give it a solid close red when open */
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
}

.bubble-menu-toggle .close-icon {
    display: none;
    font-size: 1.5rem;
}

.bubble-menu-toggle.is-open .logo-content {
    display: none;
}

.bubble-menu-toggle.is-open .close-icon {
    display: block;
    /* Optional rotation for close icon */
    animation: rotateIn 0.3s ease forwards;
}

@keyframes rotateIn {
    from {
        transform: rotate(-90deg) scale(0.5);
        opacity: 0;
    }

    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* The wrapper holding the items that fan out */
.bubble-items-wrapper {
    position: absolute;
    bottom: 20px;
    /* offset from toggle center */
    right: 20px;
    /* offset from toggle center */
    width: 0;
    height: 0;
    pointer-events: none;
    /* Let clicks pass when closed */
    z-index: 1050;
}

.bubble-menu-container.is-open .bubble-items-wrapper {
    pointer-events: auto;
}

/* Individual bubble items */
.bubble-item {
    position: absolute;
    text-decoration: none;
    background: #1e293b;
    /* default dark bg */
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    /* Starting state: hidden at center (0,0 of wrapper which is bottom right corner) */
    transform: translate(0, 0) scale(0);
    opacity: 0;
    /* Transition handled by JS, but fallback here */
    transform-origin: center right;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: capitalize;
}

/* Hover styles for bubble items (dynamically injected vars via JS or handled by CSS) */
.bubble-item {
    transition: background-color 0.2s, color 0.2s, transform 0.2s ease-out;
}

.bubble-item:hover {
    background: var(--hover-bg, var(--primary)) !important;
    color: var(--hover-color, #ffffff) !important;
    /* A little pop on hover */
    /* Transform logic in JS will overwrite this, so we use a child element instead */
}

/* Inner span to handle the hover scale so we don't conflict with JS positioning transform */
.bubble-item-inner {
    transition: transform 0.2s;
    display: inline-block;
}

.bubble-item:hover .bubble-item-inner {
    transform: scale(1.1);
}