/**
 * WhatsApp FAB - Public Styles
 * Version: 2.5.0 - WordPress.org Compliant
 * 
 * @package WhatsApp_FAB
 * @version 2.5.0
 * @author Intrepid
 * @license GPL-2.0+
 */

/* FontAwesome support */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* WhatsApp FAB Container - Fixed Positioning */
.whatsapp-fab {
    position: fixed !important;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    top: auto !important;
    transition: all 0.3s ease-in-out;
    /* Accessibility improvements */
    outline: none;
}

/* Button Positioning */
.whatsapp-fab-bottom-right {
    right: 20px !important;
    left: auto !important;
    top: auto !important;
}

.whatsapp-fab-bottom-left {
    left: 20px !important;
    right: auto !important;
    top: auto !important;
}

/* WhatsApp Button Styling */
.whatsapp-fab-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    color: #ffffff;
    font-size: 24px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    /* Accessibility improvements */
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.whatsapp-fab-button:hover {
    background: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
    color: #ffffff;
    text-decoration: none;
}

.whatsapp-fab-button:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    background: #128C7E;
}

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

/* Button Sizes */
.whatsapp-fab-small .whatsapp-fab-button {
    width: 50px;
    height: 50px;
    font-size: 20px;
}

.whatsapp-fab-medium .whatsapp-fab-button {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.whatsapp-fab-large .whatsapp-fab-button {
    width: 70px;
    height: 70px;
    font-size: 28px;
}

/* Pulse Animation */
.whatsapp-fab-button.pulse {
    animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .whatsapp-fab-bottom-right {
        right: 15px !important;
    }
    
    .whatsapp-fab-bottom-left {
        left: 15px !important;
    }
    
    .whatsapp-fab-small .whatsapp-fab-button {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .whatsapp-fab-medium .whatsapp-fab-button {
        width: 65px;
        height: 65px;
        font-size: 26px;
    }
    
    .whatsapp-fab-large .whatsapp-fab-button {
        width: 75px;
        height: 75px;
        font-size: 30px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .whatsapp-fab-button {
        background: #000000;
        border: 2px solid #ffffff;
    }
    
    .whatsapp-fab-button:hover,
    .whatsapp-fab-button:focus {
        background: #ffffff;
        color: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-fab-button {
        transition: none;
    }
    
    .whatsapp-fab-button.pulse {
        animation: none;
    }
    
    .whatsapp-fab-button:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .whatsapp-fab {
        display: none !important;
    }
}

/* RTL Support */
.rtl .whatsapp-fab-bottom-right {
    right: auto !important;
    left: 20px !important;
}

.rtl .whatsapp-fab-bottom-left {
    left: auto !important;
    right: 20px !important;
}

.rtl .whatsapp-fab-button {
    direction: ltr;
}

/* Focus Management for Screen Readers */
.whatsapp-fab-button:focus:not(:focus-visible) {
    outline: none;
}

.whatsapp-fab-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Loading State */
.whatsapp-fab-loading .whatsapp-fab-button {
    opacity: 0.7;
    pointer-events: none;
}

/* Error State */
.whatsapp-fab-error .whatsapp-fab-button {
    background: #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.whatsapp-fab-error .whatsapp-fab-button:hover {
    background: #c82333;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.6);
}
