/**
 * 360VR Floating CTA - Frontend Styles
 * Version: 4.0
 * iOS Compatible + CTA Button
 */

:root {
    --t360-main: #234B3F;
    --t360-hover: #3E6B5D;
    --t360-bottom: 80px;
    --t360-icon-pc: 50px;
    --t360-icon-mb: 42px;
    --t360-gap: 12px;
    --t360-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* LEFT SIDEBAR */
.three60vr-left-bar {
    position: fixed;
    left: 20px;
    bottom: var(--t360-bottom);
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.three60vr-left-text {
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    text-decoration: none !important;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: 0.3s;
}

.three60vr-left-text:hover { color: #4CAF50; }

.three60vr-center-logo {
    cursor: pointer;
    perspective: 1000px;
}

.three60vr-center-logo img {
    width: 45px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: spin-vertical 3s linear infinite;
}

@keyframes spin-vertical {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* RIGHT SIDEBAR */
.three60vr-right-bar {
    position: fixed;
    right: 15px;
    bottom: var(--t360-bottom);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--t360-gap);
}

.three60vr-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--t360-icon-pc);
    height: var(--t360-icon-pc);
    background-color: var(--t360-main);
    border-radius: 50%;
    box-shadow: var(--t360-shadow);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 2;
}

.three60vr-btn:hover {
    background-color: var(--t360-hover);
    transform: scale(1.1);
}

.three60vr-btn.active-zalo-mode,
.three60vr-btn.active-zalo-mode:hover {
    background-color: var(--t360-main) !important;
}

.three60vr-btn img {
    width: 50%;
    filter: brightness(0) invert(1);
    transition: transform 0.3s;
}

.three60vr-btn::after {
    content: attr(data-title);
    position: absolute;
    right: 120%;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.three60vr-btn:hover::after {
    opacity: 1;
    right: 110%;
}

.three60vr-btn.btn-top {
    background-color: rgba(35, 75, 63, 0.4);
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s ease;
}

.three60vr-btn.btn-top.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.three60vr-btn.btn-top:hover {
    background-color: var(--t360-main);
    box-shadow: var(--t360-shadow);
}

.three60vr-hidden-group {
    display: flex;
    flex-direction: column;
    gap: var(--t360-gap);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: absolute;
    bottom: 100%;
    margin-bottom: var(--t360-gap);
    z-index: 1;
}

.three60vr-hidden-group.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ANIMATIONS */
.pulse-animation {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(35, 75, 63, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(35, 75, 63, 0); }
    100% { box-shadow: 0 0 0 0 rgba(35, 75, 63, 0); }
}

@keyframes wiggle-interval {
    0% { transform: rotate(0deg); }
    5% { transform: rotate(-12deg); }
    10% { transform: rotate(12deg); }
    15% { transform: rotate(-12deg); }
    20% { transform: rotate(12deg); }
    25% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

.three60vr-btn.active-zalo-mode img {
    animation: wiggle-interval 2.5s ease-in-out infinite;
}

/* MODAL BASE */
.three60vr-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.three60vr-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.three60vr-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: appearZoom 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}

@keyframes appearZoom {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes disappearZoom {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.5); opacity: 0; }
}

.three60vr-modal-box.is-closing {
    animation: disappearZoom 0.5s ease forwards !important;
}

.wr360-popup-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.wr360-popup-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 360VR POPUP (iOS Compatible) */
.three60vr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    -webkit-overflow-scrolling: touch;
}

.wr360-popup-container {
    position: relative;
    width: 90%;
    height: 85%;
    max-width: 1600px;
}

.wr360-popup-active .wr360-popup-container {
    animation: wr360ZoomOutOpen 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    -webkit-animation: wr360ZoomOutOpen 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes wr360ZoomOutOpen {
    0% { opacity: 0; transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

@-webkit-keyframes wr360ZoomOutOpen {
    0% { opacity: 0; -webkit-transform: scale(1.3); }
    100% { opacity: 1; -webkit-transform: scale(1); }
}

.wr360-popup-hidden .wr360-popup-container {
    transform: scale(0.7);
    -webkit-transform: scale(0.7);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.wr360-content-box {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.wr360-content-box iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
    position: absolute;
    top: 0;
    left: 0;
}

.three60vr-close-v6 {
    position: absolute;
    top: -22px;
    right: -22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ff4444;
    border: 2px solid #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    padding: 0;
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s;
}

.three60vr-close-v6:hover {
    background-color: #ff2222;
    transform: rotate(90deg) scale(1.15);
}

.three60vr-close-v6 svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    pointer-events: none;
}

.wr360-logo-spinner {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    perspective: 1000px;
    z-index: 10;
}

.wr360-logo-spinner img {
    width: 50px;
    height: auto;
    animation: rotateY-360 4s linear infinite;
}

@keyframes rotateY-360 {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* NEW TAB BUTTON */
.three60vr-new-tab-btn {
    position: absolute;
    top: 25%;
    right: 0;
    background: #fff;
    color: #333;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    z-index: 95;
    padding: 10px 5px;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: padding-right 0.3s, background 0.3s;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    gap: 6px;
}

.three60vr-new-tab-btn:hover { background: #f5f5f5; }

.three60vr-new-tab-btn span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.three60vr-new-tab-btn svg {
    width: 14px;
    height: 14px;
    fill: #333;
    transform: rotate(90deg);
}

/* FORM POPUP */
.modal-type-compact {
    width: 90%;
    max-width: 480px;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    position: relative;
}

.box-form-content {
    width: 100%;
    padding: 35px 25px 25px;
    overflow-y: auto;
    box-sizing: border-box;
}

.three60vr-close-simple {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #ff4757;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10005;
}

.box-form-content br { display: none !important; }
.box-form-content p { margin: 0 0 1em 0 !important; padding: 0 !important; }

.box-form-content input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.box-form-content textarea {
    display: block;
    width: 100%;
    border-radius: 8px !important;
    border: 1px solid #ddd;
    padding: 10px 15px;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    box-sizing: border-box;
    font-size: 15px;
    line-height: 1.4;
}

.box-form-content input[type="submit"] {
    border-radius: 8px !important;
    width: 100%;
    margin-top: 5px;
    cursor: pointer;
    padding: 12px;
    font-weight: bold;
}

.wpcf7-response-output {
    padding: 15px !important;
    border-radius: 8px;
    font-weight: bold;
    background: #f9f9f9 !important;
    color: #333 !important;
}

.wpcf7 form.sent .wpcf7-response-output {
    color: #155724 !important;
    background-color: #d4edda !important;
}

.wpcf7 form.invalid .wpcf7-response-output {
    color: #721c24 !important;
    background-color: #f8d7da !important;
}

/* PHONE POPUP */
.modal-type-mini {
    width: 90%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.box-phone-content p { margin-bottom: 10px; }

.box-phone-content .phone-display {
    font-size: 28px;
    font-weight: bold;
    color: var(--t360-main);
    margin: 0 0 20px 0;
}

.btn-callback {
    background: var(--t360-main);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
}

.btn-callback:hover {
    background: var(--t360-hover);
    transform: scale(1.05);
}

.three60vr-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #ff4757;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 10005;
    transition: transform 0.3s ease, background 0.3s ease;
}

.three60vr-close:hover {
    background: #ff6b81;
    transform: scale(1.1) rotate(90deg);
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .three60vr-left-bar {
        left: 10px;
        transform: scale(0.85);
        transform-origin: bottom left;
    }
    .three60vr-right-bar { right: 10px; }
    .three60vr-btn {
        width: var(--t360-icon-mb);
        height: var(--t360-icon-mb);
    }
    .three60vr-btn::after { display: none; }
    .wr360-popup-container {
        width: 90%;
        height: 90%;
    }
    .three60vr-close-v6 {
        width: 40px;
        height: 40px;
        top: -15px;
        right: -15px;
    }
    .three60vr-close-v6 svg {
        width: 20px;
        height: 20px;
    }
    .wr360-content-box { border-radius: 15px; }
    .three60vr-new-tab-btn {
        top: 20%;
        padding: 8px 3px;
    }
    .three60vr-new-tab-btn span { font-size: 10px; }
}

/* ══════════════════════════════════════
   CTA FLOATING BUTTON
══════════════════════════════════════ */
.t360-cta-btn {
    display: none;
    position: fixed;
    z-index: 9998;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
    background: var(--t360-main);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(35,75,63,.45);
    transition: transform .18s, box-shadow .18s;
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: .01em;
    animation: t360CTAPulse 2.5s ease-in-out infinite;
}

@keyframes t360CTAPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(35,75,63,.45); }
    50%       { box-shadow: 0 4px 28px rgba(35,75,63,.7); }
}

.t360-cta-btn.visible  { display: flex; }
.t360-cta-btn:hover    { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(35,75,63,.55); }
.t360-cta-btn:active   { transform: translateY(0); }

@media (max-width: 768px) {
    .t360-cta-btn { font-size: 14px; padding: 11px 18px; }
}
@media (max-width: 420px) {
    .t360-cta-btn span { display: none; }
    .t360-cta-btn { padding: 13px; border-radius: 50%; }
}
