

/* --- HÀNG CUỐI (TOGGLE + NÚT) --- */
/* --- 3. CLEAN UP LAYOUT --- */
.form-actions-row {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- KHỐI TOGGLE --- */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Style nút gạt (Switch) */
.switch-control {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333; /* Màu tắt */
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #fff; /* Màu bật (Trắng) */
}

input:checked + .slider:before {
    transform: translateX(18px);
    background-color: #000; /* Chấm tròn chuyển đen */
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

/* --- TOOLTIP (BẢNG HƯỚNG DẪN) --- */
.tooltip-container {
    position: relative;
    display: flex;
    align-items: center;
    cursor: help;
    color: #666;
    margin-left: -4px; /* Chỉnh sát lại chữ một chút */
    font-size: 16px;
}

.tooltip-container:hover {
    color: #aaa;
}

.tooltip-content {
    visibility: hidden;
    width: 260px;
    background-color: #e0e0e0;
    color: #222;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    
    /* Vị trí: Hiện lên trên chữ */
    position: absolute;
    z-index: 999;
    bottom: 120%; 
    left: 50%;
    transform: translateX(-50%);
    
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    font-weight: 400;
    pointer-events: none; /* Để chuột không bị vướng */
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #e0e0e0 transparent transparent transparent;
}
.label-with-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    bottom: 135%; /* Bay lên nhẹ */
}


/* Hiệu ứng hiện tooltip */
.tooltip-container:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    bottom: 150%;
}

/* --- NÚT SUBMIT (SIMPLE STYLE) --- */
.btn-submit-simple {
    background: #444; /* Màu xám tối */
    color: #e0e0e0;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    height: 40px;
}

.btn-submit-simple:hover:not(:disabled) {
    background: #555;
    color: #fff;
}

.btn-submit-simple:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* --- ÉP HÀNG NGANG TUYỆT ĐỐI --- */
.row-group {
    display: flex !important;       /* Dùng Flexbox */
    flex-direction: row !important; /* Hướng ngang */
    flex-wrap: nowrap !important;   /* CẤM xuống dòng */
    gap: 12px;                      /* Khoảng cách giữa 2 ô */
    width: 100%;
    align-items: flex-start;
}

/* Chỉnh các ô con bên trong */
.row-group .form-group {
    flex: 1 !important;     /* Tự động chia đều 50-50 */
    width: 50% !important;  /* Ép chiều rộng */
    min-width: 0 !important;/* Fix lỗi bị tràn khi nội dung dài */
    margin-bottom: 20px;
    display: block !important;
}

/* Đảm bảo dropdown bên trong đi theo chiều rộng cha */
.row-group .custom-dropdown {
    width: 100% !important;
}

/* --- CUSTOM DROPDOWN STYLE --- */
.custom-dropdown {
    position: relative;
    width: 100%;
    font-family: inherit;
}

/* Nút hiển thị giá trị đã chọn */
.dropdown-selected {
    background: #1c1c1c; /* Màu nền card cũ */
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    transition: 0.2s;
}

.dropdown-selected:hover {
    border-color: #666;
}

.dropdown-selected.active {
    border-color: #667eea; /* Màu accent */
}

/* Danh sách xổ xuống */
.dropdown-options {
    position: absolute;
    top: 110%; /* Cách nút chọn 1 chút */
    left: 0;
    width: 100%;
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 100;
    display: none; /* Mặc định ẩn */
    max-height: 300px; /* Chiều cao tối đa */
    overflow-y: auto; /* Có thanh cuộn */
}

.dropdown-options.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Ô tìm kiếm trong dropdown */
.dropdown-search {
    padding: 10px;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    background: #1c1c1c;
    z-index: 2;
}

.dropdown-search input {
    width: 100%;
    background: #131313;
    border: 1px solid #333;
    padding: 8px 12px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.dropdown-search input:focus {
    border-color: #667eea;
}

/* Từng dòng option */
.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.dropdown-item:hover {
    background: #2a2a2a;
    color: #fff;
}

.dropdown-item.selected {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: 600;
}

.dropdown-item i {
    font-size: 16px;
}

/* Custom Scrollbar cho đẹp */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}
.dropdown-options::-webkit-scrollbar-track {
    background: #131313;
}
.dropdown-options::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}






    :root { 
        --el-bg: #0b0b0b; 
        --el-card: #1c1c1c; 
        --el-border: #333; 
        --el-text-main: #ffffff; 
        --el-text-sub: #a1a1a1; 
        --el-accent: #667eea; 
        --el-hover: #2a2a2a; 
    }
    body { 
        background-color: var(--el-bg) !important; 
        color: var(--el-text-main); 
        font-family: "Inter", sans-serif; 
    }
    
    /* LAYOUT */
    .clone-container {
    display: grid;
    grid-template-columns: 420px 1fr; 
    gap: 24px; /* KHOẢNG CÁCH TÁCH BIỆT 2 KHỐI */
    min-height: 85vh;
    margin-top: 20px;
    border: none; /* XÓA VIỀN CHUNG */
    background: transparent; /* XÓA NỀN CHUNG */
}

    /* LEFT: LIBRARY */
    .library-area {
    padding: 24px;
    /* Tự tạo viền và nền riêng */
    border: 1px solid var(--el-border);
    border-radius: 16px;
    background: var(--el-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 85vh; /* Giới hạn chiều cao để scroll */
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid var(--el-border);
    }

    .section-title { 
        font-size: 18px; 
        font-weight: 600; 
        color: #fff; 
        display: flex; 
        align-items: center; 
        gap: 10px; 
    }
    
    .voice-count {
        font-size: 12px;
        color: #888;
        background: rgba(255,255,255,0.05);
        padding: 4px 12px;
        border-radius: 20px;
    }

    .btn-refresh {
        background: transparent;
        border: 1px solid #333;
        color: #888;
        padding: 6px 12px;
        border-radius: 6px;
        cursor: pointer;
        transition: 0.2s;
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .btn-refresh:hover {
        border-color: var(--el-accent);
        color: var(--el-accent);
    }
/* --- FORM PANEL (CỘT TRÁI) --- */
.form-panel {
    position: relative;
    padding: 1.5px; /* Độ dày viền gradient */
    border-radius: 16px; /* Bo tròn 4 góc */
    background: #0a0a0a;
    overflow: hidden; /* Cắt gradient thừa */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    
    /* QUAN TRỌNG: Dùng fit-content để chiều cao co vừa khít nội dung */
    /* Không dùng 100% hay auto !important để tránh lỗi layout Grid */
    height: fit-content !important; 
    min-height: 0 !important;
}

/* Lớp Gradient xoay (Hiệu ứng viền 7 màu) */
.form-panel::before {
    content: '';
    position: absolute;
    inset: -150%; /* Phủ rộng ra ngoài để khi xoay không bị hở góc */
    background: conic-gradient(
        from 0deg,
        #1a1a2e 0deg,
        oklch(54.6% .245 262.881) 45deg,
        oklch(62.3% .214 259.815) 90deg,
        oklch(70.7% .165 254.624) 135deg,
        oklch(29.1% .149 302.717) 180deg,
        oklch(48.8% .243 264.376) 225deg,
        oklch(54.6% .245 262.881) 270deg,
        oklch(42.4% .199 265.638) 315deg,
        #1a1a2e 360deg
    );
    animation: spin 8s linear infinite, colorChange 16s ease-in-out infinite;
    z-index: 0;
}

/* Nội dung bên trong Form (Nền đen đè lên gradient) */
.form-content-inner {
    width: 100%;
    /* Để auto để nội dung đẩy chiều cao, không fix cứng */
    height: auto !important;
    background: var(--el-bg); 
    border-radius: 14.5px; /* Bo góc nhỏ hơn cha 1.5px để khớp viền */
    position: relative;
    z-index: 1;
    padding: 24px;
    flex-direction: column;
    display: block !important; /* Đổi từ flex sang block để tránh lỗi giãn */
}

/* Style cho chữ có Tooltip (Loại bỏ tiếng ồn) */
.label-with-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 10px; /* Cách nút gạt ra */
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 0; /* Tăng diện tích để dễ rê chuột */
}
.label-with-tooltip span {
    border-bottom: 1px dashed #555;
}

.label-with-tooltip:hover span {
    border-bottom-color: #aaa;
}
/* Animation Xoay */
@keyframes spin { 
    100% { transform: rotate(360deg); } 
}

/* Animation Đổi màu */
@keyframes colorChange {
    0% { filter: hue-rotate(0deg) saturate(1); }
    50% { filter: hue-rotate(80deg) saturate(1.2); }
    100% { filter: hue-rotate(0deg) saturate(1); }
}
    .form-title {
        font-size: 16px;
        font-weight: 600;
        color: #fff;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* INFO BANNER */
    .info-banner {
        background: rgba(102, 126, 234, 0.1);
        border: 1px solid rgba(102, 126, 234, 0.3);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 20px;
        font-size: 12px;
        line-height: 1.6;
        color: #aaa;
    }
    .info-banner strong {
        color: var(--el-accent);
    }

    /* FORM GROUPS */
    .form-group { 
        margin-bottom: 20px; 
    }
    .form-group label { 
        display: block; 
        font-size: 13px; 
        font-weight: 600; 
        color: #fff; 
        margin-bottom: 8px; 
    }
    .form-group label span {
        color: #ef4444;
    }
    
    .form-input { 
        width: 100%; 
        background: var(--el-card); 
        border: 1px solid var(--el-border); 
        color: white; 
        padding: 12px 16px; 
        border-radius: 8px; 
        font-size: 14px; 
        outline: none; 
        transition: 0.2s;
        font-family: inherit;
    }
    .form-input:focus { 
        border-color: var(--el-accent); 
    }
    .form-input::placeholder {
        color: #666;
    }

    /* UPLOAD BOX */
    .upload-box {
        border: 2px dashed #444; 
        border-radius: 12px; 
        padding: 40px 20px;
        text-align: center; 
        cursor: pointer; 
        transition: 0.2s; 
        background: rgba(255,255,255,0.02);
        display: flex; 
        flex-direction: column; 
        gap: 12px; 
        align-items: center; 
        justify-content: center;
        min-height: 180px;
    }
    .upload-box:hover { 
        border-color: var(--el-accent); 
        background: rgba(102, 126, 234, 0.05); 
    }
    .upload-box.has-file {
        border-color: #10b981;
        background: rgba(16, 185, 129, 0.05);
    }
    .upload-box.drag-over {
        border-color: var(--el-accent);
        background: rgba(102, 126, 234, 0.1);
        transform: scale(1.02);
    }
    
    .upload-icon {
        width: 60px;
        height: 60px;
        background: rgba(102, 126, 234, 0.1);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 8px;
    }
    .upload-icon i { 
        font-size: 28px; 
        color: var(--el-accent); 
    }
    
    .upload-text {
        font-size: 14px;
        font-weight: 600;
        color: #fff;
        margin-bottom: 4px;
    }
    .upload-hint { 
        font-size: 12px; 
        color: #666; 
        line-height: 1.4;
    }
    
    .file-info {
        display: none;
        background: rgba(16, 185, 129, 0.1);
        border: 1px solid rgba(16, 185, 129, 0.3);
        padding: 12px 16px;
        border-radius: 8px;
        margin-top: 10px;
    }
    .file-info.show {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .file-name {
        font-size: 13px;
        color: #10b981;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .file-size {
        font-size: 11px;
        color: #666;
        margin-left: 8px;
    }
    /* Card hiển thị file đã upload */
.file-preview-card {
    background: #1c1c1c; /* Màu nền tối */
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    animation: fadeIn 0.3s ease;
}

.file-details-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Icon loa tròn tròn */
.file-icon-wrapper {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}

.file-meta-info {
    flex: 1;
    overflow: hidden;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* Nút xóa thùng rác */
.btn-remove-file {
    background: transparent;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    transition: 0.2s;
}

.btn-remove-file:hover {
    color: #ef4444; /* Màu đỏ khi hover */
    transform: scale(1.1);
}

/* --- THANH PLAYER (WRAPPER) --- */
/* --- THANH PLAYER (WRAPPER) --- */
.audio-player-wrapper {
    width: 100%;
    margin-top: 10px;
}

/* --- TRÌNH PHÁT NHẠC DARK MODE (Universal) --- */
#audioPreviewPlayer {
    width: 100%;
    height: 40px;
    outline: none;
    display: block; /* Đảm bảo nó luôn hiện */
    
    /* MẸO: Đảo ngược màu nền Trắng -> Xám Đậm, Chữ Đen -> Trắng */
    /* invert(0.92): Đảo màu 92% để ra màu xám đậm dịu mắt */
    /* hue-rotate(180deg): Giữ lại màu xanh của thanh tiến trình (nếu có) */
    filter: invert(0.92) hue-rotate(180deg);
    
    opacity: 0.9; /* Giảm độ gắt */
    border-radius: 8px;
}
    /* LANGUAGE & GENDER SELECTOR */
    .selector-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .selector-option {
        background: var(--el-card);
        border: 1px solid var(--el-border);
        color: #aaa;
        padding: 10px 12px;
        border-radius: 8px;
        text-align: center;
        font-size: 13px;
        cursor: pointer;
        transition: 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-weight: 500;
    }
    .selector-option:hover {
        border-color: #555;
        color: #fff;
        transform: translateY(-1px);
    }
    .selector-option.active {
        background: var(--el-accent);
        border-color: var(--el-accent);
        color: #fff;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    .selector-option i {
        font-size: 16px;
    }

    /* TEXTAREA WITH CONTROLS */
    .textarea-wrapper {
        position: relative;
    }
    .textarea-controls {
        display: flex;
        gap: 6px;
        margin-bottom: 8px;
    }
    .btn-control {
        background: transparent;
        border: 1px solid #333;
        color: #aaa;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 11px;
        cursor: pointer;
        transition: 0.2s;
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 600;
    }
    .btn-control:hover {
        border-color: var(--el-accent);
        color: var(--el-accent);
    }
    .btn-control.btn-clear:hover {
        border-color: #ef4444;
        color: #ef4444;
    }
    
    .form-textarea {
        width: 100%;
        background: var(--el-card);
        border: 1px solid var(--el-border);
        color: white;
        padding: 12px 16px;
        border-radius: 8px;
        font-size: 13px;
        outline: none;
        transition: 0.2s;
        font-family: inherit;
        resize: vertical;
        min-height: 100px;
        line-height: 1.6;
    }
    .form-textarea:focus {
        border-color: var(--el-accent);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    .form-textarea::placeholder {
        color: #555;
        font-style: italic;
    }
    
    .char-count {
        font-size: 11px;
        color: #666;
        margin-top: 4px;
        text-align: right;
    }
    .char-count.warning {
        color: #f59e0b;
    }
    .char-count.error {
        color: #ef4444;
    }

    /* TEMPLATES */
    .templates-section {
        margin-bottom: 8px;
    }
    .templates-toggle {
        cursor: pointer;
        font-size: 12px;
        color: #888;
        user-select: none;
        padding: 10px;
        background: rgba(255,255,255,0.03);
        border-radius: 6px;
        border: 1px solid #222;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: 0.2s;
    }
    .templates-toggle:hover {
        background: rgba(255,255,255,0.05);
        border-color: #333;
    }
    .templates-toggle i {
        transition: transform 0.2s;
    }
    .templates-toggle.open i {
        transform: rotate(90deg);
    }
    .templates-grid {
        display: none;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    .templates-grid.show {
        display: grid;
    }
    .template-btn {
        background: #1a1a1a;
        border: 1px solid #333;
        color: #aaa;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 11px;
        cursor: pointer;
        transition: 0.2s;
        font-weight: 500;
    }
    .template-btn:hover {
        background: var(--el-accent);
        border-color: var(--el-accent);
        color: #fff;
        transform: translateY(-1px);
    }

    /* SUBMIT BUTTON */
    .btn-submit { 
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #fff; 
        border: none; 
        width: 100%; 
        padding: 14px; 
        border-radius: 30px; 
        font-weight: 600; 
        cursor: pointer; 
        transition: 0.2s; 
        font-size: 14px; 
        margin-top: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    .btn-submit:disabled { 
        opacity: 0.5; 
        cursor: not-allowed; 
        transform: none !important;
    }
    .btn-submit:hover:not(:disabled) { 
        transform: translateY(-2px); 
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    }

    /* ========================================= */
/* VOICE GRID - DARK MODE & MINIMAL STYLE    */
/* ========================================= */

.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Card rộng hơn chút cho thoáng */
    gap: 16px;
}

.voice-card {
    background: #131313;
    border: 1px solid #2a2a2a;
    border-radius: 16px; /* Bo tròn mềm mại */
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 150px;
}

/* Hiệu ứng Hover vào Card */
.voice-card:hover {
    border-color: #444;
    background: #181818;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

/* Tên giọng nói */
.vc-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

/* Khu vực Tags (Ngôn ngữ, Giới tính) */
.vc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: auto; /* Đẩy phần footer xuống đáy */
}

/* Style từng Tag */
.vc-tag {
    font-size: 11px;
    font-weight: 500;
    color: #bbb;
    background: #222;
    padding: 4px 10px;
    border-radius: 20px; /* Hình viên thuốc */
    border: 1px solid #333;
}

/* Footer (Chứa Avatar và Nút bấm) */
.vc-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05); /* Đường kẻ mờ */
    padding-top: 12px;
}

/* Avatar nhỏ */
.vc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #333;
    object-fit: cover;
}

/* Khu vực nút bấm */
.vc-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Style chung cho nút icon */
.btn-icon-action {
    background: transparent;
    border: none;
    color: #666; /* Màu mặc định tối */
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover chung */
.btn-icon-action:hover {
    transform: scale(1.2);
    color: #fff;
}

/* Hover nút Play -> Màu xanh */
.btn-icon-action.play:hover:not(:disabled) {
    color: #10b981; 
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Hover nút Xóa -> Màu đỏ */
.btn-icon-action.delete:hover {
    color: #ef4444;
}

/* Nút bị vô hiệu hóa (khi chưa có audio) */
.btn-icon-action:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    transform: none;
}

/* --- ẨN CÁC PHẦN KHÔNG CẦN THIẾT (Copy ID, Meta cũ) --- */
.vc-id, .btn-copy-id, .vc-meta, .voice-status {
    display: none !important;
}

    /* LOADING OVERLAY */
    .loading-overlay { 
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100%; 
        background: rgba(0,0,0,0.85); 
        backdrop-filter: blur(5px);
        display: none; 
        justify-content: center; 
        align-items: center; 
        z-index: 3000; 
        flex-direction: column; 
        gap: 16px;
    }
    .loading-spinner {
        width: 50px;
        height: 50px;
        border: 4px solid #333;
        border-top-color: var(--el-accent);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }
    @keyframes spin {
        to { transform: rotate(360deg); }
    }
    .loading-text {
        color: #fff;
        font-size: 16px;
        font-weight: 600;
    }
    .loading-hint {
        color: #888;
        font-size: 13px;
        max-width: 400px;
        text-align: center;
    }
    .loading-progress {
        width: 300px;
        height: 4px;
        background: #333;
        border-radius: 2px;
        overflow: hidden;
        margin-top: 8px;
    }
    .loading-bar {
        height: 100%;
        background: linear-gradient(90deg, var(--el-accent), #764ba2);
        width: 0%;
        transition: width 0.3s;
        animation: pulse 1.5s ease-in-out infinite;
    }
    @keyframes pulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.7; }
    }

    /* EMPTY STATE */
    .empty-state {
        grid-column: 1/-1;
        text-align: center;
        padding: 60px 20px;
        color: #666;
        border: 2px dashed #333;
        border-radius: 12px;
        background: rgba(255,255,255,0.02);
    }
    .empty-state i {
        font-size: 48px;
        margin-bottom: 16px;
        display: block;
        color: #444;
    }
    .empty-state .title {
        font-size: 16px;
        font-weight: 600;
        color: #888;
        margin-bottom: 8px;
    }
    .empty-state .hint {
        font-size: 13px;
        color: #666;
    }

    /* TOAST */
    .toast-notification {
        position: fixed;
        bottom: -100px;
        left: 50%;
        transform: translateX(-50%);
        background: #1a1a1a;
        border: 1px solid #333;
        padding: 16px 24px;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        z-index: 4000;
        transition: bottom 0.3s ease;
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 300px;
        max-width: 500px;
    }
    .toast-notification.show {
        bottom: 30px;
    }
    .toast-icon {
        font-size: 20px;
        flex-shrink: 0;
    }
    .toast-icon.success { color: #10b981; }
    .toast-icon.error { color: #ef4444; }
    .toast-icon.info { color: var(--el-accent); }
    .toast-icon.warning { color: #f59e0b; }
    .toast-text {
        color: #fff;
        font-size: 14px;
        font-weight: 500;
        flex: 1;
    }

    /* CREDITS DISPLAY */
    .credits-display {
        margin-top: auto;
        padding-top: 20px;
        border-top: 1px solid var(--el-border);
        text-align: center;
        font-size: 12px;
        color: #666;
    }
    .credits-value {
        color: #10b981;
        font-weight: 700;
        font-size: 16px;
        display: block;
        margin: 4px 0;
    }
    .credits-info {
        font-size: 11px;
        color: #555;
    }

    /* RESPONSIVE */
@media (max-width: 1024px) {
    .clone-container {
        grid-template-columns: 1fr;
        gap: 20px; /* Mobile thì cách nhau dọc */
    }
    /* Reset lại chiều cao trên mobile để không bị stretch */
    .form-panel, .library-area {
        height: auto;
        max-height: none;
    }
}
/* ==========================================================================
   MOBILE RESPONSIVE (DÁN VÀO CUỐI FILE voice_cloning.css)
   ========================================================================== */

@media (max-width: 900px) {

    /* --- 1. LAYOUT CHÍNH (CỘT DỌC) --- */
    .clone-container {
        grid-template-columns: 1fr !important; /* Chuyển thành 1 cột duy nhất */
        gap: 20px;
        margin-top: 10px;
        display: flex;
        flex-direction: column;
    }

    /* --- 2. XỬ LÝ FORM NHẬP LIỆU (FORM PANEL) --- */
    .form-panel {
        width: 100%;
        margin-bottom: 20px;
    }

    .form-content-inner {
        padding: 16px !important; /* Giảm padding cho đỡ tốn diện tích */
    }

    /* --- 3. PHÁ VỠ CẤU TRÚC ÉP NGANG (ROW GROUP) --- */
    /* Ghi đè các thuộc tính !important ở bản desktop */
    .row-group {
        flex-direction: column !important; /* Xếp dọc xuống */
        gap: 0 !important;
    }

    .row-group .form-group {
        width: 100% !important; /* Full chiều rộng màn hình */
        margin-bottom: 16px;
    }

    /* --- 4. KHU VỰC HÀNH ĐỘNG CUỐI FORM (TOGGLE + NÚT) --- */
    .form-actions-row {
        flex-direction: column-reverse; /* Đảo ngược: Nút lên trên, Toggle xuống dưới */
        gap: 16px;
        align-items: stretch; /* Kéo dãn full chiều ngang */
        padding-top: 12px;
    }

    .btn-submit-simple {
        width: 100%; /* Nút bấm to dễ ấn */
        height: 48px; /* Tăng chiều cao vùng chạm */
        font-size: 16px;
    }

    .toggle-wrapper {
        justify-content: space-between; /* Đẩy label và nút gạt ra 2 bên */
        width: 100%;
        background: #151515;
        padding: 12px;
        border-radius: 8px;
    }

    /* Ẩn tooltip trên mobile vì không có hover chuột */
    .tooltip-content {
        display: none !important;
    }

    /* --- 5. UPLOAD BOX --- */
    .upload-box {
        padding: 24px 16px;
        min-height: 140px;
    }
    
    .upload-icon {
        width: 48px;
        height: 48px;
    }
    
    .upload-icon i {
        font-size: 24px;
    }

    /* --- 6. KHU VỰC THƯ VIỆN (LIBRARY AREA) --- */
    .library-area {
        height: auto;
        max-height: 600px; /* Giới hạn chiều cao, scroll bên trong */
        padding: 16px;
        overflow-y: auto;
        border-radius: 12px;
    }

    /* Header của thư viện */
    .section-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 16px;
    }

    .btn-refresh {
        padding: 8px 12px; /* Nút to hơn chút */
    }

    /* --- 7. DANH SÁCH GIỌNG NÓI (VOICE GRID) --- */
    .voice-grid {
        grid-template-columns: 1fr; /* 1 Card trên 1 hàng */
        gap: 12px;
    }

    .voice-card {
        padding: 16px;
        min-height: auto;
        flex-direction: row; /* Chuyển card thành dạng nằm ngang cho gọn */
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    /* Tinh chỉnh nội dung bên trong card */
    .vc-title {
        width: 100%; /* Tên nằm dòng riêng */
        margin-bottom: 4px;
        font-size: 15px;
    }
    
    .vc-tags {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .vc-footer-row {
        width: 100%;
        margin-top: 8px;
        padding-top: 8px;
        display: flex;
        justify-content: space-between;
    }

    /* Các nút hành động trên card */
    .btn-icon-action {
        padding: 8px; /* Tăng vùng chạm */
        font-size: 20px;
    }

    /* --- 8. TOAST NOTIFICATION --- */
    .toast-notification {
        width: 90%;
        min-width: auto;
        bottom: -100px; /* Trạng thái ẩn */
    }
    
    .toast-notification.show {
        bottom: 80px; /* Cao hơn chút để tránh thanh điều hướng của iPhone */
    }
}

/* --- ĐIỆN THOẠI MÀN HÌNH NHỎ (iPhone SE, Galaxy Fold) --- */
@media (max-width: 380px) {
    .section-title {
        font-size: 16px;
    }
    .upload-text {
        font-size: 13px;
    }
    .upload-hint {
        font-size: 11px;
    }
}