/* =================================
   WHATSAPP FLOATING BUTTON STYLES
   File: assets/css/whatsapp-floating-button.css
   ================================= */

/* WhatsApp Floating Button - Positioned above admission button */
.floating-whatsapp {
    position: fixed !important;
    bottom: 120px; /* 70px (admission button height) + 20px (padding) + 30px (original bottom) */
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 32px;
    text-decoration: none !important;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4), 0 5px 15px rgba(37, 211, 102, 0.2);
    z-index: 99998 !important; /* One level below admission button */
    transition: all 0.3s ease;
    animation: floatWhatsApp 3.5s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

/* WhatsApp Floating Animation */
@keyframes floatWhatsApp {
    0%, 100% { 
        transform: translateY(0) scale(1); 
        box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4), 0 5px 15px rgba(37, 211, 102, 0.2);
    }
    50% { 
        transform: translateY(-8px) scale(1.02); 
        box-shadow: 0 15px 35px rgba(37, 211, 102, 0.5), 0 8px 20px rgba(37, 211, 102, 0.3);
    }
}

/* WhatsApp Hover Effects */
.floating-whatsapp:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 15px 40px rgba(37, 211, 102, 0.6), 0 8px 25px rgba(37, 211, 102, 0.4) !important;
    animation-play-state: paused;
    color: #ffffff !important;
    background: linear-gradient(135deg, #25D366 0%, #1DA851 100%);
}

.floating-whatsapp:active {
    transform: scale(1.05) !important;
    transition-duration: 0.1s;
}

/* WhatsApp Tooltip Styling */
.floating-whatsapp-tooltip {
    position: absolute;
    right: 85px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    min-width: max-content;
    width: auto;
    text-align: center;
    letter-spacing: 0.5px;
    max-width: calc(100vw - 120px);
}

/* WhatsApp Tooltip Arrow */
.floating-whatsapp-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid #20BA5A;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

/* Show WhatsApp tooltip on hover */
.floating-whatsapp:hover .floating-whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Responsive Design for WhatsApp Button */
@media (max-width: 768px) {
    .floating-whatsapp {
        width: 60px;
        height: 60px;
        font-size: 26px;
        bottom: 110px; /* 60px (admission button height) + 20px (padding) + 25px (admission button bottom) + 5px extra */
        right: 25px;
    }
    
    .floating-whatsapp-tooltip {
        right: 75px;
        font-size: 13px;
        padding: 10px 15px;
        max-width: calc(100vw - 100px);
    }
    
    .floating-whatsapp-tooltip::after {
        border-left-width: 6px;
        border-top-width: 6px;
        border-bottom-width: 6px;
    }
}

@media (max-width: 480px) {
    .floating-whatsapp {
        width: 55px;
        height: 55px;
        font-size: 24px;
        bottom: 95px; /* 55px (admission button height) + 20px (padding) + 20px (admission button bottom) */
        right: 20px;
    }
    
    .floating-whatsapp-tooltip {
        right: 70px;
        font-size: 12px;
        padding: 8px 12px;
        max-width: calc(100vw - 90px);
        word-wrap: break-word;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
}

@media (max-width: 360px) {
    .floating-whatsapp-tooltip {
        font-size: 11px;
        padding: 6px 10px;
        max-width: calc(100vw - 80px);
    }
}

/* WhatsApp Button Accessibility */
.floating-whatsapp:focus {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

.floating-whatsapp:focus:not(:focus-visible) {
    outline: none;
}

/* Print styles - hide WhatsApp button when printing */
@media print {
    .floating-whatsapp {
        display: none !important;
    }
}

/* Dark mode support for WhatsApp button */
@media (prefers-color-scheme: dark) {
    .floating-whatsapp {
        border-color: rgba(255, 255, 255, 0.3);
        box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5), 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    
    .floating-whatsapp:hover {
        box-shadow: 0 15px 40px rgba(37, 211, 102, 0.7), 0 8px 25px rgba(0, 0, 0, 0.4) !important;
    }
}

/* Ensure WhatsApp button visibility */
.floating-whatsapp {
    pointer-events: all !important;
    z-index: 2147483646 !important; /* Just below admission button */
}

body .floating-whatsapp {
    position: fixed !important;
    z-index: 99998 !important;
}

/* Additional fix for WhatsApp tooltip positioning */
.floating-whatsapp:hover .floating-whatsapp-tooltip {
    transform: translateY(-50%) translateZ(0);
    will-change: opacity, visibility;
}