/**
 * Prondo WhatsApp Button - Optimized Styles
 *
 * Clean, lightweight CSS for WhatsApp floating button
 * Optimized for performance and mobile responsiveness
 */

/* Button Container */
.pwb-button-container,
.joinchat {
    position: fixed;
    z-index: 9999;
    display: none;
    animation: pwb-fade-in 0.3s ease-in-out;
}

.pwb-button-container.pwb-show,
.joinchat.pwb-show {
    display: block;
}

/* Button */
.pwb-button,
.joinchat__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25D366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.pwb-button:hover,
.joinchat__button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.pwb-button:active,
.joinchat__button:active {
    transform: scale(0.95);
}

.pwb-button svg,
.joinchat__button svg {
    width: 33px;
    height: 33px;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.pwb-button svg *,
.joinchat__button svg * {
    pointer-events: none;
}

.pwb-button:hover svg,
.joinchat__button:hover svg {
    transform: scale(1.1);
}

/* Tooltip */
.pwb-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #333;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Tooltip positioning for right side */
.pwb-right .pwb-tooltip {
    right: calc(100% + 12px);
}

.pwb-right .pwb-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #ffffff;
}

/* Tooltip positioning for left side */
.pwb-left .pwb-tooltip {
    left: calc(100% + 12px);
}

.pwb-left .pwb-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 6px 0;
    border-color: transparent #ffffff transparent transparent;
}

/* Show tooltip on hover (desktop only) */
@media (hover: hover) and (pointer: fine) {
    .pwb-button:hover ~ .pwb-tooltip,
    .joinchat__button:hover ~ .pwb-tooltip {
        opacity: 1;
        visibility: visible;
    }
}

/* Animations */
@keyframes pwb-fade-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Pulse animation (optional - can be triggered via JS) */
.pwb-button.pwb-pulse,
.joinchat__button.pwb-pulse {
    animation: pwb-pulse 2s ease-in-out infinite;
}

/* Mobile optimizations */
@media screen and (max-width: 768px) {
    .pwb-button,
    .joinchat__button {
        width: 56px;
        height: 56px;
    }

    .pwb-button svg,
    .joinchat__button svg {
        width: 30px;
        height: 30px;
    }

    .pwb-tooltip {
        font-size: 13px;
        padding: 6px 12px;
    }

    /* Adjust position on mobile to avoid overlapping with common mobile UI */
    .pwb-button-container,
    .joinchat {
        bottom: 20px !important;
    }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
    .pwb-button,
    .joinchat__button {
        width: 52px;
        height: 52px;
    }

    .pwb-button svg,
    .joinchat__button svg {
        width: 28px;
        height: 28px;
    }

    /* More compact spacing on very small screens */
    .pwb-button-container,
    .joinchat {
        bottom: 15px !important;
    }

    .pwb-button-container.pwb-right,
    .joinchat.pwb-right {
        right: 15px !important;
    }

    .pwb-button-container.pwb-left,
    .joinchat.pwb-left {
        left: 15px !important;
    }
}

/* Accessibility improvements */
.pwb-button:focus,
.joinchat__button:focus {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

.pwb-button:focus:not(:focus-visible),
.joinchat__button:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .pwb-button-container,
    .joinchat,
    .pwb-button,
    .joinchat__button,
    .pwb-tooltip,
    .pwb-button svg,
    .joinchat__button svg {
        animation: none;
        transition: none;
    }
}

/* Print - hide button when printing */
@media print {
    .pwb-button-container,
    .joinchat {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pwb-button,
    .joinchat__button {
        border: 2px solid currentColor;
    }
}
