﻿.multi-phone .rz-text-body1 {
    font-size: 0.825rem !important
}

.multi-phone .rz-slider {
    width: 180px;
    transform: scale(0.8);
    transform-origin: left center; /* co lại từ bên trái */
}

.multi-phone .rz-slider-handle {
    background-color: var(--rz-warning) !important;
}

.multi-phone .rz-slider-range {
    background-color: var(--rz-warning) !important;
}



.multi-phone {
    display: flex; /* hoặc grid cũng được */
    flex-wrap: wrap; /* để xuống dòng nếu nhiều */
    gap: 3px; /* khoảng cách luôn đúng 3px */
}

    .multi-phone .phone-mini {
        border: 7px solid #808080;
        display: inline-block;
        width: fit-content;
        height: fit-content;
        border-radius: 12px;
        vertical-align: top;
        margin: 3px;
        zoom: 0.5; /* phóng to/thu nhỏ thật sự */
    }

        .multi-phone .phone-mini canvas {
            display: block;
            border-radius: 6px;
        }

/* khay icon đè lên canvas, không chiếm layout */
.phone-mini {
    position: relative; /* làm mốc */
    display: inline-block;
    border: 4px solid #808080;
    border-radius: 12px;
    width: fit-content;
    height: fit-content;
    overflow: hidden; /* để icon không lòi ra ngoài */
}

    .phone-mini .phone-info {
        position: absolute;
        top: 5%; /* thay 50% bằng 20% để kéo chữ lên trên */
        left: 50%;
        transform: translateX(-50%); /* chỉ căn ngang, không căn dọc nữa */
        pointer-events: none;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }


        .phone-mini .phone-info span {
            font-size: 1.8rem;
            font-weight: bold;
            text-align:center;
            display: block;
            color: white;
            text-shadow: 0 0 5px black, 0 0 10px black;
            opacity: 0.7; /* giảm độ mờ */
        }



.phone-actions {
    position: absolute;
    top: 4px; /* trừ đi border (4px) để icon nằm đúng trong */
    right: 4px; /* sát mép trong border */
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 999999;
    pointer-events: none;
}


    /* icon có thể nhận click; hiệu ứng trượt từ phải qua trái */
.phone-actions .icon {
    pointer-events: auto;
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 600;
    transform: translateX(12px); /* nằm lệch sang phải lúc ẩn */
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease, background .15s;
}

        .phone-actions .icon:hover {
            background: rgba(0,0,0,0.85);
        }

/* hover vùng phone-mini -> icon trượt ra trên mặt canvas */
.phone-mini:hover .phone-actions .icon {
    transform: translateX(0);
    opacity: 1;
}

/* (tuỳ chọn) so le chút cho icon thứ 2 */
.phone-actions .icon:nth-child(2) {
    transition-delay: .03s;
}

/* Xử lý menu gọn lại */

/* Xử lý menu gọn lại */
/* ====== DIALOG ====== */

#phone-control-dialog {
    position: fixed; /* Bắt buộc phải absolute để di chuyển */
    top: 100px;
    left: 100px;
    width: auto;
    background: transparent;
    color: white;
    border-radius: 6px;
    display: none;
    flex-direction: row; /* nằm ngang */
    align-items: stretch; /* hai khối cao bằng nhau */
    gap: 12px;
    z-index: 9999;
}

.phone-control-mini {
    flex: 0 0 auto; /* không chiếm thêm chiều ngang */
    display: inline-block;
}




.control-menu {
    width: 220px;
    display: flex;
    flex-direction: column; /* sắp xếp theo chiều dọc */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    flex: 1; /* phần menu giãn ra hết */
}

    /* nội dung menu (phần trên) */
    .control-menu ul {
        margin: 0;
        padding: 12px;
        list-style: none;
        flex: 1; /* chiếm hết không gian còn lại */
    }

.control-menu-header {
    display: flex; /* sắp xếp ngang */
    align-items: center; /* căn giữa theo trục dọc */
    justify-content: space-between; /* đẩy 2 bên ra */
    gap: 8px; /* khoảng cách giữa các phần tử */
    padding: 6px 10px;
    border-radius: 6px 6px 0 0;
}

.control-menu-body {
    overflow: auto; /* hoặc */
    display: flow-root;
}
/* Giảm font chữ và padding chung */
.control-menu-body .rz-navigation-item-text {
    font-family: "Nunito", sans-serif !important;
    font-size: 0.775rem !important; /* nhỏ chữ */
}

.control-menu-body .rz-navigation-item-wrapper {
    display: flex; /* sắp xếp ngang */
    align-items: center; /* căn giữa theo chiều dọc */
    padding: 2px 6px;
    height: 35px !important; /* chiều cao thấp hơn */
    line-height: 1; /* tránh text bị giãn dòng */
}
/* Chỉnh icon nhỏ lại */
.control-menu-body .rz-navigation-item-icon {
    font-size: 1.025rem !important; /* mặc định ~20px, giảm còn 16 */
    margin-right: 4px !important; /* giảm khoảng cách giữa icon và text */
}

.control-menu-body .rz-navigation-item-link {
    display: flex;
    align-items: center; /* căn giữa icon + text + icon-children */
    justify-content: space-between; /* đẩy icon-children ra mép phải */
    width: 100%; /* choán hết chiều ngang */
}

.control-menu-body .rz-navigation-item-text {
    margin: 0 6px; /* khoảng cách giữa icon và chữ */
}

.control-menu-body .rz-navigation-item-icon-children {
    margin-left: auto !important; /* phòng khi Radzen set margin inline */
    font-size: 14px; /* có thể giảm size cho gọn */
}


/* Chữ trong menu */
.control-menu-body .rz-panel-menu .rz-panel-menu-text {
    font-size: 0.825rem !important;
    line-height: 1.2;
}
/* footer */
.phone-control-menu-footer {
    display: flex;
    justify-content: space-around;
    padding: 6px;
    border-top: 1px solid #eee;
    margin-top: auto; /* đẩy footer xuống đáy */
}


/* Hiển thị vùng chọn màu xanh */
#selection-box {
    position: absolute;
    border: 2px groove #0b84ff;
    background-color: rgba(11, 132, 255, 0.2);
    pointer-events: none;
    display: none;
    z-index: 9999;
    border-radius: 4px;
    transition: all 0.1s ease;
}

.phone-mini.selected {
    border: 7px solid #0b3cff !important;
}


.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--rz-base-500);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.video-loader {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 6rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

    .video-loader:before,
    .video-loader:after {
        content: "";
        position: absolute;
        border-radius: 50%;
        animation: pulsOut 1.8s ease-in-out infinite;
        filter: drop-shadow(0 0 1rem rgba(255, 255, 255, 0.75));
    }

    .video-loader:before {
        width: 100%;
        padding-bottom: 100%;
        box-shadow: inset 0 0 0 1rem #fff;
        animation-name: pulsIn;
    }

    .video-loader:after {
        width: calc(100% - 2rem);
        padding-bottom: calc(100% - 2rem);
        box-shadow: 0 0 0 0 #fff;
    }

@keyframes pulsIn {
    0% {
        box-shadow: inset 0 0 0 1rem #fff;
        opacity: 1;
    }

    50%, 100% {
        box-shadow: inset 0 0 0 0 #fff;
        opacity: 0;
    }
}

@keyframes pulsOut {
    0%, 50% {
        box-shadow: 0 0 0 0 #fff;
        opacity: 0;
    }

    100% {
        box-shadow: 0 0 0 1rem #fff;
        opacity: 1;
    }
}



#phone-action-dialog {
    position: absolute;
    top: 120px;
    left: 120px;
    min-width: 550px;
    min-height: 350px;
    background: var(--rz-base);
    border: 1px solid #888;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: none; /* ẩn mặc định */
    flex-direction: column;
    z-index: 999999;
}

.phone-action-header {
    padding: 6px;
    background: var(--rz-warning-darker);
    color: #fff;
    cursor: move;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    user-select: none;
}
.phone-input-text {
    position: absolute;
    display: flex;
    justify-content: space-around;
    align-items: center;
    bottom: 35px;
    padding: 4px 6px;
    border-top: 1px solid #ccc;
    background: #fff;
    height: 40px; /* chiều cao vừa đủ */
    box-sizing: border-box;
    border-bottom: 1px solid #eee;

}
.phone-action-close {
    float: right;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.phone-action-body {
    flex: 1;
    padding: 10px;
    overflow: auto;
}