/*
 * assets/site.css
 * Fast, lightweight site styling & optimizations.
 * Loading overlay has been completely removed for instant, zero-delay page loads.
 */

/* Native hardware-accelerated smooth scrolling */
html {
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Fast image rendering: asynchronous decoding & soft placeholder */
img {
    content-visibility: auto;
}
img[loading="lazy"] {
    background-color: rgba(17, 24, 22, 0.04);
}

/* ---------- WhatsApp Floating Widget (Middle Right) ---------- */
.site-whatsapp-widget {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.site-whatsapp-btn {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.site-whatsapp-icon-wrap {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25D366;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45), 0 4px 10px rgba(0, 0, 0, 0.18);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.site-whatsapp-btn:hover .site-whatsapp-icon-wrap {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.6), 0 6px 16px rgba(0, 0, 0, 0.25);
}

.site-whatsapp-icon {
    width: 32px;
    height: 32px;
    fill: #ffffff;
    transition: transform 0.3s ease;
}

.site-whatsapp-btn:hover .site-whatsapp-icon {
    transform: scale(1.08) rotate(4deg);
}

/* Pulsing aura */
.site-whatsapp-ping {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: #25D366;
    opacity: 0.5;
    animation: wa-pulse 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

@keyframes wa-pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.28); opacity: 0; }
    100% { transform: scale(1.28); opacity: 0; }
}

/* Popup speech bubble */
.site-whatsapp-popup {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #0f172a;
    padding: 9px 14px;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    pointer-events: auto;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Little triangle pointing to the green button */
.site-whatsapp-popup::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #ffffff;
}

.site-whatsapp-popup-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.site-whatsapp-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
    animation: wa-status-blink 1.8s infinite;
}

@keyframes wa-status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.site-whatsapp-status-text {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #16a34a;
}

.site-whatsapp-popup-msg {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.site-whatsapp-popup-close {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    border: none;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.site-whatsapp-popup-close:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .site-whatsapp-widget {
        right: 12px;
    }
    .site-whatsapp-icon-wrap {
        width: 50px;
        height: 50px;
    }
    .site-whatsapp-icon {
        width: 28px;
        height: 28px;
    }
    .site-whatsapp-popup {
        display: none; /* Keep clean on small mobile screens to prevent covering mobile content */
    }
}
