/**
 * Public styles for WhatsApp Button Pro
 */

/* Button Wrapper */
.wabp-button-wrapper {
    position: fixed;
    z-index: 99999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                visibility 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Ensure button becomes visible - important overrides */
.wabp-button-wrapper#wabp-button {
    display: block !important;
}

/* Show states */
.wabp-button-wrapper.wabp-show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Entrance animations */
.wabp-button-wrapper.wabp-entrance-fade-up {
    transform: translateY(30px);
}

.wabp-button-wrapper.wabp-entrance-fade-up.wabp-show {
    transform: translateY(0);
}

.wabp-button-wrapper.wabp-entrance-bounce {
    animation: wabp-bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wabp-button-wrapper.wabp-entrance-slide {
    transform: translateX(100px);
}

.wabp-button-wrapper.wabp-entrance-slide.wabp-show {
    transform: translateX(0);
}

/* Main Button */
.wabp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.wabp-button:focus {
    outline: 2px solid #25d366;
    outline-offset: 2px;
}

/* Button ripple effect */
.wabp-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wabp-button:active::before {
    width: 100px;
    height: 100px;
}

/* Button Icon */
.wabp-button-icon {
    position: relative;
    z-index: 1;
}

/* Button Text (Hover tooltip) */
.wabp-button-text {
    position: absolute;
    background: #fff;
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Text position based on button position */
.wabp-button-wrapper[data-position="right"] .wabp-button-text {
    right: calc(100% + 12px);
}

.wabp-button-wrapper[data-position="left"] .wabp-button-text {
    left: calc(100% + 12px);
}

/* Show text on hover (desktop only) */
@media (hover: hover) and (pointer: fine) {
    .wabp-button:hover .wabp-button-text {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
}

/* Hover animations */
.wabp-button.wabp-hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
}

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

.wabp-button.wabp-hover-rotate:hover {
    transform: rotate(15deg) scale(1.05);
}

/* Active state */
.wabp-button:active {
    transform: scale(0.95);
}

/* Pulse animation */
@keyframes wabp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.wabp-button.wabp-pulse {
    animation: wabp-pulse 2s infinite;
}

/* Bounce in animation */
@keyframes wabp-bounce-in {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.5);
    }
    60% {
        transform: translateY(-10px) scale(1.1);
    }
    80% {
        transform: translateY(5px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Shortcode button styles */
.wabp-shortcode-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #25d366;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.wabp-shortcode-button:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wabp-shortcode-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Size variants for shortcode */
.wabp-shortcode-button.wabp-size-small {
    padding: 6px 12px;
    font-size: 12px;
}

.wabp-shortcode-button.wabp-size-small svg {
    width: 16px;
    height: 16px;
}

.wabp-shortcode-button.wabp-size-large {
    padding: 14px 28px;
    font-size: 18px;
}

.wabp-shortcode-button.wabp-size-large svg {
    width: 24px;
    height: 24px;
}

/* Style variants for shortcode */
.wabp-shortcode-button.wabp-style-outline {
    background: transparent;
    border: 2px solid #25d366;
    color: #25d366;
}

.wabp-shortcode-button.wabp-style-outline:hover {
    background: #25d366;
    color: white;
}

.wabp-shortcode-button.wabp-style-text {
    background: transparent;
    color: #25d366;
    padding: 0;
}

.wabp-shortcode-button.wabp-style-text:hover {
    color: #128c7e;
}

/* Position variants for shortcode */
.wabp-shortcode-button.wabp-position-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

.wabp-shortcode-button.wabp-position-left {
    display: inline-flex;
    margin-right: auto;
}

.wabp-shortcode-button.wabp-position-right {
    display: inline-flex;
    margin-left: auto;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .wabp-button {
        -webkit-tap-highlight-color: transparent;
    }
    
    .wabp-button::before {
        content: '';
        position: absolute;
        top: -8px;
        right: -8px;
        bottom: -8px;
        left: -8px;
    }
    
    /* Never show text on mobile */
    .wabp-button-text {
        display: none !important;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .wabp-button-wrapper {
        bottom: 12px !important;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .wabp-button-wrapper,
    .wabp-button,
    .wabp-button::before,
    .wabp-button-text,
    .wabp-shortcode-button {
        transition: none !important;
        animation: none !important;
    }
}

/* Print styles */
@media print {
    .wabp-button-wrapper {
        display: none !important;
    }
}

/* Accessibility improvements */
.wabp-button:focus-visible {
    outline: 3px solid #25d366;
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wabp-button {
        border: 2px solid white;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wabp-button-text {
        background: #1f2937;
        color: #f3f4f6;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}
