/* Contact Buttons Styles - SEO Optimized Layout */

#button-contact-vr {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

#button-contact-vr .button-contact {
    position: relative;
    margin-bottom: 12px;
}

/* Contact Link - Text bên trái, Icon bên phải */
#button-contact-vr .button-contact .contact-link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

/* Text bên trái */
.contact-text {
    position: absolute;
    right: 100%;
    margin-right: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 15px;
    border-radius: 25px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.contact-link:hover .contact-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Phone button có 2 dòng text */
#phone-vr .contact-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 8px 15px;
}

#phone-vr .contact-label {
    font-size: 12px;
    opacity: 0.9;
}

#phone-vr .contact-phone {
    font-size: 15px;
    font-weight: 600;
    margin-top: 2px;
}

/* Icon bên phải */
#button-contact-vr .button-contact .phone-vr {
    position: relative;
    visibility: visible;
    background-color: transparent;
    width: 70px;
    height: 70px;
    cursor: pointer;
    z-index: 11;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transition: visibility .5s;
    display: block;
}

/* Circle with pulse animation */
.phone-vr-circle-fill {
    width: 60px;
    height: 60px;
    top: 5px;
    left: 5px;
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    -webkit-animation: phone-vr-circle-fill 2.3s infinite ease-in-out, zoom 1.3s infinite;
    animation: phone-vr-circle-fill 2.3s infinite ease-in-out, zoom 1.3s infinite;
    transition: all .5s;
    -webkit-transform-origin: 50% 50%;
    -ms-transform-origin: 50% 50%;
    transform-origin: 50% 50%;
}

/* Icon circle */
.phone-vr-img-circle {
    width: 40px;
    height: 40px;
    line-height: 40px;
    top: 15px;
    left: 15px;
    position: absolute;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-animation: phone-vr-circle-fill 1s infinite ease-in-out;
    animation: phone-vr-circle-fill 1s infinite ease-in-out;
}

.phone-vr-img-circle img {
    max-height: 25px;
    max-width: 27px;
    display: block;
}

/* Facebook Button */
#fanpage-vr .phone-vr-circle-fill {
    box-shadow: 0 0 0 0 rgb(24 119 242 / 65%);
    background-color: rgb(24 119 242 / 70%);
}

#fanpage-vr .phone-vr-img-circle {
    background-color: #1877f2;
}

#fanpage-vr .phone-vr-img-circle img {
    max-width: 22px;
    max-height: 22px;
}

/* Zalo Button */
#zalo-vr .phone-vr-circle-fill {
    box-shadow: 0 0 0 0 #2196F3;
    background-color: rgba(33, 150, 243, 0.7);
}

#zalo-vr .phone-vr-img-circle {
    background-color: #2196F3;
}

/* Phone Button */
#phone-vr .phone-vr-circle-fill {
    box-shadow: 0 0 0 0 #c31d1d;
    background-color: rgba(230, 8, 8, 0.7);
}

#phone-vr .phone-vr-img-circle {
    background-color: #e60808;
}

/* Shake Animation */
@-webkit-keyframes phone-vr-circle-fill {
    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);
    }
}

@keyframes phone-vr-circle-fill {
    0% {
        transform: rotate(0) scale(1) skew(1deg);
    }
    10% {
        transform: rotate(-25deg) scale(1) skew(1deg);
    }
    20% {
        transform: rotate(25deg) scale(1) skew(1deg);
    }
    30% {
        transform: rotate(-25deg) scale(1) skew(1deg);
    }
    40% {
        transform: rotate(25deg) scale(1) skew(1deg);
    }
    50% {
        transform: rotate(0) scale(1) skew(1deg);
    }
    100% {
        transform: rotate(0) scale(1) skew(1deg);
    }
}

/* Zoom/Pulse Animation */
@-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;
    }
}

@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;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #button-contact-vr {
        bottom: 15px;
        right: 15px;
    }
    
    #button-contact-vr .button-contact {
        margin-bottom: 10px;
    }
    
    #button-contact-vr .button-contact .phone-vr {
        width: 60px;
        height: 60px;
    }
    
    .phone-vr-circle-fill {
        width: 52px;
        height: 52px;
        top: 4px;
        left: 4px;
    }
    
    .phone-vr-img-circle {
        width: 35px;
        height: 35px;
        top: 12.5px;
        left: 12.5px;
    }
    
    .phone-vr-img-circle img {
        max-height: 20px;
        max-width: 22px;
    }
    
    /* Ẩn text trên mobile */
    .contact-text {
        display: none !important;
    }
}

@media (max-width: 480px) {
    #button-contact-vr {
        bottom: 10px;
        right: 10px;
    }
    
    #button-contact-vr .button-contact .phone-vr {
        width: 55px;
        height: 55px;
    }
    
    .phone-vr-circle-fill {
        width: 48px;
        height: 48px;
    }
    
    .phone-vr-img-circle {
        width: 32px;
        height: 32px;
        top: 11.5px;
        left: 11.5px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .phone-vr-circle-fill,
    .phone-vr-img-circle {
        animation: none !important;
    }
    
    .contact-text {
        transition: opacity 0.2s ease;
    }
}
