/* --- 1. Lookup Mode Styles (Giữ nguyên) --- */
.thx-ec-lex-word {
    cursor: pointer;
    border-radius: 3px;
    color: #00662e;
    transition: all 0.2s ease;
}
.thx-ec-lex-word:hover {
    color: #d92d20;
    background-color: rgba(217, 45, 32, 0.05);
    text-decoration: underline;
}

/* --- 2. TTS Speaker Icon (Giữ nguyên) --- */
.thx-ec-tts-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    vertical-align: middle;
    cursor: pointer;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    font-size: 14px;
    color: #555;
    transition: all 0.2s;
    user-select: none;
    line-height: 1;
}
.thx-ec-tts-icon:hover {
    background: #0073aa;
    color: #fff;
    transform: scale(1.1);
}
.thx-ec-tts-icon.speaking {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    animation: thx-ec-pulse 1s infinite;
}
@keyframes thx-ec-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* --- 3. PROFESSIONAL RANGE SLIDER (Mới) --- */
.thx-ec-lex-rate-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    
    /* [CẬP NHẬT] Thêm padding 2 bên (15px) để chữ không dính mép */
    padding: 10px 15px; 
    
    font-size: 13px;
    color: #555;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: 8px;
    font-weight: 500;
}

/* Xóa style mặc định của trình duyệt */
.thx-ec-lex-rate-wrap input[type=range] {
    -webkit-appearance: none; /* Chrome/Safari/Edge */
    
    /* [CẬP NHẬT] Thay width: 100% bằng flex: 1 để co giãn mềm dẻo hơn */
    flex: 1; 
    
    /* [CẬP NHẬT] Thêm margin trái phải 15px để thu hẹp slider lại tổng cộng 30px */
    margin: 0 15px; 
    
    background: transparent;
    min-width: 0; /* Fix lỗi flexbox trên Firefox */
}
.thx-ec-lex-rate-wrap input[type=range]:focus {
    outline: none;
}

/* --- STYLE CHO THANH TRACK (Đường ray) --- */
/* Chrome/Safari/Edge */
.thx-ec-lex-rate-wrap input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #e0e0e0;
    border-radius: 3px;
    transition: background 0.2s;
}
/* Firefox */
.thx-ec-lex-rate-wrap input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #e0e0e0;
    border-radius: 3px;
    transition: background 0.2s;
}

/* --- STYLE CHO CÁI NÚT KÉO (Thumb) --- */
/* Chrome/Safari/Edge */
.thx-ec-lex-rate-wrap input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0073aa; /* Viền xanh WordPress */
    cursor: grab;
    margin-top: -6px; /* Căn giữa nút kéo với track (18/2 - 6/2 = 6, nhưng cần số âm) */
    box-shadow: 0 1px 4px rgba(0,0,0,0.3); /* Đổ bóng nhẹ cho nổi */
    transition: transform 0.1s, box-shadow 0.1s;
}
/* Firefox */
.thx-ec-lex-rate-wrap input[type=range]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0073aa;
    cursor: grab;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}

/* Hiệu ứng khi Hover và Active (Kéo) */
.thx-ec-lex-rate-wrap input[type=range]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.thx-ec-lex-rate-wrap input[type=range]:active::-webkit-slider-thumb {
    background: #0073aa; /* Đổi màu đặc khi đang kéo */
    cursor: grabbing;
}
.thx-ec-lex-rate-wrap input[type=range]:hover::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.thx-ec-lex-rate-wrap input[type=range]:active::-moz-range-thumb {
    background: #0073aa;
    cursor: grabbing;
}

/* Con số hiển thị bên cạnh (ví dụ: 1.0x) */
#lex-rate-val {
    min-width: 35px;
    text-align: right;
    font-weight: 700;
    color: #0073aa;
    font-family: monospace; /* Dùng font monospace để số không bị nhảy */
    font-size: 1.1em;
}

/* --- 4. Popup Styles (Giữ nguyên) --- */
.thx-ec-lex-popup {
    display: none;
    position: fixed;
    z-index: 100000;
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #f0f0f0;
    font-size: 14px;
    animation: thx-ec-fadein 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    min-width: 120px;
}
.thx-ec-lex-term { font-weight: 700; color: #222; margin-right: 5px; font-size: 1.1em;}
.thx-ec-lex-meaning { color: #666; }
@keyframes thx-ec-fadein { 
    from { opacity:0; transform:translateY(10px) scale(0.95); } 
    to { opacity:1; transform:translateY(0) scale(1); } 
}