/* ========================================================
   CYBERPUNK FLOATING CONTACT WIDGET (STICKY, DRAGGABLE, RADIAL SPIN)
   GACE STORE E-COMMERCE DESIGN SYSTEM
   ======================================================== */

:root {
    --fc-orange-glow: rgba(255, 122, 26, 0.45);
    --fc-cyan-glow: rgba(56, 189, 248, 0.4);
    --fc-zalo-color: #0068ff;
    --fc-fb-color: #1877f2;
    --fc-tiktok-color: #000000;
    --fc-hotline-color: #10b981;
    --fc-top-color: #334155;
}

/* 1. KHỐI CONTAINER CHÍNH CỦA WIDGET */
.cyber-floating-widget {
    position: fixed;
    z-index: 1045;
    width: 60px;
    height: 60px;
    user-select: none;
    touch-action: none;
    cursor: grab;
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.cyber-floating-widget.is-dragging {
    cursor: grabbing !important;
    transition: none !important;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.35));
}

.cyber-floating-widget.is-dragging .cyber-floating-radial-menu {
    pointer-events: none !important;
}

/* 2. NÚT CHÍNH TRUNG TÂM (MASTER BUTTON) */
.cyber-floating-master {
    position: absolute;
    top: 0;
    left: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff7a1a 0%, #ea580c 100%);
    box-shadow: 0 8px 24px var(--fc-orange-glow), 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.cyber-floating-master:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(255, 122, 26, 0.6), 0 0 18px rgba(255, 122, 26, 0.4);
}

.cyber-floating-master:active {
    transform: scale(0.95);
}

/* Vòng tròn công nghệ viền xoay liên tục */
.cyber-master-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 122, 26, 0.7);
    pointer-events: none;
    animation: cyberSpinRing 12s linear infinite;
}

@keyframes cyberSpinRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Sóng xung kích Radar Pulse */
.cyber-master-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid #ff7a1a;
    opacity: 0.8;
    pointer-events: none;
    animation: cyberPulseWave 2.4s ease-out infinite;
}

.cyber-master-pulse.delay-1 {
    animation-delay: 1.2s;
}

@keyframes cyberPulseWave {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.7);
        opacity: 0;
    }
}

/* Biểu tượng trung tâm lật xoay (Comments <-> Times) */
.cyber-master-icon-wrap {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    pointer-events: none;
}

.cyber-icon-front,
.cyber-icon-back {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
    pointer-events: none;
}

.cyber-icon-front {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

.cyber-icon-back {
    transform: rotate(-180deg) scale(0.5);
    opacity: 0;
}

/* Trạng thái khi mở Menu xoay vòng */
.cyber-floating-widget.menu-open .cyber-floating-master {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4), 0 0 16px rgba(56, 189, 248, 0.3);
}

.cyber-floating-widget.menu-open .cyber-master-pulse {
    display: none;
}

.cyber-floating-widget.menu-open .cyber-master-ring {
    border-color: #38bdf8;
    animation-duration: 4s;
}

.cyber-floating-widget.menu-open .cyber-icon-front {
    transform: rotate(180deg) scale(0.5);
    opacity: 0;
}

.cyber-floating-widget.menu-open .cyber-icon-back {
    transform: rotate(0deg) scale(1);
    opacity: 1;
    color: #38bdf8;
}

/* 3. NÚT THU NHỎ / ẨN TẠM THỜI */
.cyber-floating-toggle-hide {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #0f172a;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 12;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cyber-floating-toggle-hide:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    transform: scale(1.15);
}

/* 4. MENU VỆ TINH XOAY VÒNG (RADIAL SPEED DIAL) */
.cyber-floating-radial-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 58px;
    height: 58px;
    pointer-events: none !important;
    z-index: 15;
}

.cyber-radial-item {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.2) rotate(-180deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                opacity 0.3s ease, 
                box-shadow 0.2s ease;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
    z-index: 25;
    user-select: none;
    -webkit-user-drag: none;
    cursor: pointer !important;
}

.cyber-radial-item img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 50%;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

.cyber-radial-item i {
    font-size: 18px;
    pointer-events: none;
    user-select: none;
}

/* Định dạng màu sắc & bóng đổ từng nút vệ tinh */
.cyber-item-zalo {
    background: linear-gradient(135deg, #0068ff 0%, #0084ff 100%);
    box-shadow: 0 6px 18px rgba(0, 104, 255, 0.45);
}

.cyber-item-facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0056b3 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(24, 119, 242, 0.45);
}

.cyber-item-tiktok {
    background: #000000;
    border-color: #222;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 242, 254, 0.3);
}

.cyber-item-hotline {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.cyber-item-top {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 6px 18px rgba(71, 85, 105, 0.45);
}

/* Hover các nút vệ tinh: ĐỨNG YÊN VỊ TRÍ TUYỆT ĐỐI, CHỈ PHÓNG TO NHẸ ICON BÊN TRONG */
.cyber-radial-item:hover {
    filter: brightness(1.2);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.cyber-radial-item:hover img,
.cyber-radial-item:hover i {
    transform: scale(1.18);
    transition: transform 0.2s ease;
}

/* Ẩn tooltip dạng text để tránh che khuất các icon tròn khác */
.cyber-radial-tooltip {
    display: none !important;
}

/* 5. HIỆU ỨNG XOAY VÒNG BUNG RA KHI MENU MỞ (OPEN STATE) */
.cyber-floating-widget.menu-open {
    cursor: default !important;
}

.cyber-floating-widget.menu-open .cyber-floating-master {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4), 0 0 16px rgba(56, 189, 248, 0.3);
    z-index: 50 !important;
    cursor: pointer !important;
}

.cyber-floating-widget.menu-open .cyber-floating-radial-menu {
    pointer-events: none !important;
    z-index: 40;
}

.cyber-floating-widget.menu-open .cyber-radial-item {
    opacity: 1;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 45;
}

/* 6. NÚT KHÔI PHỤC KHI ĐÃ THU NHỎ (MINI TAB NÉP MÉP) */
.cyber-floating-restore {
    position: fixed;
    right: 0;
    bottom: 90px;
    background: linear-gradient(135deg, #ff7a1a 0%, #ea580c 100%);
    color: #ffffff;
    padding: 8px 14px 8px 12px;
    border-radius: 20px 0 0 20px;
    box-shadow: -4px 6px 18px var(--fc-orange-glow);
    font-size: 12px;
    font-weight: 700;
    font-family: var(--cyber-font-body, 'Be Vietnam Pro', sans-serif);
    cursor: pointer;
    z-index: 1044;
    display: flex;
    align-items: center;
    transition: all 0.25s ease;
    user-select: none;
}

.cyber-floating-restore:hover {
    padding-left: 18px;
    box-shadow: -6px 8px 24px rgba(255, 122, 26, 0.6);
    transform: translateX(-4px);
}

.cyber-restore-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 20px 0 0 20px;
    border: 2px solid #ff7a1a;
    opacity: 0.7;
    animation: cyberPulseRestore 2s ease-out infinite;
    pointer-events: none;
}

@keyframes cyberPulseRestore {
    0% { transform: scaleX(0.9); opacity: 0.7; }
    100% { transform: scaleX(1.3); opacity: 0; }
}

/* Responsive trên điện thoại & màn hình nhỏ */
@media (max-width: 768px) {
    .cyber-floating-widget {
        width: 48px;
        height: 48px;
    }

    .cyber-floating-master {
        width: 46px;
        height: 46px;
    }

    .cyber-master-icon-wrap {
        width: 20px;
        height: 20px;
        font-size: 18px;
    }

    .cyber-master-ring {
        inset: -3px;
        border-width: 1.5px;
    }

    .cyber-master-pulse {
        inset: -4px;
        border-width: 1.5px;
    }

    .cyber-floating-toggle-hide {
        width: 17px;
        height: 17px;
        font-size: 8px;
        top: -4px;
        right: -4px;
    }

    .cyber-floating-radial-menu {
        width: 46px;
        height: 46px;
    }

    .cyber-radial-item {
        width: 36px;
        height: 36px;
        top: 5px;
        left: 5px;
    }

    .cyber-radial-item img {
        width: 18px;
        height: 18px;
    }

    .cyber-radial-item i {
        font-size: 15px;
    }

    .cyber-radial-tooltip {
        display: none !important; /* Trên màn hình nhỏ ẩn tooltip để tránh choán diện tích */
    }

    .cyber-floating-restore {
        bottom: 75px;
        padding: 6px 12px 6px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .cyber-floating-widget {
        width: 44px;
        height: 44px;
    }

    .cyber-floating-master {
        width: 42px;
        height: 42px;
    }

    .cyber-master-icon-wrap {
        width: 18px;
        height: 18px;
        font-size: 16px;
    }

    .cyber-radial-item {
        width: 34px;
        height: 34px;
        top: 4px;
        left: 4px;
    }

    .cyber-radial-item img {
        width: 16px;
        height: 16px;
    }

    .cyber-radial-item i {
        font-size: 14px;
    }
}
