/* GENERAL */
.mtv-container { max-width: 800px; margin: 20px auto; background: #fff; padding: 25px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); font-family: Arial, sans-serif; box-sizing: border-box; }
.mtv-container * { box-sizing: border-box; }

/* HEADER BAR */
.mtv-header-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(10px);
    padding: 15px 20px; border-radius: 8px; margin-bottom: 25px;
    border: 1px solid #eee;
}
.mtv-balance { font-size: 15px; color: #333; }
#mtv-user-balance { color: #ff0000; font-weight: bold; font-size: 18px; }
.mtv-btn-buy {
    display: inline-block; padding: 8px 20px; 
    background-color: #ff9800; color: #fff !important; 
    text-decoration: none !important; border-radius: 20px; 
    font-weight: bold; font-size: 13px; transition: 0.3s;
}
.mtv-btn-buy:hover { background-color: #f57c00; transform: translateY(-2px); }

/* TABS */
.mtv-tabs { display: flex; border-bottom: 2px solid #eee; margin-bottom: 20px; }
.mtv-tab-btn { flex: 1; padding: 12px; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-weight: bold; color: #666; font-size: 15px; transition: 0.3s; }
.mtv-tab-btn:hover { background: #f9f9f9; }
.mtv-tab-btn.active { color: #673ab7; border-bottom-color: #673ab7; background: #fff; }
.mtv-view { display: none; }
.mtv-view.active { display: block; animation: fadeIn 0.4s; }

/* MODEL SELECTOR */
.mtv-model-selector { display: flex; gap: 10px; margin-bottom: 20px; justify-content: space-between; }
.mtv-radio-label { cursor: pointer; flex: 1; }
.mtv-radio-label input { display: none; }
.mtv-radio-box { display: block; text-align: center; padding: 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-weight: bold; color: #555; transition: 0.2s; }
.mtv-radio-label input:checked + .mtv-radio-box { border-color: #673ab7; color: #673ab7; background: #f3e5f5; box-shadow: 0 2px 5px rgba(103, 58, 183, 0.2); }

/* FORM */
.mtv-row { display: flex; gap: 20px; margin-bottom: 20px; }
.mtv-col { flex: 1; }
.mtv-col label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.mtv-col select, .mtv-col input[type=range] { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 5px; height: 40px; }
.mtv-input-group textarea { width: 100%; padding: 15px; border: 1px solid #ccc; border-radius: 5px; min-height: 120px; font-family: inherit; }

/* FOOTER ACTIONS */
.mtv-footer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.mtv-action-left { flex: 1; }
.mtv-action-right { text-align: right; }
.mtv-counter { font-size: 13px; color: #666; line-height: 1.4; }
#mtv-cost { color: #d32f2f; font-weight: bold; font-size: 15px; }
.mtv-btn { padding: 12px 25px; background: #673ab7; color: #fff; border: none; border-radius: 5px; font-size: 16px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.mtv-btn:hover { background: #5e35b1; box-shadow: 0 4px 10px rgba(94, 53, 177, 0.3); }

/* CLONE SECTION */
.mtv-clone-box { background: #fff8e1; border: 1px solid #ffe0b2; padding: 20px; border-radius: 8px; margin-bottom: 25px; }
.mtv-clone-box h3 { margin-top: 0; color: #e65100; font-size: 18px; }
.mtv-desc { font-size: 13px; color: #777; margin-bottom: 10px; }
.mtv-price-tag { display: inline-block; background: #ffe0b2; color: #e65100; padding: 4px 10px; border-radius: 4px; font-size: 13px; margin-bottom: 15px; }
.mtv-form-group input[type="text"] { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 15px; }
.mtv-file-upload { border: 2px dashed #ffb74d; padding: 20px; text-align: center; background: #fff; border-radius: 6px; position: relative; cursor: pointer; transition: 0.2s; }
.mtv-file-upload:hover { background: #fff3e0; }
.mtv-file-upload input { position: absolute; top:0; left:0; width:100%; height:100%; opacity:0; cursor: pointer; }
.mtv-upload-inner { pointer-events: none; }
.mtv-upload-icon { font-size: 40px; width: 40px; height: 40px; color: #ffb74d; display: block; margin: 0 auto 5px; }
.mtv-file-name { margin: 0; font-weight: bold; color: #e65100; font-size: 13px; }
.mtv-terms-group { margin: 15px 0; font-size: 13px; color: #555; }
.mtv-terms-group label { display: flex; align-items: flex-start; gap: 10px; text-align: left; }
.mtv-terms-group input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
.mtv-btn.disabled { background: #ccc !important; cursor: not-allowed; }

/* HISTORY LIST & CLONE LIST */
.mtv-history-item, .mtv-clone-item { border: 1px solid #eee; border-radius: 8px; padding: 15px; margin-bottom: 15px; background: #fff; }
.mtv-clone-item { display: flex; align-items: center; justify-content: space-between; background: #f9f9f9; }
.mtv-clone-info { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.mtv-clone-actions { display: flex; gap: 5px; align-items: center; }
.mtv-icon-btn { border: none; background: none; cursor: pointer; padding: 5px; color: #888; }
.mtv-badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; color: #fff; font-weight: bold; margin-left: 5px; vertical-align: text-top; }
.badge-turbo { background: #ff9800; } .badge-hd { background: linear-gradient(45deg, #673ab7, #9c27b0); } .badge-clone { background: #e65100; }
.mtv-item-header { display: flex; justify-content: space-between; font-size: 13px; color: #888; margin-bottom: 8px; }
.mtv-item-voice { font-weight: bold; color: #673ab7; text-transform: uppercase; }
.mtv-item-cost { color: #d32f2f; background: #ffebee; padding: 2px 5px; border-radius: 3px; font-size: 12px; font-weight: bold; }

/* Other styles... (Text box, Actions, Modal) giữ nguyên */
.mtv-text-box { background: #f5f5f5; padding: 10px; border-radius: 5px; margin-bottom: 10px; font-size: 13px; color: #555; font-style: italic; position: relative; }
.mtv-item-text { flex: 1; padding-right: 30px; word-break: break-word; }
.mtv-copy-btn { position: absolute; top: 5px; right: 5px; border:none; background:none; color:#999; cursor:pointer; }
.mtv-item-actions { display: flex; gap: 10px; margin-top: 5px; flex-wrap: wrap; }
.mtv-dl-btn, .mtv-use-btn { padding: 6px 12px; border-radius: 4px; text-decoration: none; font-size: 12px; font-weight: bold; border: 1px solid #ccc; background: #fff; color: #333; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.mtv-use-btn { background: #0073aa; color: #fff; border: none; }
.mtv-item-date { display: block; text-align: right; font-size: 11px; color: #aaa; margin-top: 5px; }
.mtv-cost-warning { background-color: #fff8e1; border-left: 4px solid #ff9800; padding: 15px; margin-top: 15px; margin-bottom: 15px; border-radius: 4px; font-size: 13px; color: #5d4037; display: none; }
.mtv-cost-warning strong { color: #e65100; font-size: 14px; display: block; margin-bottom: 5px; }
.mtv-cost-warning ul { margin: 5px 0 0 15px; padding: 0; list-style-type: disc; }

/* MODAL */
.mtv-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 10000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.3s; }
.mtv-modal-content { background: #fff; width: 90%; max-width: 400px; padding: 30px; border-radius: 12px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.2); position: relative; animation: slideUp 0.3s; }
.mtv-modal-icon { font-size: 50px; color: #ff9800; margin-bottom: 15px; }
.mtv-modal-icon .dashicons { width: 50px; height: 50px; font-size: 50px; }
#mtv-modal-title { margin: 0 0 10px; color: #333; font-size: 20px; }
#mtv-modal-message { color: #666; font-size: 15px; line-height: 1.5; margin-bottom: 20px; }
.mtv-modal-input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 20px; font-size: 14px; box-sizing: border-box; }
.mtv-modal-actions { display: flex; gap: 10px; justify-content: center; }
.mtv-modal-btn { padding: 10px 25px; border-radius: 5px; border: none; font-weight: bold; cursor: pointer; font-size: 14px; transition: 0.2s; }
.mtv-btn-confirm { background: #673ab7; color: #fff; }
.mtv-btn-cancel { background: #eee; color: #333; }

/* MOBILE RESPONSIVE FIX */
@media(max-width: 600px) { 
    .mtv-header-bar { flex-direction: row; padding: 12px 15px; }
    .mtv-balance { font-size: 13px; }
    .mtv-btn-buy { padding: 6px 12px; font-size: 12px; }
    
    .mtv-tab-btn { 
        padding: 10px 5px; 
        font-size: 12px; /* Chữ nhỏ lại để vừa 1 dòng */
        white-space: nowrap; 
    }
    
    .mtv-row { flex-direction: column; gap: 10px; } 
    .mtv-model-selector { flex-direction: column; }
    .mtv-footer-actions { flex-direction: column; gap: 15px; }
    .mtv-action-left, .mtv-action-right { width: 100%; text-align: center; }
    .mtv-btn { width: 100%; }
    
    .mtv-clone-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .mtv-clone-item audio { width: 100%; }
    .mtv-clone-actions { width: 100%; justify-content: flex-end; }
}

@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
@keyframes slideUp { from{transform:translateY(20px);opacity:0;} to{transform:translateY(0);opacity:1;} }
.mtv-spinner { width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top: 4px solid #673ab7; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Progress Bar */
#mtv-loading { margin-top: 20px; padding: 15px; background: #fdfbff; border: 1px dashed #d1c4e9; border-radius: 8px; text-align: center; }
.mtv-progress-wrapper { max-width: 400px; margin: 0 auto; }
.mtv-progress-container { width: 100%; height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; margin: 5px 0; }
.mtv-progress-bar { height: 100%; background: #673ab7; width: 0%; transition: width 0.3s; }
/* ... [Giữ nguyên code cũ] ... */

/* Sửa lại phần Mobile Responsive ở cuối file */

@media(max-width: 600px) { 
    .mtv-header-bar { flex-direction: row; padding: 12px 15px; }
    
    /* ITEM HEADER MOBILE */
    .mtv-item-header { 
        flex-direction: column; /* Xếp dọc */
        align-items: flex-start; 
        gap: 6px; 
    }
    
    /* Container chứa Tên giọng + Badge */
    .mtv-header-left { 
        display: flex; 
        flex-wrap: wrap; 
        align-items: center; 
        width: 100%;
        gap: 5px;
    }
    
    /* Badge */
    .mtv-badge {
        font-size: 9px;
        padding: 1px 4px;
        margin-left: 0; /* Bỏ margin thừa */
    }

    /* Tên giọng */
    .mtv-item-voice {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px; /* Giới hạn chiều rộng để không đè nút xóa */
    }

    /* Giá tiền */
    .mtv-item-cost {
        font-size: 11px;
        margin-left: 0;
        align-self: flex-end; /* Đẩy giá tiền sang phải nếu muốn, hoặc để default */
        width: 100%;
        text-align: left;
    }

    /* Các phần khác */
    .mtv-clone-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .mtv-clone-item audio { width: 100%; }
    .mtv-clone-actions { width: 100%; justify-content: flex-end; }
}
/* --- FIX SIÊU CẤP NÚT PLAY --- */
#mtv-preview-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background-color: #0073aa !important;
    border: 1px solid #0073aa !important;
    border-radius: 5px !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    margin-left: 8px !important;
    cursor: pointer;
    box-shadow: none !important;
    flex-shrink: 0;
}

#mtv-preview-btn:hover {
    background-color: #005177 !important;
}

/* Ép buộc phần tử bên trong dùng đúng Font Dashicons */
#mtv-preview-btn .dashicons,
#mtv-preview-btn .dashicons:before {
    font-family: "dashicons" !important; /* QUAN TRỌNG NHẤT */
    font-weight: normal !important;
    font-style: normal !important;
    color: #ffffff !important;
    font-size: 24px !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    text-transform: none !important;
    speak: never;
    -webkit-font-smoothing: antialiased;
}

/* Định nghĩa lại mã icon phòng trường hợp bị mất */
#mtv-preview-btn .dashicons-volume-on:before {
    content: "\f521" !important;
}
#mtv-preview-btn .dashicons-controls-pause:before {
    content: "\f523" !important;
}
/* --- MOBILE OPTIMIZATION (V1) --- */
@media (max-width: 600px) {
    /* 1. Header: Xếp dọc */
    .mtv-header-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
        padding: 15px !important;
    }
    .mtv-header-left, .mtv-header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    /* 2. Tabs: Thu nhỏ chữ */
    .mtv-tab-btn {
        padding: 8px 5px !important;
        font-size: 12px !important;
    }

    /* 3. QUAN TRỌNG: Nút chọn Model xếp dọc */
    .mtv-model-selector {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .mtv-radio-box {
        width: 100% !important;
        padding: 10px !important;
        font-size: 13px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* 4. Form elements */
    .mtv-row {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .mtv-col { width: 100% !important; }
}
/* --- SHARE BUTTON (NEW V11) --- */
.mtv-share-btn {
    padding: 6px 12px; font-size: 12px; border-radius: 4px;
    border: 1px solid #28a745; background: #fff;
    color: #28a745; cursor: pointer; text-decoration: none !important;
    display: inline-flex; align-items: center; gap: 5px; font-weight: 600;
}
.mtv-share-btn:hover {
    background: #28a745; color: white;
}

/* Ẩn nút chia sẻ trên máy tính (PC thường không cần thiết, hoặc giữ lại tùy bạn) */
@media (min-width: 1024px) {
    /* .mtv-share-btn { display: none !important; } */ 
    /* Bỏ comment dòng trên nếu muốn ẩn trên PC */
}