/**
 * FB Messenger Chat - Frontend Styles
 * Responsive design for PC, tablet, and mobile
 */

/* Custom Messenger Button */
.fbmc-custom-button {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #0084ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 999998;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.fbmc-custom-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 132, 255, 0.4);
}

.fbmc-custom-button:active {
    transform: scale(0.95);
}

.fbmc-custom-button svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Tooltip */
.fbmc-tooltip {
    position: absolute;
    right: 70px;
    background: #1c1e21;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fbmc-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #1c1e21;
}

.fbmc-custom-button:hover .fbmc-tooltip {
    opacity: 1;
    visibility: visible;
    right: 75px;
}

/* Pulse animation for attention */
@keyframes fbmc-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 132, 255, 0.5);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(0, 132, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 132, 255, 0);
    }
}

.fbmc-custom-button.fbmc-pulse {
    animation: fbmc-pulse 2s infinite;
}

/* Facebook Chat Plugin Overrides */
.fb_dialog {
    z-index: 999999 !important;
}

.fb_dialog_content {
    z-index: 999999 !important;
}

.fb_customer_chat_bounce_in_v2 {
    z-index: 999999 !important;
}

/* Tablet Styles */
@media screen and (max-width: 1024px) {
    .fbmc-custom-button {
        width: 56px;
        height: 56px;
    }
    
    .fbmc-custom-button svg {
        width: 26px;
        height: 26px;
    }
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .fbmc-custom-button {
        width: 52px;
        height: 52px;
        bottom: 90px;
        right: 15px;
    }
    
    .fbmc-custom-button svg {
        width: 24px;
        height: 24px;
    }
    
    .fbmc-tooltip {
        display: none;
    }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
    .fbmc-custom-button {
        width: 48px;
        height: 48px;
        bottom: 85px;
        right: 12px;
    }
    
    .fbmc-custom-button svg {
        width: 22px;
        height: 22px;
    }
}

/* Hide when FB chat is loaded */
.fbmc-custom-button.fbmc-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* RTL Support */
[dir="rtl"] .fbmc-custom-button {
    right: auto;
    left: 20px;
}

[dir="rtl"] .fbmc-tooltip {
    right: auto;
    left: 70px;
}

[dir="rtl"] .fbmc-tooltip::after {
    right: auto;
    left: -6px;
    border-left-color: transparent;
    border-right-color: #1c1e21;
}

[dir="rtl"] .fbmc-custom-button:hover .fbmc-tooltip {
    right: auto;
    left: 75px;
}

/* Print styles - hide widget */
@media print {
    .fbmc-custom-button,
    .fb_dialog,
    .fb_customer_chat_bounce_in_v2 {
        display: none !important;
    }
}

/* Accessibility - reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fbmc-custom-button {
        transition: none;
    }
    
    .fbmc-custom-button.fbmc-pulse {
        animation: none;
    }
    
    .fbmc-tooltip {
        transition: none;
    }
}

/* Focus states for accessibility */
.fbmc-custom-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 132, 255, 0.5);
}

.fbmc-custom-button:focus:not(:focus-visible) {
    outline: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
