/**
 * ========================================
 * MODERN FLOATING ACTION BUTTONS
 * Vertical stack design with smooth animations
 * ========================================
 */

/* FAB Container - Vertical Stack */
.fab-menu {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Hide the main toggle button - we'll show all buttons directly */
.fab-main {
    display: none;
}

/* Make fab-options always visible */
.fab-options {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* Individual FAB Buttons - Modern Card Style */
.fab-option {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.15),
        0 3px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

/* Ripple effect on click */
.fab-option::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.fab-option:active::before {
    width: 100px;
    height: 100px;
}

/* Hover Effect */
.fab-option:hover {
    transform: translateX(-8px) scale(1.1);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.fab-option:active {
    transform: translateX(-8px) scale(1.05);
}

/* ========================================
 * BUTTON SPECIFIC COLORS
 * ========================================
 */

/* WhatsApp Button - Green - Force square modern style */
#whatsappBtn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 16px !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.15),
        0 3px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    text-decoration: none !important;
    border: none !important;
}

#whatsappBtn:hover {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%) !important;
    box-shadow:
        0 12px 32px rgba(37, 211, 102, 0.4),
        0 6px 12px rgba(18, 140, 126, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
    transform: translateX(-8px) scale(1.1) !important;
}

/* Compare Button - Blue */
#compareFab {
    position: fixed !important;
    bottom: 100px !important;
    left: 28px !important;
    right: auto !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 16px !important;
    border: none !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%) !important;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 3px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    cursor: pointer !important;
    z-index: 9998 !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

#compareFab.show {
    display: flex !important;
}

#compareFab:hover {
    background: linear-gradient(135deg, #0051D5 0%, #007AFF 100%) !important;
    transform: translateX(8px) scale(1.1) !important;
    box-shadow: 0 12px 32px rgba(0, 122, 255, 0.4), 0 6px 12px rgba(0, 81, 213, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

/* Compare button icon */
#compareFab .material-icons {
    font-size: 24px !important;
    line-height: 1 !important;
}

/* Compare Count Badge */
#compareFabCount,
.compare-fab-count {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background: linear-gradient(135deg, #FF3B30, #C70015) !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 3px 7px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    min-width: 22px !important;
    height: 22px !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.5) !important;
    border: 2px solid #ffffff !important;
    animation: pulse-badge 2s ease-in-out infinite !important;
    z-index: 9999 !important;
    pointer-events: none !important;
}

/* Hide badge when button is hidden */
#compareFab[style*="display: none"] #compareFabCount,
#compareFab[style*="display: none"] .compare-fab-count {
    display: none !important;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Chatbot Button - Purple */
#mnoryChatbotToggle,
#fabChatbot {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

#mnoryChatbotToggle:hover,
#fabChatbot:hover {
    background: linear-gradient(135deg, #764BA2 0%, #667EEA 100%);
    box-shadow:
        0 12px 32px rgba(102, 126, 234, 0.4),
        0 6px 12px rgba(118, 75, 162, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Back to Top Button - Dark Gray */
#backToTop,
#fabBackToTop {
    background: linear-gradient(135deg, #6C757D 0%, #495057 100%);
    display: none; /* Hidden by default, shown via JS when scrolled */
}

#backToTop:hover,
#fabBackToTop:hover {
    background: linear-gradient(135deg, #495057 0%, #6C757D 100%);
    box-shadow:
        0 12px 32px rgba(108, 117, 125, 0.4),
        0 6px 12px rgba(73, 80, 87, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ========================================
 * TOOLTIPS
 * ========================================
 */

.fab-option[title]::after {
    content: attr(title);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.fab-option:hover[title]::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Material Icons in FAB */
.fab-option .material-icons,
.fab-option i {
    font-size: 24px;
    user-select: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Font Awesome Icons (WhatsApp) */
.fab-option .fab {
    font-size: 24px;
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fab-options li {
    animation: slideInRight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.fab-options li:nth-child(1) {
    animation-delay: 0.1s;
}

.fab-options li:nth-child(2) {
    animation-delay: 0.2s;
}

.fab-options li:nth-child(3) {
    animation-delay: 0.3s;
}

.fab-options li:nth-child(4) {
    animation-delay: 0.4s;
}

/* ========================================
 * RESPONSIVE DESIGN
 * ========================================
 */

@media (max-width: 768px) {
    .fab-menu {
        bottom: 80px; /* Moved higher to avoid mobile navigation */
        bottom: calc(80px + env(safe-area-inset-bottom)); /* Safe area for notched devices */
        right: 16px;
        gap: 10px;
    }

    .fab-option {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .fab-option .material-icons,
    .fab-option i {
        font-size: 22px;
    }

    .fab-option .fab {
        font-size: 22px;
    }

    .fab-options {
        gap: 10px;
    }

    /* WhatsApp button responsive - force square style */
    #whatsappBtn {
        width: 52px !important;
        height: 52px !important;
        border-radius: 14px !important;
    }

    #whatsappBtn .fab {
        font-size: 22px !important;
    }

    /* Hide tooltips on mobile */
    .fab-option[title]::after {
        display: none;
    }

    /* Compare button mobile */
    #compareFab {
        bottom: 20px !important;
        bottom: calc(20px + env(safe-area-inset-bottom)) !important; /* Safe area support */
        left: 16px !important;
        right: auto !important;
        width: 52px !important;
        height: 52px !important;
        border-radius: 14px !important;
    }

    #compareFabCount,
    .compare-fab-count {
        top: -6px !important;
        right: -6px !important;
        font-size: 11px !important;
        padding: 2px 6px !important;
        min-width: 20px !important;
        height: 20px !important;
    }
}

@media (max-width: 480px) {
    .fab-menu {
        bottom: 70px; /* Higher to avoid mobile navigation and keyboard */
        bottom: calc(70px + env(safe-area-inset-bottom)); /* Safe area for notched devices */
        right: 12px;
        gap: 8px;
    }

    .fab-option {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .fab-option .material-icons,
    .fab-option i {
        font-size: 20px;
    }

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

    .fab-options {
        gap: 8px;
    }

    /* WhatsApp button responsive - force square style on small screens */
    #whatsappBtn {
        width: 48px !important;
        height: 48px !important;
        border-radius: 12px !important;
    }

    #whatsappBtn .fab {
        font-size: 20px !important;
    }

    /* Compare button small mobile */
    #compareFab {
        bottom: 16px !important;
        bottom: calc(16px + env(safe-area-inset-bottom)) !important; /* Safe area support */
        left: 12px !important;
        right: auto !important;
        width: 48px !important;
        height: 48px !important;
        border-radius: 12px !important;
    }

    /* Compare Count Badge - smaller on mobile */
    #compareFabCount,
    .compare-fab-count {
        top: -5px !important;
        right: -5px !important;
        font-size: 10px !important;
        padding: 2px 5px !important;
        min-width: 18px !important;
        height: 18px !important;
    }
}

/* ========================================
 * ACCESSIBILITY
 * ========================================
 */

.fab-option:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.fab-option:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .fab-option,
    .fab-option::before,
    .fab-option[title]::after,
    .fab-options li {
        animation: none;
        transition: none;
    }
}
