/* Chat Floating Widget */
.whatsapp-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.whatsapp-bubble {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ff6b35, #ff4757);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.whatsapp-bubble:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 15px 35px rgba(255, 107, 53, 0.6);
}

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

.whatsapp-bubble i {
    font-size: 32px;
    color: white;
    z-index: 2;
}

/* Animated pulse rings */
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 3px solid #ff6b35;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.pulse-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.pulse-ring:nth-child(3) {
    animation-delay: 1s;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Tooltip */
.tooltip {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
}

.whatsapp-bubble:hover .tooltip {
    opacity: 1;
    visibility: visible;
    right: 85px;
}

/* Welcome message popup */
.welcome-popup {
    position: absolute;
    bottom: 90px;
    right: 0;
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.welcome-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.welcome-popup::before {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 25px;
    border: 10px solid transparent;
    border-top-color: white;
}

.popup-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.popup-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #ff6b35, #ff4757);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.popup-avatar i {
    color: white;
    font-size: 20px;
}

.popup-info h4 {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.popup-info .status {
    font-size: 13px;
    color: #25d366;
    display: flex;
    align-items: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #25d366;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.popup-message {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.whatsapp-button {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.whatsapp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-popup:hover {
    background: #f5f5f5;
    color: #666;
}

/* Enhanced Responsive Design - FIXED VERSION */
@media (max-width: 768px) {
    .whatsapp-widget {
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-bubble {
        width: 65px;
        height: 65px;
    }

    .whatsapp-bubble i {
        font-size: 30px;
    }

    .welcome-popup {
        /* CRITICAL FIX: Position popup to stay within screen bounds */
        position: fixed !important;
        bottom: 100px !important;
        right: 20px !important;
        left: 20px !important;
        max-width: none !important;
        min-width: auto !important;
        width: calc(100vw - 40px) !important;
        box-sizing: border-box;
        margin: 0;
    }

    .welcome-popup::before {
        /* Position arrow to point to bubble */
        left: auto !important;
        right: 32.5px !important;
        /* Half of bubble width + right margin */
    }

    .tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .whatsapp-widget {
        bottom: 15px;
        right: 15px;
    }

    .whatsapp-bubble {
        width: 60px;
        height: 60px;
    }

    .whatsapp-bubble i {
        font-size: 28px;
    }

    .welcome-popup {
        bottom: 90px !important;
        right: 15px !important;
        left: 15px !important;
        width: calc(100vw - 30px) !important;
        padding: 18px;
    }

    .welcome-popup::before {
        right: 30px !important;
        /* Half of bubble width + right margin */
    }

    .popup-header {
        margin-bottom: 12px;
    }

    .popup-avatar {
        width: 40px;
        height: 40px;
        margin-right: 12px;
    }

    .popup-avatar i {
        font-size: 18px;
    }

    .popup-info h4 {
        font-size: 16px;
    }

    .popup-message {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .whatsapp-button {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .whatsapp-widget {
        bottom: 10px;
        right: 10px;
    }

    .welcome-popup {
        bottom: 80px !important;
        right: 10px !important;
        left: 10px !important;
        width: calc(100vw - 20px) !important;
        padding: 16px;
    }

    .welcome-popup::before {
        right: 30px !important;
    }

    .popup-info h4 {
        font-size: 15px;
    }

    .popup-message {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 15px;
    }

    .whatsapp-button {
        padding: 11px 14px;
        font-size: 13px;
    }
}

/* Fix for landscape orientation on mobile */
@media (max-height: 500px) and (max-width: 768px) {
    .welcome-popup {
        bottom: 70px !important;
        max-height: 60vh;
        overflow-y: auto;
    }
}