/* ============================================
   FLOATING ACTION BUTTONS (FAB)
   WhatsApp | Call | SMS | Email
   ============================================ */

.floating-action-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 1000;
    align-items: flex-end;
}

/* Individual FAB Button */
.fab-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.25),
        0 2px 6px rgba(0, 0, 0, 0.15);
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: visible;
}

.fab-button i {
    font-size: 24px;
    line-height: 1;
    transition: transform 0.2s ease;
    color: #ffffff !important;
}

/* WhatsApp Button */
.fab-whatsapp {
    background: #25D366;
}

.fab-whatsapp:hover,
.fab-whatsapp:focus-visible {
    background: #20bd5a;
    color: #ffffff;
}

/* Call Button - white text on red for WCAG AA */
.fab-call {
    background: #e92227;
    color: #ffffff !important;
}

.fab-call i {
    color: #ffffff !important;
}

.fab-call:hover,
.fab-call:focus-visible {
    background: #9e1f24;
    color: #ffffff !important;
}

/* SMS Button - iMessage blue for universal "text message" recognition */
.fab-sms {
    background: #007AFF;
    color: #ffffff !important;
}

.fab-sms i {
    color: #ffffff !important;
}

.fab-sms:hover,
.fab-sms:focus-visible {
    background: #0062cc;
    color: #ffffff !important;
}

/* Email Button */
.fab-email {
    background: #0a1628;
}

.fab-email:hover,
.fab-email:focus-visible {
    background: #162a4a;
    color: #ffffff;
}

/* Hover Effects */
.fab-button:hover,
.fab-button:focus-visible {
    transform: scale(1.1);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    color: #ffffff;
}

.fab-button:active {
    transform: scale(1.05);
}

.fab-button:hover i {
    transform: scale(1.1);
}

/* Labels */
.fab-label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: rgba(10, 22, 40, 0.92);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fab-button:hover .fab-label,
.fab-button:focus-visible .fab-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Focus-visible outline for accessibility */
.fab-button:focus-visible {
    outline: 3px solid #e92227;
    outline-offset: 3px;
}

/* Entrance animation */
@keyframes fabSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fab-button:nth-child(1) {
    animation: fabSlideIn 0.4s 0.1s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fab-button:nth-child(2) {
    animation: fabSlideIn 0.4s 0.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fab-button:nth-child(3) {
    animation: fabSlideIn 0.4s 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fab-button:nth-child(4) {
    animation: fabSlideIn 0.4s 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* WhatsApp subtle pulse */
@keyframes fabPulse {
    0%, 100% {
        box-shadow:
            0 4px 14px rgba(0, 0, 0, 0.25),
            0 2px 6px rgba(0, 0, 0, 0.15),
            0 0 0 0 rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow:
            0 4px 14px rgba(0, 0, 0, 0.25),
            0 2px 6px rgba(0, 0, 0, 0.15),
            0 0 0 8px rgba(37, 211, 102, 0);
    }
}

.fab-whatsapp {
    animation: fabSlideIn 0.4s 0.1s cubic-bezier(0.4, 0, 0.2, 1) both,
               fabPulse 3s 2s ease-in-out infinite;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .fab-button,
    .fab-button i,
    .fab-label {
        animation: none !important;
        transition: none !important;
    }

    .fab-button {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   TABLET (768px - 1023px)
   ============================================ */
@media (max-width: 1023px) and (min-width: 768px) {
    .floating-action-buttons {
        bottom: 20px;
        right: 20px;
        gap: 12px;
    }

    .fab-button {
        width: 54px;
        height: 54px;
    }

    .fab-button i {
        font-size: 22px;
    }
}

/* ============================================
   TABLET/MOBILE with CTA bar (<992px)
   Push FABs above the sticky mobile CTA bar (60px tall)
   ============================================ */
@media (max-width: 991px) {
    .floating-action-buttons {
        bottom: 80px;
    }
}

/* ============================================
   MOBILE (<768px)
   ============================================ */
@media (max-width: 767px) {
    .floating-action-buttons {
        bottom: 80px;
        right: 16px;
        gap: 10px;
    }

    .fab-button {
        width: 50px;
        height: 50px;
    }

    .fab-button i {
        font-size: 20px;
    }

    /* Always show labels on mobile */
    .fab-label {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
        font-size: 11px;
        padding: 4px 10px;
        animation: none;
    }
}

/* ============================================
   SMALL MOBILE (<480px)
   ============================================ */
@media (max-width: 479px) {
    .floating-action-buttons {
        bottom: 76px;
        right: 12px;
        gap: 8px;
    }

    .fab-button {
        width: 46px;
        height: 46px;
    }

    .fab-button i {
        font-size: 18px;
    }

    .fab-label {
        font-size: 10px;
        padding: 3px 8px;
    }
}
