/* ========================================
   WHATSAPP INTEGRATION STYLES
   ======================================== */

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    z-index: 1000;
    animation: float-bounce 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.whatsapp-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.whatsapp-button:hover::before {
    width: 300px;
    height: 300px;
}

.whatsapp-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-button svg {
    width: 32px;
    height: 32px;
    fill: white;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Pulse Animation Ring */
.whatsapp-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #25D366;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

@keyframes float-bounce {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Tooltip */
.whatsapp-tooltip {
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid #1a1a1a;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    right: 80px;
}

/* WhatsApp Chat Widget */
.whatsapp-widget {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 350px;
    max-width: calc(100vw - 60px);
    max-height: calc(100vh - 140px);
    /* Ensure it doesn't overflow viewport */
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.whatsapp-widget.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Widget Header */
.whatsapp-widget-header {
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    flex-shrink: 0;
    /* Don't shrink header */
}

.whatsapp-widget-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: contain;
    /* Ensures full logo is visible */
    background: white;
    padding: 2px;
    /* Add breathing room */
}

.whatsapp-widget-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.whatsapp-widget-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.whatsapp-widget-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-widget-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.whatsapp-widget-close svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Widget Body */
.whatsapp-widget-body {
    padding: 20px;
    background: #ECE5DD;
    min-height: 150px;
    max-height: 200px;
    /* Reduced to fit better */
    overflow-y: auto;
    flex-shrink: 1;
    /* Allow body to shrink if needed */
}

.whatsapp-message {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: slide-in 0.3s ease;
}

.whatsapp-message::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 10px;
    width: 0;
    height: 0;
    border-right: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.whatsapp-message p {
    margin: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.whatsapp-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Quick Action Buttons */
.whatsapp-quick-actions {
    padding: 15px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    /* Limit height */
    overflow-y: auto;
    /* Make scrollable if too many actions */
    flex-shrink: 1;
    /* Allow to shrink */
}

.whatsapp-quick-btn {
    background: #F0F2F5;
    border: 1px solid #E4E6EB;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    /* Don't shrink individual buttons */
}

.whatsapp-quick-btn:hover {
    background: #E4E6EB;
    border-color: #25D366;
    transform: translateX(5px);
}

.whatsapp-quick-btn svg {
    width: 18px;
    height: 18px;
    fill: #25D366;
}

/* Widget Footer */
.whatsapp-widget-footer {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #E4E6EB;
    flex-shrink: 0;
    /* Don't shrink footer */
}

.whatsapp-start-chat {
    width: 100%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-start-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-start-chat svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-button {
        width: 55px;
        height: 55px;
    }

    .whatsapp-button svg {
        width: 28px;
        height: 28px;
    }

    .whatsapp-widget {
        bottom: 90px;
        right: 20px;
        width: calc(100vw - 40px);
    }

    .whatsapp-tooltip {
        display: none;
    }
}

/* Notification Badge */
.whatsapp-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #FF3B30;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid white;
    animation: badge-pulse 2s ease-in-out infinite;
    z-index: 20;
    /* Ensure it's above the button */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Online Status Indicator */
.whatsapp-status {
    width: 12px;
    height: 12px;
    background: #25D366;
    border-radius: 50%;
    border: 2px solid white;
    position: absolute;
    bottom: 2px;
    right: 2px;
    animation: status-blink 2s ease-in-out infinite;
}

@keyframes status-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}