/**
 * VN Call-to-Action Buttons CSS
 * Based on original _calltobutton.scss
 * 
 * @package VN_CTA_Buttons
 * @version 1.2.3
 */

/* Container */
.vn-cta-buttons-container {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

/* Individual Button */
.vn-cta-button {
    display: flex;
    justify-content: flex-start;
    position: relative;
    visibility: visible;
    background-color: transparent;
    width: 6rem;
    height: 6rem;
    cursor: pointer;
    z-index: 11;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    transition: transform 0.2s, visibility 0.5s;
    left: 0;
    bottom: 0;
    border-radius: 50%;
}

.vn-cta-button.phone-button a {
    background-color: var(--fs-color-primary);
}

.vn-cta-buttons-container .vn-cta-button.phone-button:before {
    background-color: var(--fs-color-primary) !important;
}

/* Button Background Circle (Animation Ring) */
.vn-cta-button:before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    /* top: 12px; */
    /* left: 12px; */
    position: absolute;
    border-radius: 50%;
    /* border: 2px solid #0000001f; */
    -webkit-animation: phone-vr-circle-fill 2.3s infinite ease-in-out;
    animation: phone-vr-circle-fill 2.3s infinite ease-in-out;
    transition: all 0.5s;
    -webkit-transform-origin: 50% 50%;
    transform-origin: 50% 50%;
    animation-name: zoom;
    animation-duration: 1.3s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    box-shadow: 0 0 4px 0px #2196f35e;
    background-color: rgba(33, 150, 243, 0.7);
}

/* Icon Container */
.vn-cta-icon {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 4rem;
    padding: .4rem;
    /* top: 25px; */
    /* left: 25px; */
    position: absolute;
    border-radius: 50%;
    overflow: hidden;
    -webkit-animation: phone-vr-circle-fill 1s infinite ease-in-out;
    animation: phone-vr-circle-fill 1s infinite ease-in-out;
}

.phone-button .vn-cta-icon {
    padding: 0.8rem;
}

/* Icon Image */
.vn-cta-icon img {
    background-color: unset;
    border-radius: 6px;
}

/* Text on mobile only */
.vn-cta-text {
    display: none;
}

/* Hover Effects */
.vn-cta-button:hover {
    transform: scale(1.15);
}

/* Link Styling */
.vn-cta-button a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 50%;
}

/* Animations from original theme */
@-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);
    }
}

@-webkit-keyframes zoom {
    0% {
        transform: scale(0.9);
    }

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

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

@keyframes zoom {
    0% {
        transform: scale(0.9);
    }

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

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

/* Mobile Responsiveness */
@media (max-width: 549px) {
    .vn-cta-buttons-container {
        flex-direction: row !important;
        gap: 1rem;
        left: 0.4rem !important;
        right: 0.4rem !important;
        top: auto !important;
        bottom: 0.4rem !important;
        transform: none;
        width: 100%;
        padding: 0;
        z-index: 9999;
    }

    .vn-cta-button {
        width: calc(50% - 0.9rem);
        height: 4.8rem;
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        margin: 0;
        border: 1px solid var(--fs-color-primary);
        border-radius: 0.8rem;
        background-color: transparent !important;
        overflow: hidden;
        /* Màu sắc sẽ được override bằng inline CSS từ admin settings */
    }

    .vn-cta-button:before {
        display: none;
        /* Ẩn animation ring trên mobile */
    }

    .vn-cta-button a {
        color: #212529;
        text-decoration: none;
        gap: 0.6rem;
        border-radius: 0;

        /* border: 1px solid #ccc; */
    }

    .vn-cta-icon {
        position: static;
        width: auto;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        animation: none;
        background: transparent;
        border-radius: 0;
        overflow: visible;
        padding: 0;
        margin: 0;
    }

    .vn-cta-icon img {
        height: 2.8rem;
        width: 2.8rem;
        /* background-color: white; */
        border-radius: 3px;
        padding: 2px;
        flex-shrink: 0;
    }

    .phone-button .vn-cta-icon img {
        padding: 3px;
    }

    .vn-cta-button:hover {
        transform: none;
        opacity: 0.85;
        transition: opacity 0.2s ease;
    }

    .vn-cta-button:active {
        opacity: 0.7;
    }

    /* Text hiển thị trên mobile */
    .vn-cta-button .vn-cta-text {
        font-size: 15px;
        font-weight: 600;
        white-space: nowrap;
        display: block;
    }

    .vn-cta-button.phone-button a {
        background-color: var(--fs-color-primary);
        color: #fff;
    }

    /* Đảm bảo buttons không bị che bởi mobile browser UI */
    body {
        padding-bottom: 0;
    }

    .vn-cta-buttons-container {
        padding-bottom: env(safe-area-inset-bottom);
    }

    #footer {
        padding-bottom: 4.8rem;
    }

    #footer .back-to-top {
        bottom: 6rem;
    }

}