/**
 * Nút liên hệ trôi nổi (Floating Contact Button)
 * Yêu cầu: HTML/CSS thuần, không thư viện, CSS3 (blur, gradient, boder-radius sâu)
 */

/* --- CSS for Floating Contact Button VDW --- */
.fcv-contact-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000000;
    /* Cao nhất web */
}

/* Background Overlay làm mờ xung quanh */
.fcv-overlay-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    pointer-events: none;
    /* Không chặn click khi đang ẩn */
}

.fcv-contact-widget.is-open .fcv-overlay-bg {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Lúc hiện mới chặn click vào nền */
}

/* FAB chính (Nút tròn) */
.fcv-fab-main {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    /* Đảm bảo nổi trên tất cả */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* === Floating Action Button (FAB) === */
.fcv-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    /* Gradient xanh dương tới xanh nhạt */
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
    outline: none;
    cursor: pointer;
    /* Đổ bóng lớn và mềm */
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
    /* Luôn nổi trên overlay */
    padding: 0;
    margin: 0 !important;
}

/* Hiệu ứng hover cho nút gốc */
.fcv-fab:hover {
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.5);
    transform: translateY(-2px);
}

/* Hiệu ứng nhấn active */
.fcv-fab:active {
    transform: scale(0.9);
}

/* Style cho các icon FA để switch mượt */
.fcv-icon {
    position: absolute;
    color: #ffffff;
    font-size: 24px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: absolute;
    color: #ffffff;
    font-size: 24px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon close mặc định ẩn & xoay nhẹ */
.fcv-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* Icon chat mặc định hiển thị */
.fcv-icon-chat {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* === Khi ở trạng thái MỞ (.is-open) === */
.fcv-contact-widget.is-open .fcv-fab {
    /* Nút đổi màu nhạt hơn */
    background: linear-gradient(135deg, #60a5fa, #93c5fd);
    box-shadow: 0 8px 15px rgba(96, 165, 250, 0.3);
}

.fcv-contact-widget.is-open .fcv-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

.fcv-contact-widget.is-open .fcv-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* === Lớp Overlay Menu === */
.fcv-overlay-menu {
    position: absolute;
    bottom: 80px;
    /* Cách nút FAB lên trên */
    right: 0;
    width: 280px;
    max-width: calc(100vw - 48px);
    /* Responsive di động (không vuợt quá full mh) */

    /* Hiệu ứng nền trong suốt và kính mờ (glassmorphism) */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    /* Góc bo sâu cực lớn */
    border-radius: 25px;
    padding: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);

    /* Ẩn ban đầu */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    /* Nằm TRÊN overlay-bg (z-index: 1) */
}

/* Mở overlay menu với Slide-up và Fade-in */
.fcv-contact-widget.is-open .fcv-overlay-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    /* Gắn animation keyframe mượt */
    animation: fcv-fade-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Keyframes cho xuất hiện từ dưới lên */
@keyframes fcv-fade-slide-up {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Tiêu đề & phụ đề */
.fcv-menu-header {
    text-align: center;
    margin-bottom: 20px;
}

.fcv-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.fcv-subtitle {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.1em;
    /* Giãn cách chữ lớn */
    text-transform: uppercase;
    display: block;
}

/* Danh sách mạng xã hội / Liên hệ */
.fcv-contact-list {
    display: flex;
    flex-direction: column;
	gap: 15px;
}

/* Từng box mục */
.fcv-contact-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: rgba(243, 244, 246, 0.6);
    /* Nhạt trong */
    border-radius: 99px;
    /* Tròn sâu */
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Hover từng dòng sẽ đẩy qua phải nhẹ */
.fcv-contact-item:hover {
    background: rgba(229, 231, 235, 1);
    transform: translateX(5px);
    /* Hiệu ứng điệu đà */
    text-decoration: none;
}

/* Icon / Hình ảnh Social */
.fcv-contact-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: contain;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Nếu box item không có icon sẽ hiển thị tròn màu xám thay thế */
.fcv-no-icon {
    background: #d1d5db;
    display: inline-block;
}

/* Text Social Bên Phải */
.fcv-contact-text {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

@media (max-width: 480px) {

    /* Responsive chuẩn chỉ đt  */
    .fcv-overlay-menu {
        width: 100%;
        min-width: 250px;
        padding: 15px;
    }
}