/**
 * vPlugin Floating Button - Frontend Styles
 * Style 1: Contact button with popup container
 */

/* Main container */
#vplugin-floating-button {
    width: 50px;
    height: 50px;
    position: fixed;
    z-index: 1000;
    /* Position will be set via inline style */
}

/* Contact container (popup) */
.vplugin-contact-container {
    background: #fff;
    box-shadow: 0 0 40px rgba(0,0,0,.2);
    min-width: 320px;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    right: 0;
    bottom: 56px;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    border-radius: 7px;
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    -webkit-transform-origin: 80% 105%;
    -ms-transform-origin: 80% 105%;
    transform-origin: 80% 105%;
    -o-transition: ease-out .2s all;
    transition: ease-out .2s all;
    transform: translateY(20px);
}

.vplugin-contact-container.isButtonShow {
    opacity: 1;
    visibility: visible;
    transition: .4s;
    -ms-transform: scale(1);
    transform: translateY(0);
}

.vplugin-contact-container.onRight {
    left: inherit;
    right: 0;
}

.vplugin-contact-container.onLeft {
    right: inherit;
    left: 0;
}

.vplugin-contact-container:before {
    position: absolute;
    bottom: -7px;
    display: inline-block !important;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    border-left: 8px solid transparent;
    content: "";
}

.vplugin-contact-container.onRight:before {
    left: auto;
    right: 25px;
}

.vplugin-contact-container.onLeft:before {
    right: auto;
    left: 25px;
}

/* Header */
.vplugin-contact-header {
    padding: 17px 15px;
    color: #fff;
    background: #00306f; /* Default color, will be overridden by inline style */
    border-radius: 7px 7px 0 0;
    margin-bottom: 10px;
    font-size: 17px;
    position: relative;
    text-align: center;
    line-height: 1.4;
}

.vplugin-header-title {
    width: 90%;
    text-align: left;
}

.vplugin-contact-header-close {
    position: absolute;
    right: -10px;
    top: 20px;
    padding: 0;
    margin: 0;
    border: 0 none;
    line-height: 1;
    width: 26px;
    height: 26px;
    cursor: pointer;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    transition: .4s;
}

.vplugin-contact-header-close span svg {
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    display: block;
    position: absolute;
}

/* Contact list */
.vplugin-contact-container ul {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.vplugin-contact-container ul li {
    margin: 0;
    padding: 0;
}

.vplugin-contact-item {
    display: flex;
    align-items: center;
    padding: 8px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s;
}

.vplugin-contact-item:hover {
    background-color: #f5f5f5;
}

.vplugin-contact-item:last-child {
    border-bottom: none;
}

.vplugin-contact-icon {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex-shrink: 0;
}

.vplugin-contact-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.vplugin-contact-child {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vplugin-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
   
}

.vplugin-contact-child-title {
    font-size: 15px;
    color: rgb(120, 120, 120);
}

/* Floating button */
.vplugin-contact-button {
    width: 60px;
    height: 60px;
    position: absolute;
    border-radius: 50px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    text-align: center;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    cursor: pointer;
    background-color: #00306f; /* Default color, will be overridden by inline style */
}

.vplugin-contact-button.onRight {
    right: 0;
}

.vplugin-contact-button.onLeft {
    left: 0;
}

.vplugin-button-border {
    width: 84px;
    height: 84px;
    border-radius: 50px;
    position: absolute;
    z-index: -1;
    -webkit-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0);
    -webkit-animation: vplugin-pulse 2s infinite;
    animation: vplugin-pulse 2s infinite;
    background-color: #00306f; /* Default color, will be overridden by inline style */
}

.vplugin-button-border:nth-of-type(2n) {
    -webkit-animation-delay: .5s;
    animation-delay: .5s;
}

.vplugin-button-group-icon {
    position: relative;
    width: 100%;
    height: 100%;
}

.vplugin-button-icon {
    position: absolute;
    top: 18%;
    left: 35%;
    margin: 0 0 0 -2px;
    -webkit-transition: opacity .6s ease-out;
    transition: opacity .6s ease-out;
    -webkit-animation: vpluginRotate 1s;
    animation: vpluginRotate 1s;
}

.vplugin-button-text {
    position: absolute;
    top: 54%;
    left: 24%;
    margin: 0 0 0 -2px;
   
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

.vplugin-close-button-icon {
    color: #fff;
    opacity: 0;
    visibility: visible;
    -webkit-transform: rotate(180deg) scale(0);
    -ms-transform: rotate(180deg) scale(0);
    transform: rotate(180deg) scale(0);
    -webkit-transition: ease-in .12s all;
    -o-transition: ease-in .12s all;
    transition: ease-in .12s all;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(180deg) scale(0);
    cursor: pointer;
}

.vplugin-contact-container.isButtonShow ~ .vplugin-contact-button .vplugin-button-icon,
.vplugin-contact-container.isButtonShow ~ .vplugin-contact-button .vplugin-button-text {
    opacity: 0;
    visibility: hidden;
}

.vplugin-contact-container.isButtonShow ~ .vplugin-contact-button .vplugin-close-button-icon {
    opacity: 1;
    visibility: visible;
    -webkit-transform: translate(-50%, -50%) rotate(0deg) scale(1);
    -ms-transform: translate(-50%, -50%) rotate(0deg) scale(1);
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* Shake animation */
.vplugin-contact-button.vplugin-shake .vplugin-button-icon {
    animation: vpluginIconShake 1s infinite ease-in-out;
    transform-origin: center;
}

@keyframes vpluginIconShake {
    0%   { transform: rotate(0deg); }
    15%  { transform: rotate(-8deg); }
    30%  { transform: rotate(8deg); }
    45%  { transform: rotate(-8deg); }
    60%  { transform: rotate(8deg); }
    75%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Animations */
@keyframes vplugin-pulse {
    0% {
        -webkit-transform: scale(0);
        -ms-transform: scale(0);
        transform: scale(0);
        opacity: 1;
    }
    100% {
        -webkit-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes vpluginRotate {
    0% {
        -webkit-transform: rotate(0deg);
        -ms-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
        -ms-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

/* Style 2: Floating Icons */
.vplugin-style2-icons {
    position: fixed;
    z-index: 1000000;
    visibility: visible;
    opacity: 1;
    /* Position will be set via inline style (left/right only, no bottom) */
    /* Each icon has its own bottom position calculated from the last icon */
}

.vplugin-icon-wrap {
    position: fixed;
    z-index: 1000001;
    display: block;
    width: 48px;
    height: 48px;
    /* Bottom and left/right will be set via inline style */
}

.vplugin-icon-wrap a {
    position: relative;
    z-index: 3;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 0 25px 0 rgba(100, 97, 97, .3);
    display: block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vplugin-icon-wrap a:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Ripple elements (behind icon) - only for hotline icons */
.vplugin-icon-wrap .vplugin-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none; /* không cản click */
    z-index: 1;
    transition: all .5s;
}

.vplugin-icon-wrap .vplugin-ripple-fill {
    width: 60px;
    height: 60px;
    background-color: var(--vplugin-ripple-color, #0068FF);
    opacity: 0.7;
    border: 2px solid transparent;
    animation: vplugin-ripple-fill 2.3s infinite ease-in-out;
}

.vplugin-icon-wrap .vplugin-ripple-ring {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 2px solid var(--vplugin-ripple-color, #0068FF);
    background-color: transparent;
    animation: vplugin-ripple-ring 1.2s infinite ease-in-out;
    opacity: 0.5;
}

/* Shake animation for hotline icons */
.vplugin-icon-wrap a.vplugin-shake-icon {
    animation: vplugin-icon-shake 1s infinite ease-in-out;
    transform-origin: center;
}

/* Ripple animations */
@keyframes vplugin-ripple-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.1;
    }
    50% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.1;
    }
}

@keyframes vplugin-ripple-fill {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.6;
    }
}

@keyframes vplugin-icon-shake {
    0%   { transform: rotate(0deg); }
    15%  { transform: rotate(-8deg); }
    30%  { transform: rotate(8deg); }
    45%  { transform: rotate(-8deg); }
    60%  { transform: rotate(8deg); }
    75%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Responsive */
@media (max-width: 768px) {
    #vplugin-floating-button.vplugin-mobile-left {
        left: var(--vplugin-left-mobile, 15px) !important;
        right: var(--vplugin-right-mobile, auto) !important;
    }
    
    #vplugin-floating-button.vplugin-mobile-right {
        right: var(--vplugin-right-mobile, 15px) !important;
        left: var(--vplugin-left-mobile, auto) !important;
    }
    
    .vplugin-contact-container {
        min-width: 280px;
        max-width: calc(100vw - 80px);
    }
}

