/* css/fab.css - Extracted and enhanced FAB styles */

.fab-container-right {
    position: fixed;
    bottom: 20px; /* ~20px from bottom */
    right: 20px;
    display: flex;
    flex-direction: column; /* Normal column, we control order in HTML */
    align-items: flex-end; /* Align right */
    z-index: 9999;
}

@media (max-width: 768px) {
    .fab-container-right {
        bottom: 30px; /* ~30px on mobile */
        right: 15px;
    }
}

.fab-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* TOP BUTTON: Small Contact */
.fab-btn-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.95); /* Quieter background */
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fab-btn-small:hover {
    background-color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(0,0,0,0.2);
    color: var(--meko-blue, #0d6efd);
}

@media (max-width: 768px) {
    .fab-btn-small {
        opacity: 0.8; /* Semi-transparent on mobile */
    }
}

/* BOTTOM BUTTON: Large Quiz */
.fab-btn-large-pulsating {
    height: 60px;
    padding: 0 25px;
    border-radius: 30px; /* Elongated pill shape */
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%); /* Bright gradient */
    background-color: #ff6b6b; /* Fallback */
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: pulse-border 2s infinite;
    transition: transform 0.3s;
    white-space: nowrap;
}

/* Override gradient for something simpler if desired, or keep "Bright" */
.fab-btn-large-pulsating {
    background: #ff5252; /* Bright Red/Pink */
}

.fab-btn-large-pulsating:hover {
    transform: scale(1.05);
}

.fab-icon {
    font-size: 20px;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 82, 82, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0);
    }
}

/* Ensure buttons hide when needed (via JS logic usually, or just CSS if modal is open) */
body.modal-open .fab-container-right {
    display: none !important;
}

/* Popover Menu */
.fab-popover-menu {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 200px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: bottom right;
}

.fab-wrapper.active .fab-popover-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.fab-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    cursor: pointer;
}

.fab-menu-item:hover {
    background-color: #f5f5f5;
}

.fab-menu-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
    text-align: center;
}

.fab-menu-item.telegram i { color: #0088cc; }
.fab-menu-item.viber i { color: #7360f2; }
.fab-menu-item.phone i { color: #333; }
.fab-menu-item.callback-btn {
    border-top: 1px solid #eee;
    color: var(--meko-blue, #0d6efd);
    font-weight: 600;
}

/* Tooltip Bubble for FABs */
.fab-tooltip-bubble {
    position: absolute;
    right: 75px;
    background-color: white;
    color: #333;
    padding: 10px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    z-index: 999;
}

/* Arrow for the bubble */
.fab-tooltip-bubble::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

.fab-wrapper:hover .fab-tooltip-bubble,
.fab-wrapper.show-tooltip .fab-tooltip-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Shake Animation - Intermittent */
@keyframes shake-intermittent {
    0% { transform: rotate(0deg); }
    5% { transform: rotate(10deg); }
    10% { transform: rotate(-10deg); }
    15% { transform: rotate(10deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

.shake-animation {
    animation: shake-intermittent 5s infinite ease-in-out; /* 5s total cycle, shakes for first ~1s */
    transform-origin: center;
}

.fab-wrapper:hover .shake-animation {
    animation: none; /* Stop shaking on hover */
    transform: scale(1.05); /* Just scale */
}
