/* -------------------------------------------------------------------------- */
/* LP Easy Support Widget Styles                                              */
/* -------------------------------------------------------------------------- */

/* Biến CSS cục bộ (được set từ PHP) */
/* --les-main-bg-color: #3498db; */
/* --les-main-icon: url('...'); */

#lp-easy-support-wrapper {
    position: fixed;
    z-index: 9999;
    font-family: Arial, sans-serif;
    transition: all 0.3s ease;
}

/* ---------------------------------- */
/* 1. Nút chính Toggle */
/* ---------------------------------- */
.les-main-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--les-main-bg-color, #3498db);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.les-main-toggle:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.les-icon {
    display: block;
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Icon Mở (Icon Chính) */
.les-icon-open {
    background-image: var(--les-main-icon);
}

/* Icon Đóng (dấu X) */
.les-icon-close {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="white" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
    opacity: 0;
    transform: rotate(-90deg);
    position: absolute;
}

/* Trạng thái mở (Expanded) */
.les-wrapper:not(.les-collapsed) .les-icon-open {
    opacity: 0;
    transform: rotate(90deg);
}

.les-wrapper:not(.les-collapsed) .les-icon-close {
    opacity: 1;
    transform: rotate(0deg);
}

/* ---------------------------------- */
/* 2. Danh sách Kênh Liên Hệ */
/* ---------------------------------- */
.les-content-list {
    position: absolute;
    padding: 10px 0;
    list-style: none;
    margin: 0;
    z-index: 5;
    pointer-events: none; /* Mặc định vô hiệu hóa khi đóng */
}

/* Hiển thị khi không collapsed */
.les-wrapper:not(.les-collapsed) .les-content-list {
    pointer-events: auto;
}

/* ---------------------------------- */
/* 3. Item Kênh Liên Hệ */
/* ---------------------------------- */
.les-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
    padding: 5px 10px;
    color: #333;
    opacity: 0; /* Mặc định ẩn */
    transform: scale(0.8) translate(0);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
    width: max-content;
    max-width: 250px;
}

.les-item:hover {
    background-color: #f0f0f0;
    color: var(--les-main-bg-color, #3498db);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.les-item-icon {
    width: 50px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent; /* Icon được set từ PHP */
}

.les-item-label {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hiệu ứng khi Mở (Expanded) */
.les-wrapper:not(.les-collapsed) .les-item {
    opacity: 1;
    transform: scale(1) translate(0);
    /* Dùng JS để delay từng item */
}


/* ---------------------------------- */
/* 4. Vị Trí Cụ Thể */
/* ---------------------------------- */

/* Bottom-Right (Mặc định) */
.les-pos-br {
    align-items: flex-end; /* căn dọc */
}
.les-pos-br .les-content-list {
    bottom: 0;
    right: 70px; /* Cách nút chính 10px */
}
.les-pos-br .les-item {
    transform-origin: 100% 100%;
}

/* Bottom-Left */
.les-pos-bl {
    align-items: flex-end;
}
.les-pos-bl .les-content-list {
    bottom: 0;
    left: 70px;
}
.les-pos-bl .les-item {
    flex-direction: row-reverse; /* Đảo ngược để label nằm bên phải icon */
    transform-origin: 0% 100%;
    text-align: right;
    padding: 5px 10px;
}
.les-pos-bl .les-item-icon {
    margin-right: 0;
    margin-left: 10px;
}

/* Middle-Right */
.les-pos-mr .les-content-list {
    top: 50%;
    right: 70px;
    transform: translateY(-50%);
}
.les-pos-mr .les-item {
    transform-origin: 100% 50%;
}

/* Middle-Left */
.les-pos-ml .les-content-list {
    top: 50%;
    left: 70px;
    transform: translateY(-50%);
}
.les-pos-ml .les-item {
    flex-direction: row-reverse;
    transform-origin: 0% 50%;
    text-align: right;
    padding: 5px 10px;
}
.les-pos-ml .les-item-icon {
    margin-right: 0;
    margin-left: 10px;
}

/* ---------------------------------- */
/* 5. Responsive cho Mobile */
/* ---------------------------------- */
@media (max-width: 768px) {
    .les-main-toggle {
        width: 50px;
        height: 50px;
    }

    .les-item {
        max-width: 220px;
        padding: 5px;
    }

    .les-item-icon {
        width: 40px;
        height: 30px;
    }

    /* Điều chỉnh vị trí list để tránh bị đè lên */
    .les-pos-br .les-content-list { right: 60px; }
    .les-pos-bl .les-content-list { left: 60px; }
}
