/**
 * WhatsApp Contact Button Styles
 * 
 * @package Multi WhatsApp Button
 * @since 1.0.0
 */

/* Tooltip Container */
.wcb-tooltip-container {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    direction: rtl;
}

/* WhatsApp Button */
.wcb-button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--wcb-button-color, #25D366);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
    overflow: hidden;
    border: none;
    outline: none;
    gap: 8px;
    animation: wcb-pulse 2s infinite;
}

.wcb-button-content:focus {
    box-shadow: 0 0 0 3px var(--wcb-button-color-rgba, rgba(37, 211, 102, 0.3));
    outline: none;
}

.wcb-button-content:focus-visible {
    box-shadow: 0 0 0 3px var(--wcb-button-color-rgba, rgba(37, 211, 102, 0.3));
    outline: 2px solid var(--wcb-button-color, #25D366);
    outline-offset: 2px;
}

.wcb-button-content::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--wcb-button-color-rgba, rgba(37, 211, 102, 0.4));
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.wcb-button-content:hover {
    background-color: var(--wcb-button-color-dark, #128C7E);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    animation-play-state: paused;
}

.wcb-button-content:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.wcb-text {
    font-size: 18px;
    font-weight: 600;
    margin-right: 12px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: letter-spacing 0.3s ease;
}

.wcb-button-content:hover .wcb-text {
    letter-spacing: 1px;
}

.wcb-whatsapp-icon {
    fill: currentColor;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    width: 24px;
    height: 24px;
}

.wcb-button-content:hover .wcb-whatsapp-icon {
    transform: scale(1.1);
}

/* Tooltip Content */
.wcb-tooltip-content {
    position: absolute;
    bottom: calc(100% + 15px);
    right: 0;
    transform: translateY(10px);
    background: white;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
    min-width: 200px;
    max-width: 300px;
}

.wcb-tooltip-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* WhatsApp Numbers List */
.wcb-whatsapp-numbers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wcb-whatsapp-number {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f5f5f5;
    transition: all 0.2s ease;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
}

.wcb-whatsapp-number:hover,
.wcb-whatsapp-number:focus {
    background: var(--wcb-button-color, #25D366);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    outline: none;
}

.wcb-whatsapp-number:focus-visible {
    outline: 2px solid var(--wcb-button-color, #25D366);
    outline-offset: 2px;
}

.wcb-number-label {
    margin-left: 30px;
    margin-right: 0;
    text-align: right;
    white-space: nowrap;
    flex: 1;
    font-size: 14px;
    color: inherit;
}

.wcb-number-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 10px;
    margin-right: 0;
}

.wcb-number-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--wcb-button-color, #25D366);
    transition: fill 0.2s ease;
}

.wcb-whatsapp-number:hover .wcb-number-icon svg,
.wcb-whatsapp-number:focus .wcb-number-icon svg {
    fill: white;
}

/* Tooltip Arrow */
.wcb-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 20px;
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: white transparent transparent transparent;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.1));
}

/* Left Side Positioning */
.wcb-tooltip-container[style*="left: 20px"] .wcb-tooltip-content {
    right: auto;
    left: 0;
}

.wcb-tooltip-container[style*="left: 20px"] .wcb-tooltip-content::after {
    right: auto;
    left: 20px;
}

/* RTL Support */
.wcb-button-content {
    flex-direction: row-reverse;
}

.wcb-button-content .wcb-whatsapp-icon {
    margin-left: 0;
    margin-right: 8px;
}

/* Button Animations */
@keyframes wcb-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@keyframes wcb-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes wcb-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes wcb-wiggle {
    0%, 100% {
        transform: rotate(0);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Apply animations based on class */
.wcb-button-content.animation-pulse {
    animation: wcb-pulse 2s infinite;
}

.wcb-button-content.animation-bounce {
    animation: wcb-bounce 1s infinite;
}

.wcb-button-content.animation-shake {
    animation: wcb-shake 0.5s infinite;
}

.wcb-button-content.animation-wiggle {
    animation: wcb-wiggle 0.5s infinite;
}

/* Ensure animations work with hover state */
.wcb-button-content:hover {
    animation-play-state: paused;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wcb-button-content {
        animation: none !important;
    }
}

/* Mobile Responsiveness */
@media screen and (max-width: 782px) {
    .wcb-button-content {
        padding: 12px 24px;
    }
    
    .wcb-tooltip-content {
        min-width: 180px;
        max-width: calc(100vw - 40px);
    }
    
    .wcb-whatsapp-number {
        padding: 8px 10px;
    }
    
    .wcb-number-label {
        font-size: 13px;
        margin-left: 20px;
    }
    
    .wcb-number-icon {
        width: 20px;
        height: 20px;
    }
    
    .wcb-number-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Button Size Styles */
.wcb-button-content {
    transition: all 0.3s ease;
}

/* Small Button */
.wcb-button-content.size-small {
    padding: 10px 20px;
    border-radius: 20px;
}

.wcb-button-content.size-small .wcb-whatsapp-icon {
    width: 20px;
    height: 20px;
}

/* Medium Button (Default) */
.wcb-button-content.size-medium {
    padding: 14px 28px;
    border-radius: 25px;
}

.wcb-button-content.size-medium .wcb-whatsapp-icon {
    width: 24px;
    height: 24px;
}

/* Large Button */
.wcb-button-content.size-large {
    padding: 18px 36px;
    border-radius: 30px;
}

.wcb-button-content.size-large .wcb-whatsapp-icon {
    width: 28px;
    height: 28px;
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
    .wcb-button-content.size-small {
        padding: 8px 16px;
    }
    
    .wcb-button-content.size-medium {
        padding: 12px 24px;
    }
    
    .wcb-button-content.size-large {
        padding: 16px 32px;
    }
}

/* Button Style Variations */
.wcb-button-content {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Rounded Style (Default) */
.wcb-button-content.style-rounded {
    border-radius: 50px;
    padding: 14px 28px;
}

.wcb-button-content.style-rounded.size-small {
    padding: 10px 20px;
    border-radius: 20px;
}

.wcb-button-content.style-rounded.size-large {
    padding: 18px 36px;
    border-radius: 30px;
}

/* Circle Style */
.wcb-button-content.style-circle {
    border-radius: 50%;
    padding: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcb-button-content.style-circle.size-small {
    width: 50px;
    height: 50px;
}

.wcb-button-content.style-circle.size-large {
    width: 70px;
    height: 70px;
}

.wcb-button-content.style-circle .wcb-whatsapp-icon {
    margin: 0;
}

/* Square Style */
.wcb-button-content.style-square {
    border-radius: 12px;
    padding: 14px 28px;
}

.wcb-button-content.style-square.size-small {
    padding: 10px 20px;
    border-radius: 8px;
}

.wcb-button-content.style-square.size-large {
    padding: 18px 36px;
    border-radius: 16px;
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
    .wcb-button-content.style-rounded {
        padding: 12px 24px;
    }
    
    .wcb-button-content.style-circle {
        width: 50px;
        height: 50px;
    }
    
    .wcb-button-content.style-square {
        padding: 12px 24px;
    }
}