/* ========================================
   WHATSAPP CHAT WIDGET STYLES
   ======================================== */

/* Widget Container */
.whatsapp-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;

    /* Slide-in animation */
    animation: slideInFromBottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideInFromBottom {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide-out animation (when dismissed) */
@keyframes slideOutToBottom {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(100px);
        opacity: 0;
    }
}

.whatsapp-chat-widget.dismissing {
    animation: slideOutToBottom 0.3s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

/* Chat Button */
.whatsapp-chat-button {
    position: relative;
    width: 60px;
    height: 60px;
    background: #25D366;
    /* WhatsApp Green */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    /* Apply subtle pulse animation */
    animation: gentlePulse 3s ease-in-out infinite;
}

.whatsapp-chat-button:hover {
    background: #20BA5A;
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.6);
    transform: scale(1.05);
}

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

/* WhatsApp Icon */
.whatsapp-icon,
.close-icon {
    width: 32px;
    height: 32px;
    transition: all 0.2s ease;
}

/* Close Widget Button */
.close-widget-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff4444;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 10;
}

.whatsapp-chat-widget:hover .close-widget-btn {
    opacity: 1;
    transform: scale(1);
}

.close-widget-btn:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.close-widget-btn:active {
    transform: scale(0.9);
}

.close-widget-btn svg {
    width: 12px;
    height: 12px;
}

/* Gentle Pulse Animation */
@keyframes gentlePulse {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 4px 24px rgba(37, 211, 102, 0.7);
        transform: scale(1.05);
    }
}

/* Pulse Animation (attention grabber) */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 24px rgba(37, 211, 102, 0.7);
    }

    100% {
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    }
}

.whatsapp-chat-button.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Tablet */
@media (max-width: 768px) {
    .whatsapp-chat-widget {
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-chat-button {
        width: 56px;
        height: 56px;
    }

    .whatsapp-icon,
    .close-icon {
        width: 28px;
        height: 28px;
    }

    .whatsapp-chat-tooltip {
        font-size: 13px;
        padding: 10px 36px 10px 12px;
        max-width: 240px;
        bottom: 66px;
    }

    .whatsapp-chat-tooltip::after {
        right: 18px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .whatsapp-chat-widget {
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-chat-button {
        width: 52px;
        height: 52px;
    }

    .whatsapp-chat-tooltip {
        font-size: 12px;
        padding: 8px 32px 8px 10px;
        max-width: 200px;
        bottom: 62px;
    }

    .whatsapp-chat-tooltip::after {
        right: 16px;
    }

    .close-tooltip {
        padding: 2px;
    }

    .close-tooltip svg {
        width: 14px;
        height: 14px;
    }

    .whatsapp-icon,
    .close-icon {
        width: 26px;
        height: 26px;
    }

    /* Hide tooltip on very small screens, rely on title attribute */
    .whatsapp-chat-tooltip {
        display: none;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus state for keyboard navigation */
.whatsapp-chat-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.3);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .whatsapp-chat-widget,
    .whatsapp-chat-button,
    .whatsapp-icon {
        animation: none !important;
        transition: none !important;
    }
}