/**
 * WKD Button Contact - Frontend Styles
 * Optimized for performance (< 5KB minified + gzipped)
 */

/* CSS Variables with defaults */
:root {
    --wkdbc-bottom: 20px;
    --wkdbc-side: 20px;
    --wkdbc-zindex: 9999;
    --wkdbc-mobile-scale: 0.8;
}

/* Main Wrapper */
.wkdbc-wrapper {
    position: fixed;
    bottom: var(--wkdbc-bottom);
    z-index: var(--wkdbc-zindex);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wkdbc-right {
    right: var(--wkdbc-side);
    align-items: flex-end;
}

.wkdbc-left {
    left: var(--wkdbc-side);
    align-items: flex-start;
}

/* Zoom pulse animation for button */
.wkdbc-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--wkdbc-bg, #00a651);
    color: var(--wkdbc-icon-color, #fff);
    text-decoration: none;
    box-shadow: 0 0 0 0 var(--wkdbc-bg);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    animation: wkdbcZoom 1.5s infinite;
}

.wkdbc-button:hover {
    transform: scale(1.1);
}

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

/* Icon */
.wkdbc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.wkdbc-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.wkdbc-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Phone ring animation for icon */
.wkdbc-button .wkdbc-icon {
    animation: wkdbcPhoneRing 4s ease-in-out infinite;
}

/* Zoom pulse animation */
@keyframes wkdbcZoom {
    0% {
        transform: scale(0.9);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px transparent;
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 transparent;
    }
}

/* Phone ring icon animation */
@keyframes wkdbcPhoneRing {
    0% {
        transform: rotate(0) scale(1) skew(1deg);
    }
    10% {
        transform: rotate(-25deg) scale(1) skew(1deg);
    }
    20% {
        transform: rotate(25deg) scale(1) skew(1deg);
    }
    30% {
        transform: rotate(-25deg) scale(1) skew(1deg);
    }
    40% {
        transform: rotate(25deg) scale(1) skew(1deg);
    }
    50% {
        transform: rotate(0) scale(1) skew(1deg);
    }
    100% {
        transform: rotate(0) scale(1) skew(1deg);
    }
}

/* Focus states for accessibility */
.wkdbc-button:focus {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

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

.wkdbc-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .wkdbc-button {
        width: calc(50px * var(--wkdbc-mobile-scale));
        height: calc(50px * var(--wkdbc-mobile-scale));
    }

    .wkdbc-icon {
        width: calc(24px * var(--wkdbc-mobile-scale));
        height: calc(24px * var(--wkdbc-mobile-scale));
    }

}

/* Hide on desktop when configured */
@media (min-width: 769px) {
    .wkdbc-hide-desktop {
        display: none !important;
    }
}

/* Hide on mobile when configured */
@media (max-width: 768px) {
    .wkdbc-hide-mobile {
        display: none !important;
    }
}

/* Print styles - hide buttons */
@media print {
    .wkdbc-wrapper {
        display: none !important;
    }
}
