/**
 * Frontend styles for Btangshop WhatsApp plugin
 *
 * @package Btangshop_WhatsApp
 * @since   1.0.0
 */

/* CSS Custom Properties (set by PHP inline styles) */
:root {
    --btang-wa-icon-size: 60px;
    --btang-wa-icon-color: #25D366;
    --btang-wa-font-size: 30px;
}

/* WhatsApp Button Container */
.btang-wa-button {
    position: fixed;
    z-index: 99999;
}

/* Button Link */
.btang-wa-button a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--btang-wa-icon-size);
    height: var(--btang-wa-icon-size);
    background-color: var(--btang-wa-icon-color);
    border-radius: 50%;
    color: #ffffff;
    font-size: var(--btang-wa-font-size);
    text-decoration: none;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btang-wa-button a:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.btang-wa-button a:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Custom Icon */
.btang-wa-custom-icon {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

/* Status Indicator */
.btang-wa-status-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.btang-wa-status-online {
    background-color: #25D366;
}

.btang-wa-status-offline {
    background-color: #cccccc;
}

/* Popup Bubble */
.btang-wa-popup {
    position: fixed;
    max-width: 260px;
    background-color: #ffffff;
    color: #333333;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

/* Popup arrow - right side */
.btang-wa-popup.btang-wa-right::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
}

/* Popup arrow - left side */
.btang-wa-popup.btang-wa-left::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
}

.btang-wa-popup-inner {
    line-height: 1.4;
}

/* Popup Visible State */
.btang-wa-popup.btang-wa-popup-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Desktop hover: show popup when hovering button */
@media (hover: hover) and (pointer: fine) {
    .btang-wa-button:hover+.btang-wa-popup {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .btang-wa-popup {
        max-width: 220px;
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* Animation for button entrance */
@keyframes btang-wa-bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    60% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.btang-wa-button {
    animation: btang-wa-bounce-in 0.5s ease-out;
}

/* Pulse animation for online status */
@keyframes btang-wa-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.btang-wa-status-online {
    animation: btang-wa-pulse 2s infinite;
}