/**
 * ==========================================================================
 * CỤM 3 NÚT LIÊN HỆ NỔI (MESSENGER - GỌI ĐIỆN - ZALO)
 * CHUẨN GIAO DIỆN SQUIRCLE ĐỒNG BỘ WEBSITE BẢO TRƯỜNG
 * ==========================================================================
 */

/* Container định vị góc dưới bên trái */
.pd-contact-floating {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

/* Base style cho từng nút hình khối Squircle */
.pd-float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    text-decoration: none !important;
    position: relative;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.pd-float-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.28);
}

.pd-float-btn:active {
    transform: translateY(0) scale(0.96);
}

/* Khung chứa icon bên trong */
.pd-float-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    overflow: hidden;
    z-index: 2;
}

/* ==========================================
   1. NÚT MESSENGER (XANH DƯƠNG FACEBOOK)
   ========================================== */
.pd-float-messenger {
    background: #0084ff;
    background: linear-gradient(135deg, #0099ff 0%, #0078ff 100%);
    color: #ffffff;
}

.pd-float-svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* ==========================================
   2. NÚT GỌI ĐIỆN / HOTLINE (XANH LÁ RỰC RỠ)
   ========================================== */
.pd-float-phone {
    background: #00c853;
    background: linear-gradient(135deg, #00d060 0%, #00b14f 100%);
    color: #ffffff;
}

.pd-float-phone i {
    font-size: 24px;
    color: #ffffff;
    animation: pd-phone-wiggle 1.8s infinite ease-in-out;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* Sóng rung lan tỏa cho nút gọi điện */
.pd-float-ring {
    position: absolute;
    inset: -3px;
    border-radius: 17px;
    border: 2px solid #00d060;
    animation: pd-phone-ring-wave 2s infinite ease-out;
    pointer-events: none;
    z-index: 0;
}

.pd-float-ring-delay {
    animation-delay: 0.65s;
}

/* ==========================================
   3. NÚT ZALO (XANH ZALO AUTHENTIC)
   ========================================== */
.pd-float-zalo {
    background: #0068ff;
    background: linear-gradient(135deg, #0084ff 0%, #0068ff 100%);
}

.pd-float-zalo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    transition: transform 0.25s ease;
}

.pd-float-btn:hover .pd-float-zalo-img {
    transform: scale(1.05);
}

/* ==========================================
   TOOLTIP FLYOUT THÔNG MINH KHI HOVER
   ========================================== */
.pd-float-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    background: rgba(30, 16, 11, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    font-family: var(--font-body, system-ui, -apple-system, sans-serif);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pd-float-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent rgba(30, 16, 11, 0.95) transparent transparent;
}

.pd-float-btn:hover .pd-float-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */
@keyframes pd-phone-wiggle {
    0%   { transform: rotate(0); }
    8%   { transform: rotate(-16deg); }
    16%  { transform: rotate(16deg); }
    24%  { transform: rotate(-12deg); }
    32%  { transform: rotate(12deg); }
    40%  { transform: rotate(-6deg); }
    48%  { transform: rotate(6deg); }
    56%  { transform: rotate(0); }
    100% { transform: rotate(0); }
}

@keyframes pd-phone-ring-wave {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    60% {
        transform: scale(1.4);
        opacity: 0.15;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ==========================================
   RESPONSIVE CHO THIẾT BỊ DI ĐỘNG (MOBILE)
   ========================================== */
@media (max-width: 640px) {
    .pd-contact-floating {
        bottom: 18px;
        left: 16px;
        gap: 10px;
    }

    .pd-float-btn {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .pd-float-icon {
        border-radius: 12px;
    }

    .pd-float-zalo-img {
        border-radius: 12px;
    }

    .pd-float-svg {
        width: 25px;
        height: 25px;
    }

    .pd-float-phone i {
        font-size: 22px;
    }

    .pd-float-ring {
        border-radius: 15px;
    }

    /* Ẩn tooltip trên mobile để tránh che nội dung */
    .pd-float-tooltip {
        display: none;
    }
}
