:root {
    --whatsapp-primary-color: #25D366;
    --whatsapp-secondary-color: #20b354;
    --transition-speed: 0.3s;
    --tooltip-show-duration: 3s;
    --tooltip-interval: 10s;
}

.whatsapp-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--whatsapp-primary-color) 0%, var(--whatsapp-secondary-color) 100%);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 8px 15px rgba(0, 0, 0, 0.2),
        0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    text-decoration: none;
    transition: 
        transform var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease;
    outline: none;
    cursor: pointer;
}

.whatsapp-floating i {
    font-size: 32px;
    transition: transform var(--transition-speed) ease;
}

/* Accessibility and interaction states */
.whatsapp-floating:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Pulse Animation */
@keyframes pulse-animation {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.whatsapp-floating::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: var(--whatsapp-primary-color);
    border-radius: 50%;
    opacity: 0.4;
    z-index: -1;
    animation: pulse-animation 2s infinite cubic-bezier(0.24, 0, 0.38, 1);
}

/* Hover and Active States */
.whatsapp-floating:hover,
.whatsapp-floating:active {
    transform: scale(1.1);
    box-shadow: 
        0 12px 20px rgba(0, 0, 0, 0.25),
        0 6px 10px rgba(0, 0, 0, 0.15);
}

.whatsapp-floating:hover i,
.whatsapp-floating:active i {
    transform: rotate(360deg);
}

/* Tooltip Styles with Periodic Display */
.whatsapp-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', 'Poppins', sans-serif;
    font-weight: 400;
    white-space: nowrap;
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 
        opacity var(--transition-speed) ease,
        visibility var(--transition-speed) ease,
        transform var(--transition-speed) ease;
    z-index: 1001;
}

/* Add a little triangle to the tooltip */
.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.85);
}

/* Periodic Tooltip Animation */
@keyframes show-tooltip {
    0%, 20% {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    25%, 100% {
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
    }
}

.whatsapp-floating .whatsapp-tooltip {
    animation: show-tooltip var(--tooltip-interval) infinite;
}

/* Hover and Focus Override Periodic Animation */
.whatsapp-floating:hover .whatsapp-tooltip,
.whatsapp-floating:focus .whatsapp-tooltip {
    animation: none;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .whatsapp-floating {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }

    .whatsapp-floating i {
        font-size: 28px;
    }

    .whatsapp-tooltip {
        font-size: 12px;
        padding: 8px 12px;
        bottom: calc(100% + 12px);
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-floating::after,
    .whatsapp-floating,
    .whatsapp-tooltip {
        animation: none;
    }

    .whatsapp-floating,
    .whatsapp-floating i,
    .whatsapp-tooltip {
        transition: none;
    }
}