/* WhatsApp Floating Chat - Frontend Styles */
/* No dependencies. Vanilla CSS only. */

/* CSS Custom Properties for theming */
:root {
    --wafc-green: #25D366;
    --wafc-green-hover: #20BD5A;
    --wafc-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    --wafc-shadow-hover: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* Main button container */
.wafc-button {
    position: fixed;
    z-index: 999999;
    /* Use CSS custom properties set inline for positioning */
    /* bottom and right/left come from inline style vars */
}

.wafc-bottom-right {
    bottom: var(--wafc-bottom, 30px);
    right: var(--wafc-side, 30px);
}

.wafc-bottom-left {
    bottom: var(--wafc-bottom, 30px);
    left: var(--wafc-side, 30px);
}

/* Button link */
.wafc-button-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--wafc-size, 60px);
    height: var(--wafc-size, 60px);
    border-radius: 50%;
    background-color: var(--wafc-green);
    box-shadow: var(--wafc-shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    cursor: pointer;
    outline: none;
    border: none;
}

.wafc-button-link:hover {
    background-color: var(--wafc-green-hover);
    box-shadow: var(--wafc-shadow-hover);
    transform: scale(1.1);
}

.wafc-button-link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

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

/* Icon sizing - SVG fills 55% of button */
.wafc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55%;
    height: 55%;
}

.wafc-icon svg {
    width: 100%;
    height: 100%;
    fill: #ffffff;
}

/* Tooltip */
.wafc-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #333333;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    line-height: 1.4;
}

/* Tooltip arrow */
.wafc-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
}

/* Right position: tooltip on left side */
.wafc-bottom-right .wafc-tooltip {
    right: calc(100% + 12px);
}
.wafc-bottom-right .wafc-tooltip::after {
    left: 100%;
    border-left-color: #ffffff;
}

/* Left position: tooltip on right side */
.wafc-bottom-left .wafc-tooltip {
    left: calc(100% + 12px);
}
.wafc-bottom-left .wafc-tooltip::after {
    right: 100%;
    border-right-color: #ffffff;
}

/* Show tooltip on hover */
.wafc-button:hover .wafc-tooltip {
    opacity: 1;
    visibility: visible;
}

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

.wafc-button[data-pulse="1"] .wafc-button-link {
    animation: wafc-pulse 2s infinite;
}

/* Pause pulse on hover for cleaner UX */
.wafc-button[data-pulse="1"]:hover .wafc-button-link {
    animation-play-state: paused;
}

/* Entrance animation */
@keyframes wafc-entrance {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wafc-button {
    animation: wafc-entrance 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wafc-tooltip {
        display: none; /* Hide tooltip on mobile for cleaner UX */
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .wafc-button,
    .wafc-button-link,
    .wafc-tooltip {
        animation: none !important;
        transition: none !important;
    }
}
