﻿/* ============================================================================
 * PHONE CONTROL CSS - Updated with new naming convention
 * ============================================================================ */

/* ============================================================================
 * MULTI-PHONE LAYOUT
 * ============================================================================ */

/*.multi-phone .rz-text-body1 {
    font-size: 0.825rem !important
}

.multi-phone .rz-slider {
    width: 180px;
    transform: scale(0.8);
    transform-origin: left center;
}

.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;
    flex-wrap: wrap;
    gap: 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;
    }*/



/* ============================================================================
 * PHONE MINI (Giữ nguyên tên)
 * ============================================================================ */

.phone-mini {
    position: relative;
    display: inline-block;
    border: 4px solid #808080;
    border-radius: 12px;
    width: fit-content;
    height: fit-content;
    overflow: hidden;
    margin: 6px;
}
    .phone-mini canvas {
        display: block;
        border-radius: 6px;
    }
    /* ============================================================================
 * PHONE INFO (NEW: .info-phone-details)
 * ============================================================================ */

    .phone-mini .info-phone-details {
        position: absolute;
        top: 5%;
        left: 50%;
        transform: translateX(-50%);
        pointer-events: none;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

        .phone-mini .info-phone-details 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;
        }

/* ============================================================================
 * PHONE ACTIONS (NEW: .section-phone-actions)
 * ============================================================================ */

.section-phone-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 999999;
    pointer-events: none;
}

    .section-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);
        opacity: 0;
        transition: transform .2s ease, opacity .2s ease, background .15s;
    }

        .section-phone-actions .icon:hover {
            background: rgba(0,0,0,0.85);
        }

.phone-mini:hover .section-phone-actions .icon {
    transform: translateX(0);
    opacity: 1;
}

.section-phone-actions .icon:nth-child(2) {
    transition-delay: .03s;
}

/* ============================================================================
 * CONTROL DIALOG (NEW: #dialog-phone-control)
 * ============================================================================ */

#dialog-phone-control {
    position: fixed;
    top: 100px;
    left: 100px;
    width: auto;
    background: transparent;
    color: white;
    border-radius: 6px;
    display: none;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    z-index: 9999;
}

/* ============================================================================
 * CONTROL MINI CONTAINER (NEW: .container-phone-control)
 * ============================================================================ */


/* ============================================================================
 * CONTROL MENU
 * ============================================================================ */



    .control-menu ul {
        margin: 0;
        padding: 12px;
        list-style: none;
        flex: 1;
    }
.cm-menu-content {
    flex: 1 1 auto;
    overflow-y: auto;
}
.cm-nav-bar {
    flex-shrink: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.08);
}
.rz-material-dark .cm-nav-bar {
    background: var(--rz-base-900);
    color: var(--rz-white);
}

.rz-material-dark .cm-nav-btn {
    background: var(--rz-base-900);
    color: var(--rz-white);
}
.cm-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    transition: background 0.2s ease, transform 0.15s ease;
}

    .cm-nav-btn:hover {
        background: rgba(0,0,0,0.08);
    }

    .cm-nav-btn:active {
        transform: scale(0.9);
    }

/* ============================================================================
 * CONTROL MENU HEADER (NEW: .header-control-menu)
 * ============================================================================ */

.header-control-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px 6px 0 0;
   
}

/* ============================================================================
 * CONTROL MENU BODY
 * ============================================================================ */

.control-menu-body {
    overflow: auto;
    display: flow-root;
}

    .control-menu-body .rz-navigation-item-text {
        font-family: "Nunito", sans-serif !important;
        font-size: 0.775rem !important;
    }

    .control-menu-body .rz-navigation-item-wrapper {
        display: flex;
        align-items: center;
        padding: 2px 6px;
        height: 35px !important;
        line-height: 1;
    }

    .control-menu-body .rz-navigation-item-icon {
        font-size: 1.025rem !important;
        margin-right: 4px !important;
    }

    .control-menu-body .rz-navigation-item-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .control-menu-body .rz-navigation-item-text {
        margin: 0 6px;
    }

    .control-menu-body .rz-navigation-item-icon-children {
        margin-left: auto !important;
        font-size: 14px;
    }

    .control-menu-body .rz-panel-menu .rz-panel-menu-text {
        font-size: 0.825rem !important;
        line-height: 1.2;
    }

/* ============================================================================
 * CONTROL MENU FOOTER
 * ============================================================================ */

.phone-control-menu-footer {
    display: flex;
    justify-content: space-around;
    padding: 6px;
    border-top: 1px solid #eee;
    margin-top: auto;
}

/* ============================================================================
 * SELECTION BOX (Giữ nguyên tên)
 * ============================================================================ */

#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
 * ============================================================================ */

.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;
    }
}

/* ============================================================================
 * ACTION DIALOG (NEW: #dialog-phone-action)
 * ============================================================================ */

#dialog-phone-action {
    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;
    flex-direction: column;
    z-index: 999999;
}

/* ============================================================================
 * ACTION DIALOG HEADER (NEW: .header-action-menu)
 * ============================================================================ */

.header-action-menu {
    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
 * ============================================================================ */

.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;
    box-sizing: border-box;
    border-bottom: 1px solid #eee;
}

/* ============================================================================
 * ACTION DIALOG CLOSE BUTTON (NEW: .btn-close-action)
 * ============================================================================ */

.btn-close-action {
    float: right;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

/* ============================================================================
 * ACTION DIALOG BODY
 * ============================================================================ */

.phone-action-body {
    flex: 1;
    padding: 10px;
    overflow: auto;
}

/* ============================================================================
 * ICON SPECIFIC STYLES (NEW: icon-expand, icon-get-id, icon-reload)
 * Để dễ customize từng icon nếu cần
 * ============================================================================ */

.icon-expand {
    /* Custom styles for expand icon if needed */
}

.icon-get-id {
    /* Custom styles for get-id icon if needed */
}

.icon-reload {
    /* Custom styles for reload icon if needed */
}

.btn-close-control {
    /* Custom styles for close control button if needed */
}


/* ==============================================
                   MAIN WRAPPER - Flex Container
                   ============================================== */
.phone-control-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch; /* Đảm bảo cả 2 con có cùng height */
    width: 100%;
    height: auto;
    min-height: 0;
}

/* ==============================================
                   CONTAINER PHONE CONTROL - Auto fit content
                   ============================================== */
.container-phone-control {
    flex: 1; /* Chiếm phần còn lại */
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: auto; /* Tự động theo nội dung */
}

/* Phone mini - Chiếm full height của container */
.phone-mini {
    flex: 1;
}

/* ==============================================
                   CONTROL MENU - Match height với phone-mini
                   ============================================== */
.control-menu {
    flex: 0 0 220px; /* Cố định width 240px */
    width: 220px;
    display: flex;
    flex-direction: column;
    background: var(--rz-white);
    border-radius: 16px;
    border: 5px solid var(--rz-base-600);
    overflow: hidden;
    padding: 8px;
    height: auto; /* Tự động match với phone-mini nhờ align-items: stretch */
    min-height: 0;
}
.rz-material-dark .control-menu {
    background: var(--rz-base-900);
    border: 4px solid var(--rz-base-300);
}
/* Menu Header */
.cm-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 8px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--rz-border-color, #e5e7eb);
    margin-bottom: 4px;
}

.cm-header-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--rz-primary, #4f46e5);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cm-header-close {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

    .cm-header-close:hover {
        background: var(--rz-danger-lighter, rgba(239, 68, 68, 0.1));
    }

    .cm-header-close:active {
        background: var(--rz-danger-lighter, rgba(239, 68, 68, 0.2));
        transform: scale(0.95);
    }

    .cm-header-close .rzi {
        font-size: 18px;
        color: var(--rz-text-secondary-color, #6b7280);
        transition: color 0.2s;
    }

    .cm-header-close:hover .rzi {
        color: var(--rz-danger, #ef4444);
    }

/* Menu Item Base */
.cm-menu-item {
    position: relative;
    width: 100%;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding: 0 12px;
    margin: 2px 0;
    background: transparent;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    outline: none;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    flex-shrink: 0;
}

    .cm-menu-item:hover {
        background: var(--rz-primary-lighter, rgba(79, 70, 229, 0.08));
    }

    .cm-menu-item:active {
        background: var(--rz-primary-lighter, rgba(79, 70, 229, 0.15));
        transform: scale(0.98);
    }

    .cm-menu-item .rzi {
        font-size: 18px;
        color: var(--rz-text-secondary-color, #6b7280);
        flex-shrink: 0;
        transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .cm-menu-item:hover .rzi {
        color: var(--rz-primary, #4f46e5);
    }

.cm-item-label {
    flex: 1;
    font-size: var(--size-1);
    font-weight: 400;
    letter-spacing: 0.2px;
    line-height: 1.3;
    color: var(--rz-text-color, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown Container */
.cm-dropdown {
    position: relative;
    width: 100%;
    flex-shrink: 0;
}

.cm-arrow {
    font-size: 16px;
    margin-left: auto;
    color: var(--rz-text-secondary-color, #6b7280);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cm-dropdown.open .cm-arrow {
    transform: rotate(90deg);
    color: var(--rz-primary, #4f46e5);
}

.cm-menu-item:hover .cm-arrow {
    color: var(--rz-primary, #4f46e5);
}

/* Dropdown Menu */
.cm-dropdown-menu {
    position: fixed;
    min-width: 200px;
    background: var(--rz-white, #ffffff);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-12px) translateY(-4px) scale(0.92);
    transform-origin: left center;
    transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.3s;
    z-index: 9999;
    will-change: transform, opacity;
}

.cm-dropdown-arrow {
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--rz-white, #ffffff);
    opacity: 0;
    transform: translateX(-4px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(-2px 0 4px rgba(0, 0, 0, 0.08));
}

.cm-dropdown.open .cm-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) translateY(0) scale(1);
}

.cm-dropdown.open .cm-dropdown-arrow {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Dropdown Item */
.cm-dropdown-item {
    position: relative;
    width: 100%;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding: 0 12px;
    margin: 2px 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: var(--size-1);
    letter-spacing: 0.2px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    outline: none;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(-4px);
}

.cm-dropdown.open .cm-dropdown-item {
    animation: cm-item-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

    .cm-dropdown.open .cm-dropdown-item:nth-child(2) {
        animation-delay: 0.05s;
    }

    .cm-dropdown.open .cm-dropdown-item:nth-child(3) {
        animation-delay: 0.1s;
    }

    .cm-dropdown.open .cm-dropdown-item:nth-child(4) {
        animation-delay: 0.15s;
    }

@keyframes cm-item-slide-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cm-dropdown-item:hover {
    background: var(--rz-primary-lighter, rgba(79, 70, 229, 0.08));
    transform: translateX(2px);
}

.cm-dropdown-item:active {
    background: var(--rz-primary-lighter, rgba(79, 70, 229, 0.15));
    transform: scale(0.98);
}

.cm-dropdown-item .rzi {
    font-size: 18px;
    color: var(--rz-text-secondary-color, #6b7280);
    flex-shrink: 0;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cm-dropdown-item:hover .rzi {
    color: var(--rz-primary, #4f46e5);
}

/* Scrollbar Styling */
.control-menu::-webkit-scrollbar {
    width: 5px;
}

.control-menu::-webkit-scrollbar-track {
    background: transparent;
}

.control-menu::-webkit-scrollbar-thumb {
    border-radius: 3px;
}

    .control-menu::-webkit-scrollbar-thumb:hover {
        background: var(--rz-text-disabled-color, #d1d5db);
    }

/* Animation */
@keyframes cm-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.control-menu {
    animation: cm-fade-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Focus Visible */
.cm-menu-item:focus-visible,
.cm-dropdown-item:focus-visible,
.cm-header-close:focus-visible {
    outline: 2px solid var(--rz-primary, #4f46e5);
    outline-offset: 2px;
}

/* Disabled State */
.cm-menu-item:disabled,
.cm-dropdown-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==============================================
                   RESPONSIVE
                   ============================================== */
@media (max-height: 600px) {
    .cm-menu-item, .cm-dropdown-item {
        height: 36px;
        min-height: 36px;
        max-height: 36px;
    }
}

/* Cho mobile/tablet - Stack vertical */
@media (max-width: 768px) {
    .phone-control-wrapper {
        flex-direction: column;
    }

    .control-menu {
        width: 100%;
        flex: 0 0 auto;
    }
}

/* ==================== CONTROL SECTIONS ==================== */
.control-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-title {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--md3-outline-variant, var(--rz-border-color));
    color: var(--md3-on-surface, var(--rz-text-title-color));
}

.section-content {
    padding-left: 0.25rem;
}

/* ==================== RECORDING CONTROLS ==================== */
.record-btn.recording {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.tk-zoom-content .rz-button {
    border-radius: 0.5rem !important;
    font-size: var(--size-1) !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0.02em !important;
}

.import-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--md3-surface-container, var(--rz-base-100));
    border: 2px dashed var(--md3-outline, var(--rz-border-color));
    border-radius: 0.5rem;
    color: var(--md3-primary, var(--rz-primary));
    font-size: var(--size-1);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .import-btn:hover {
        background: var(--md3-primary-container, var(--rz-primary-lighter));
        border-color: var(--md3-primary, var(--rz-primary));
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

/* ==================== JSON PREVIEW ==================== */
.json-preview-box {
    background: var(--md3-surface-container, var(--rz-base-100));
    border: 1px solid var(--md3-outline-variant, var(--rz-border-color));
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.json-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--md3-outline-variant, var(--rz-border-color));
    color: var(--md3-primary, var(--rz-primary));
}

.json-preview {
    margin: 0;
    padding: 0.75rem;
    background: var(--md3-surface-container-highest, var(--rz-base-200));
    color: var(--md3-on-surface, var(--rz-text-color));
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: var(--size-0);
    line-height: 1.6;
    border-radius: 0.375rem;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

    .json-preview::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .json-preview::-webkit-scrollbar-track {
        background: var(--md3-surface-container-low, var(--rz-base-100));
    }

    .json-preview::-webkit-scrollbar-thumb {
        background: var(--md3-outline, var(--rz-scrollbar-color));
        border-radius: 3px;
    }

        .json-preview::-webkit-scrollbar-thumb:hover {
            background: var(--md3-on-surface-variant, var(--rz-text-secondary-color));
        }

/* ==================== ZOOM ITEMS ==================== */
.zoom-item {
    background: var(--md3-surface-container, var(--rz-base-100));
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--md3-outline-variant, var(--rz-border-color));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .zoom-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

.zoom-header {
    margin-bottom: 0.75rem;
}

.zoom-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--size-3);
    color: white;
    flex-shrink: 0;
}

    .zoom-icon.orange {
        background: var(--rz-warning, #f59e0b);
    }

    .zoom-icon.blue {
        background: var(--rz-info, #3b82f6);
    }

.zoom-title {
    font-size: var(--size-2) !important;
    font-weight: 600 !important;
    color: var(--md3-on-surface, var(--rz-text-title-color)) !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.zoom-subtitle {
    font-size: var(--size-0) !important;
    color: var(--md3-on-surface-variant, var(--rz-text-secondary-color)) !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.zoom-value {
    font-size: var(--size-5) !important;
    font-weight: 700 !important;
    color: var(--md3-primary, var(--rz-primary)) !important;
    margin: 0 !important;
    min-width: 4rem;
    text-align: right;
}

/* ==================== BUTTON RIGHT FIXED ==================== */
.btn-fixed-right {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 9999;
    padding: 10px 12px;
    border-radius: 12px 0 0 12px;
    border: none;
    cursor: pointer;
    background: var(--rz-primary-dark); /* Material 3 primary */
    color: white;
    margin-right: 8px;
    font-size: var(--size-5);
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

    .btn-fixed-right:hover {
        background: var(--rz-primary);
        transform: translateY(-50%) scale(1.03);
        box-shadow: 0 6px 16px rgba(0,0,0,.35);
    }
/* ==================== SLIDER FIX ==================== */
.tk-zoom-content .zoom-slider {
    width: 100% !important;
    margin: 0.5rem 0;
}

/* Fix Radzen Slider - NO TRANSFORM on hover */
.tk-zoom-content .rz-slider {
    width: 100% !important;
    height: 6px !important;
}

.tk-zoom-content .rz-slider-track {
    background: var(--md3-surface-container-highest, var(--rz-base-200)) !important;
    height: 6px !important;
    border-radius: 3px !important;
}

.tk-zoom-content .rz-slider-range {
    background: var(--md3-primary, var(--rz-primary)) !important;
    height: 6px !important;
    border-radius: 3px !important;
}

.tk-zoom-content .rz-slider-handle {
    width: 18px !important;
    height: 18px !important;
    background: var(--md3-primary, var(--rz-primary)) !important;
    border: 3px solid var(--md3-surface, white) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    transition: box-shadow 0.2s ease !important;
    transform: translateY(-10px);
}

    .tk-zoom-content .rz-slider-handle:hover {
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3) !important;
        transform: translateY(-10px) scale(1.2);
        /* NO SCALE - keep position stable */
    }

    .tk-zoom-content .rz-slider-handle:active {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    }

/* Ensure slider container is full width */
.tk-zoom-content .rz-slider-horizontal {
    width: 100% !important;
}

/* ==================== SLIDER MARKS ==================== */
.slider-marks {
    padding: 0 0.25rem;
    margin-top: 0.25rem;
}

    .slider-marks .rz-text {
        font-size: var(--size-0) !important;
        color: var(--md3-on-surface-variant, var(--rz-text-secondary-color)) !important;
    }

/* ==================== DARK MODE ==================== */
.rz-material-dark .zoom-item {
    background: var(--md3-surface-container, #2b2930) !important;
}

.rz-material-dark .import-btn:hover {
    background: var(--md3-surface-container-high, #36343b) !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .tk-zoom-content {
        gap: 1rem;
    }

    .zoom-icon {
        width: 2rem;
        height: 2rem;
        font-size: var(--size-2);
    }

    .zoom-value {
        font-size: var(--size-4) !important;
    }
}

@media (max-width: 480px) {
    .control-section {
        gap: 0.5rem;
    }

    .section-content {
        padding-left: 0;
    }

    .zoom-item {
        padding: 0.75rem;
    }

    .zoom-icon {
        width: 1.75rem;
        height: 1.75rem;
        font-size: var(--size-1);
    }

    .import-btn {
        padding: 0.5rem 1rem;
        font-size: var(--size-0);
    }
}

/* phone.css - Thêm animation cho playback */

/* Recording border animation (màu đỏ-xanh) */
.phone-mini.recording {
    animation: recording-pulse 1s ease-in-out infinite;
    border-width: 4px !important;
}

@keyframes recording-pulse {
    0%, 100% {
        border-color: var(--rz-danger);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }

    50% {
        border-color: var(--rz-success);
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

/* Playing border animation (màu xanh-vàng) */
.phone-mini.playing {
    animation: playing-pulse 0.8s ease-in-out infinite;
    border-width: 4px !important;
}

@keyframes playing-pulse {
    0%, 100% {
        border-color: var(--rz-info);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    50% {
        border-color: var(--rz-warning);
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

/* Badge hiển thị số lượng actions */
.cm-badge {
    position: absolute;
    top: 10px;
    right: 32px;
    background: var(--rz-danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    animation: badge-pop 0.3s ease;
}

@keyframes badge-pop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cm-menu-item {
    position: relative;
}

/* Disabled state for buttons */
.cm-dropdown-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================================
 * SELECTION BOX & SELECTED PHONES - GLOBAL
 * ============================================================================ */

/* Selection box - global, fixed position */
#selection-box {
    position: absolute;
    border: 2px solid var(--rz-primary);
    background: rgba(99, 102, 241, 0.12);
    pointer-events: none;
    z-index: 999999;
    display: none;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
    backdrop-filter: blur(2px);
}

/* Selection count */
#selection-count-text {
    position: fixed;
    bottom: 10%;
    right: 20px;
    background: linear-gradient(135deg, var(--rz-primary) 0%, var(--rz-primary-darker) 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000000;
    display: none;
    animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    pointer-events: none;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Phone selected state */
.phone-mini.selected {
    outline: 3px solid var(--rz-primary);
    outline-offset: 2px;
    position: relative;
    z-index: 10;
}

    .phone-mini.selected::before {
        content: "";
        position: absolute;
        inset: -2px;
        background: rgba(99, 102, 241, 0.08);
        border-radius: inherit;
        pointer-events: none;
        z-index: -1;
    }

    .phone-mini.selected::after {
        content: "✓";
        position: absolute;
        top: 8px;
        right: 8px;
        background: var(--rz-primary);
        color: white;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 14px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
        z-index: 11;
        animation: checkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

@keyframes checkPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Hover effect */
.phone-mini:not(.selected):hover {
    outline: 2px solid rgba(99, 102, 241, 0.4);
    outline-offset: 2px;
    cursor: pointer;
    transition: outline 0.2s ease;
}

/* Prevent text selection during drag */
body.selecting {
    user-select: none !important;
    cursor: crosshair !important;
}

/* View container */
#view-phone-mini {
    position: relative;
    height:100vh;
}


/* ============================================================================
 * PHONE SELECTION STYLES
 * ========================================================================== */

/* Selected phone style (chỉ áp dụng ngoài popup) */
.phone-mini.selected {
    outline: 3px solid #2196F3 !important;
    outline-offset: 2px;
    position: relative;
}

    .phone-mini.selected::after {
        content: '✓';
        position: absolute;
        top: 8px;
        right: 8px;
        width: 24px;
        height: 24px;
        background: #2196F3;
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 14px;
        z-index: 10;
        animation: checkmark-in 0.3s ease;
    }

/* ✅ ẨN selected style cho phone trong popup */
.container-phone-control .phone-mini.selected {
    outline: none !important;
}

    .container-phone-control .phone-mini.selected::after {
        display: none !important;
    }

@keyframes checkmark-in {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}