/**
 * WhatsApp Button Pro - Frontend Styles
 * Modern responsive design with smooth animations
 */

/* Base Button Styles */
#wab-whatsapp-button {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button Container */
.wab-button-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Button */
.wab-button-main {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.wab-button-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

/* WhatsApp Icon */
.wab-whatsapp-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Button Text */
.wab-button-text {
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Desktop Positioning */
.wab-button-right {
    right: 30px;
    bottom: 30px;
}

.wab-button-left {
    left: 30px;
    bottom: 30px;
}

/* Desktop Hover Effects */
.wab-desktop .wab-button-main:hover,
.wab-button-main.wab-hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
}

.wab-desktop .wab-button-main:hover::before,
.wab-button-main.wab-hover::before {
    left: 100%;
}

/* Mobile Styles */
.wab-mobile {
    right: 20px;
    bottom: 20px;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wab-mobile.wab-visible {
    opacity: 1;
    transform: translateY(0);
}

.wab-mobile .wab-button-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
}

.wab-mobile .wab-button-text {
    display: none;
}

.wab-mobile .wab-whatsapp-icon {
    margin: 0;
    width: 28px;
    height: 28px;
}

/* Mobile Touch Effects */
.wab-button-main.wab-touch {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.4);
}

/* Click Animation */
.wab-button-main.wab-clicked {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.4);
}

/* Pulse Animation */
@keyframes wab-pulse {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.8), 0 0 0 10px rgba(37, 211, 102, 0.1);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

.wab-button-main.wab-pulse {
    animation: wab-pulse 1s ease-in-out;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .wab-button-right,
    .wab-button-left {
        right: 15px;
        bottom: 15px;
        left: auto;
    }
    
    /* Force mobile styles on small screens */
    #wab-whatsapp-button {
        opacity: 0;
        transform: translateY(100px);
    }
    
    #wab-whatsapp-button.wab-visible {
        opacity: 1;
        transform: translateY(0);
    }
    
    .wab-button-main {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        justify-content: center !important;
    }
    
    .wab-button-text {
        display: none !important;
    }
    
    .wab-whatsapp-icon {
        margin: 0 !important;
        width: 28px !important;
        height: 28px !important;
    }
}

@media (max-width: 480px) {
    .wab-button-right,
    .wab-button-left {
        right: 10px;
        bottom: 10px;
    }
    
    .wab-button-main {
        width: 55px !important;
        height: 55px !important;
    }
    
    .wab-whatsapp-icon {
        width: 24px !important;
        height: 24px !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wab-button-main {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    }
    
    .wab-desktop .wab-button-main:hover,
    .wab-button-main.wab-hover {
        box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wab-button-main {
        border: 2px solid #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .wab-button-main,
    #wab-whatsapp-button,
    .wab-button-container {
        transition: none !important;
        animation: none !important;
    }
    
    .wab-button-main.wab-pulse {
        animation: none !important;
    }
}

/* Print Styles */
@media print {
    #wab-whatsapp-button {
        display: none !important;
    }
}

/* Accessibility Improvements */
.wab-button-main:focus {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 2px;
}

.wab-button-main:focus:not(:focus-visible) {
    outline: none;
}

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

.wab-button-main.wab-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: wab-spin 1s linear infinite;
}

@keyframes wab-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success State */
.wab-button-main.wab-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.wab-button-main.wab-success::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 18px;
    font-weight: bold;
}
