/**
 * WA Float Frontend Styles
 *
 * @package WA_Float
 */

/* Root variables - set dynamically via PHP */
:root {
    --wa-float-color: #25D366;
    --wa-float-size: 60px;
}

/* Main wrapper */
.wa-float-wrap {
    position: fixed;
    z-index: 9999;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.wa-float-wrap.wa-float--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Position variants */
.wa-float--bottom-right {
    bottom: 20px;
    right: 20px;
}

.wa-float--bottom-left {
    bottom: 20px;
    left: 20px;
}

.wa-float--top-right {
    top: 20px;
    right: 20px;
}

.wa-float--top-left {
    top: 20px;
    left: 20px;
}

/* Button styles */
.wa-float-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--wa-float-color);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    width: var(--wa-float-size);
    min-height: var(--wa-float-size);
    padding: 0 20px 0 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wa-float-btn:hover {
    background-color: var(--wa-float-color);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.wa-float-btn:active {
    transform: scale(0.98);
}

.wa-float-btn:focus {
    outline: 2px solid var(--wa-float-color);
    outline-offset: 2px;
}

/* WhatsApp icon */
.wa-float-btn svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

/* Label styling */
.wa-float-label {
    display: none;
    white-space: nowrap;
}

/* Show label on hover (desktop only) */
@media (hover: hover) and (pointer: fine) {
    .wa-float-btn:hover .wa-float-label {
        display: inline;
    }
}

/* Pulse animation */
@keyframes wa-pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--wa-float-color) 50%, transparent);
    }

    70% {
        box-shadow: 0 0 0 14px color-mix(in srgb, var(--wa-float-color) 0%, transparent);
    }

    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--wa-float-color) 0%, transparent);
    }
}

.wa-float--pulse .wa-float-btn {
    animation: wa-pulse 2s infinite;
}

.wa-float--pulse .wa-float-btn:hover {
    animation: none;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .wa-float-btn {
        border-radius: 50%;
        padding: 0;
        justify-content: center;
        width: var(--wa-float-size);
        height: var(--wa-float-size);
    }

    .wa-float-label {
        display: none !important;
    }

    .wa-float--bottom-right,
    .wa-float--bottom-left {
        bottom: 15px;
    }

    .wa-float--top-right,
    .wa-float--top-left {
        top: 15px;
    }

    .wa-float--bottom-right,
    .wa-float--top-right {
        right: 15px;
    }

    .wa-float--bottom-left,
    .wa-float--top-left {
        left: 15px;
    }

    .wa-float-btn:hover {
        transform: none;
    }

    .wa-float-btn:active {
        transform: scale(0.95);
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

    .wa-float-wrap,
    .wa-float-btn {
        transition: none;
        animation: none;
    }

    .wa-float--pulse .wa-float-btn {
        animation: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .wa-float-btn:hover {
        transform: none;
    }
}

/* Print styles - hide button */
@media print {
    .wa-float-wrap {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wa-float-btn {
        border: 2px solid #fff;
    }
}