/* ======================================
   CUFB Frontend Floating Button
   All prefixed: #cufb- to avoid conflicts
====================================== */

#cufb-wrapper {
    position: fixed;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 10px;
}

#cufb-button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

#cufb-button:hover {
    transform: scale(1.1) !important;
    text-decoration: none !important;
}

#cufb-button:focus {
    outline: 3px solid rgba(255,255,255,0.6);
    outline-offset: 2px;
}

#cufb-icon {
    pointer-events: none;
    line-height: 1 !important;
}

/* TOOLTIP */
#cufb-tooltip {
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.4;
    max-width: 160px;
    text-align: center;
}

#cufb-wrapper:hover #cufb-tooltip {
    opacity: 1;
    transform: scale(1);
}

/* ======================================
   ANIMATIONS
====================================== */

/* Pulse Ring */
@keyframes cufb-pulse {
    0%   { box-shadow: 0 0 0 0 var(--cufb-pulse-color, rgba(37,211,102,0.7)); }
    70%  { box-shadow: 0 0 0 18px rgba(0,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

.cufb-anim-pulse #cufb-button {
    animation: cufb-pulse 2s infinite;
}

/* Bounce */
@keyframes cufb-bounce {
    0%, 100% { transform: translateY(0); }
    25%       { transform: translateY(-8px); }
    50%       { transform: translateY(0); }
    75%       { transform: translateY(-4px); }
}

.cufb-anim-bounce #cufb-button {
    animation: cufb-bounce 2s infinite;
}

/* Shake */
@keyframes cufb-shake {
    0%, 100% { transform: rotate(0deg); }
    10%       { transform: rotate(-12deg); }
    20%       { transform: rotate(12deg); }
    30%       { transform: rotate(-8deg); }
    40%       { transform: rotate(8deg); }
    50%       { transform: rotate(0deg); }
}

.cufb-anim-shake #cufb-button {
    animation: cufb-shake 2.5s infinite;
}

/* Hover overrides animation transform */
.cufb-anim-bounce #cufb-button:hover,
.cufb-anim-shake #cufb-button:hover {
    animation: none;
    transform: scale(1.1);
}

/* ======================================
   ENTRANCE ANIMATION
====================================== */
@keyframes cufb-enter {
    from { opacity: 0; transform: scale(0.5) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

#cufb-wrapper {
    animation: cufb-enter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
