/* ==========================================================================
   FRONTEND STYLING - PREMIUM FLOATING HOTLINE BAR
   ========================================================================== */

/* Trình chứa nút lơ lửng */
.phb-container {
    position: fixed;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 999999; /* Luôn nổi trên mọi lớp */
}

/* Căn chỉnh vị trí */
.phb-container.position-right {
    right: 25px;
}
.phb-container.position-left {
    left: 25px;
}

/* Nút liên hệ chung */
.phb-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none !important;
    outline: none;
    border: none;
    cursor: pointer;
}

/* Icon svg bên trong nút */
.phb-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ffffff;
}
.phb-icon-wrap svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
    transition: transform 0.3s ease;
}
.phb-icon-wrap.custom-icon {
    font-size: 24px;
    font-style: normal;
}

/* Hiệu ứng hover cho nút */
.phb-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}
.phb-btn:hover .phb-icon-wrap svg {
    transform: rotate(10deg) scale(1.05);
}

/* --- Màu Sắc Gradients Từng Nút --- */

/* 1. Nút Gọi ngay (Lime-Green Gradient) */
.phb-btn.btn-call {
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    color: #ffffff;
}

/* 2. Nút Zalo (Zalo Blue Gradient) */
.phb-btn.btn-zalo {
    background: linear-gradient(135deg, #25a2e0 0%, #0168fa 100%);
    color: #ffffff;
}

/* 3. Nút Messenger (Messenger Cyan Gradient) */
.phb-btn.btn-messenger {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    color: #ffffff;
}

/* Nút liên hệ tùy biến mặc định */
.phb-btn.btn-custom {
    color: #ffffff;
}

/* --- Chú Thích Trượt (Slide-in Tooltips) --- */
.phb-tooltip {
    position: absolute;
    background: rgba(30, 51, 4, 0.95);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 100;
    border: 1px solid rgba(197, 160, 89, 0.3);
}

/* Căn chỉnh tooltip bên trái cho nút góc phải */
.phb-container.position-right .phb-tooltip {
    right: 70px;
    transform: translateX(12px);
}
.phb-container.position-right .phb-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border-width: 5px 0 5px 5px;
    border-color: transparent transparent transparent rgba(30, 51, 4, 0.95);
    border-style: solid;
}

/* Căn chỉnh tooltip bên phải cho nút góc trái */
.phb-container.position-left .phb-tooltip {
    left: 70px;
    transform: translateX(-12px);
}
.phb-container.position-left .phb-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    border-width: 5px 5px 5px 0;
    border-color: transparent rgba(30, 51, 4, 0.95) transparent transparent;
    border-style: solid;
}

/* Kích hoạt hiển thị tooltip khi hover */
.phb-btn:hover .phb-tooltip {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}


/* --- Hiệu Ứng Nhịp Đập Toả Sáng (Pulsing Effect) --- */
.phb-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid #56ab2f;
    animation: phb-pulse-ring 2.2s infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes phb-pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.85;
        box-shadow: 0 0 0 0 rgba(86, 171, 47, 0.6);
    }
    70% {
        transform: scale(1.25);
        opacity: 0;
        box-shadow: 0 0 0 18px rgba(86, 171, 47, 0);
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
        box-shadow: 0 0 0 0 rgba(86, 171, 47, 0);
    }
}


/* --- Hiển Thị Trên Thiết Bị Di Động (Mobile Optimizations) --- */
@media (max-width: 549px) {
    .phb-container {
        bottom: 20px;
    }
    .phb-container.position-right {
        right: 15px;
    }
    .phb-container.position-left {
        left: 15px;
    }
    .phb-btn {
        width: 48px;
        height: 48px;
    }
    .phb-icon-wrap svg {
        width: 22px;
        height: 22px;
    }
    .phb-icon-wrap.custom-icon {
        font-size: 20px;
    }
    /* Ẩn bớt tooltip trên điện thoại để tránh tràn màn hình */
    .phb-tooltip {
        display: none !important;
    }
}
