
@-webkit-keyframes icon-lac {
        0% {
            -webkit-transform: rotate(0) scale(1) skew(1deg);
        }

        10% {
            -webkit-transform: rotate(-25deg) scale(1) skew(1deg);
        }

        20% {
            -webkit-transform: rotate(25deg) scale(1) skew(1deg);
        }

        30% {
            -webkit-transform: rotate(-25deg) scale(1) skew(1deg);
        }

        40% {
            -webkit-transform: rotate(25deg) scale(1) skew(1deg);
        }

        50% {
            -webkit-transform: rotate(0) scale(1) skew(1deg);
        }

        100% {
            -webkit-transform: rotate(0) scale(1) skew(1deg);
        }
    }

    @-webkit-keyframes zoom {
        0% {
            transform: scale(.9)
        }

        70% {
            transform: scale(1);
            box-shadow: 0 0 0 15px transparent
        }

        100% {
            transform: scale(.9);
            box-shadow: 0 0 0 0 transparent
        }
    }

/* Contact Button Frontend Styles */
.contact-buttons-wrapper {
    position: fixed;
    z-index: 9999;
    display: flex;
    /* For click mode, items appear above the main button */
    flex-direction: column-reverse;
    align-items: center;
    gap: 10px;
}

.contact-buttons-wrapper.right { right: 20px; }
.contact-buttons-wrapper.left { left: 20px; }

.main-contact-button {
    width: 48px; /* Adjusted size */
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden; /* For ripple */
}

.main-contact-button .main-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom center;
    align-items: center; /* Ensure items are centered if wrapper is wider */
}

.contact-buttons-wrapper.click .contact-list.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
}

.contact-buttons-wrapper.click .contact-list.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.contact-button {
    width: 48px; /* Adjusted size */
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), box-shadow 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    position: relative;
    transform: scale(1); /* Start at normal scale */
}
.contact-button:hover {

}
.contact-button img {
    width: 25px; /* Adjusted size */
    height: 25px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Default for light icons on dark bg, adjust if needed */
    transition: transform 0.3s ease;
    -webkit-animation: icon-lac 1s infinite ease-in-out;
        animation: icon-lac 1s infinite ease-in-out;
}

/* Shared Hover/Focus Ripple and Icon Animation */
.contact-button::after,
.main-contact-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.5s ease-out;
    pointer-events: none; /* Important */
}

.contact-button:hover, .contact-button:focus,
.main-contact-button:hover, .main-contact-button:focus {
    transform: translateY(-3px) scale(1.05); /* Slight lift and scale */
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.contact-button:hover::after, .contact-button:focus::after,
.main-contact-button:hover::after, .main-contact-button:focus::after {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 1;
    /* Start ripple fade out slightly after it expands */
    transition: transform 0.4s ease-out, opacity 0.6s ease-out 0.1s;
    /* Reset for next hover */
    animation: ripple-fade-out 0.6s ease-out 0.1s forwards;
}

@keyframes ripple-fade-out {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

@-webkit-keyframes zoom {
        0% {
            transform: scale(.9)
        }

        70% {
            transform: scale(1);
            box-shadow: 0 0 0 15px transparent
        }

        100% {
            transform: scale(.9);
            box-shadow: 0 0 0 0 transparent
        }
    }
.contact-button:hover img, .contact-button:focus img,
 {
    animation: pulse 1.5s infinite 1s;
}

@keyframes icon-rotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}


/* Idle Animations for Main Button (if not active) */
.main-contact-button.bounce:not(.active) { animation: bounce 2s infinite 1s; } /* Added delay */
.main-contact-button.pulse:not(.active) { animation: pulse 2s infinite 1s; }
.main-contact-button.shake:not(.active) { animation: shake 1.5s infinite 1s; } /* Slower shake */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}
@keyframes pulse {
    0% { box-shadow: 0 4px 15px rgba(0,0,0,0.15); transform: scale(1); }
    50% { box-shadow: 0 6px 25px rgba(0,0,0,0.25); transform: scale(1.3); }
    100% { box-shadow: 0 4px 15px rgba(0,0,0,0.15); transform: scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px) rotate(-2deg); }
    20%, 40%, 60%, 80% { transform: translateX(3px) rotate(2deg); }
}

/* Staggered animation for contact list items */
.contact-buttons-wrapper.click .contact-list.show .contact-button {
    opacity: 0; /* Start hidden for animation */
    animation: slideInUp 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}
.contact-buttons-wrapper.always .contact-list .contact-button { /* For always mode */
     opacity: 0;
     animation: slideInUp 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.contact-list.show .contact-button:nth-child(1), .always .contact-list .contact-button:nth-child(1) { animation-delay: 0.05s; }
.contact-list.show .contact-button:nth-child(2), .always .contact-list .contact-button:nth-child(2) { animation-delay: 0.1s; }
.contact-list.show .contact-button:nth-child(3), .always .contact-list .contact-button:nth-child(3) { animation-delay: 0.15s; }
.contact-list.show .contact-button:nth-child(4), .always .contact-list .contact-button:nth-child(4) { animation-delay: 0.2s; }
/* Add more if needed */

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px) scale(0.7); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tooltip */
.contact-button::before { /* Changed from ::after to ::before to not conflict with ripple */
    content: attr(title);
    position: absolute;
    /* Adjust based on position class */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 6px 10px; /* Smaller padding */
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10000; /* Above other elements */
}
.contact-buttons-wrapper.right .contact-button::before { right: 120%; transform: translateY(-50%) translateX(10px); } /* To the left */
.contact-buttons-wrapper.left .contact-button::before { left: 120%; transform: translateY(-50%) translateX(-10px); }   /* To the right */

.contact-button:hover::before, .contact-button:focus::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}


/* Phone Modal Styles */
.phone-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
    z-index: 99999; opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.phone-modal.visible { opacity: 1; pointer-events: auto; }
.phone-modal-content {
    background: white; padding: 25px 30px; border-radius: 8px; text-align: center;
    max-width: 320px; width: 90%; transform: scale(0.9); transition: transform 0.3s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.phone-modal.visible .phone-modal-content { transform: scale(1); }
.phone-modal h3 { margin: 0 0 12px 0; color: #333; font-size: 17px; }
.phone-modal p {
    font-size: 22px; font-weight: bold; color: #0073aa; margin: 0 0 18px 0;
    font-family: 'Arial', sans-serif; letter-spacing: 0.5px;
}
.phone-modal-content div { display: flex; gap: 10px; justify-content: center; }
.phone-modal-content button {
    background: #0073aa; color: white; border: none; padding: 9px 18px;
    border-radius: 5px; cursor: pointer; font-size: 13px; transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}
.phone-modal-content button.close-modal { background: #777; }
.phone-modal-content button:hover { opacity: 0.85; transform: translateY(-1px); }
.phone-modal-content button.copied { background: #28a745; }


/* Mobile responsive */
@media (max-width: 768px) {
    .contact-buttons-wrapper { bottom: 15px !important; }
    .contact-buttons-wrapper.right { right: 15px !important; }
    .contact-buttons-wrapper.left { left: 15px !important; }
    .main-contact-button { width: 50px; height: 50px; }
    .main-contact-button .main-icon { width: 22px; height: 22px; }
    .contact-button { width: 42px; height: 42px; }
    .contact-button img { width: 20px; height: 20px; }
    .contact-button::before { display: none; } /* Hide tooltips on mobile */
}

/* Print styles */
@media print { .contact-buttons-wrapper { display: none !important; } }

/* High contrast mode & Reduced motion */
@media (prefers-contrast: high) {
    .contact-button, .main-contact-button { border: 2px solid WindowText; }
}
@media (prefers-reduced-motion: reduce) {
    .main-contact-button.bounce:not(.active),
    .main-contact-button.pulse:not(.active),
    .main-contact-button.shake:not(.active),
    .contact-button, .main-contact-button, .contact-list,
    .contact-button img, .main-contact-button .main-icon,
    .contact-button::after, .main-contact-button::after,
    .contact-button::before {
        animation: none !important;
        transition: none !important;
    }
}