/* =========================================
   1. CORE STRUCTURE (SHARED)
   Dùng chung cho cả bản gốc và bản clone để đảm bảo bố cục không đổi
   ========================================= */
.thx-ec-text-block,
.thx-ec-text-clone {
    position: relative;
    line-height: 1.6;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

.thx-ec-text-block.has-text-align-center,
.thx-ec-text-clone.has-text-align-center {
    text-align: center;
}

.thx-ec-text-block.has-text-align-right,
.thx-ec-text-clone.has-text-align-right {
    text-align: right;
}

.thx-ec-text-block.has-text-align-left,
.thx-ec-text-clone.has-text-align-left {
    text-align: left;
}

/* Segment (Câu/Từ) - Chỉ lấy khung xương */
.thx-ec-text-block .seg,
.thx-ec-text-clone .seg {
    background: transparent;
    padding: 2px 0;
    margin: 0;
    border-radius: 4px;
    border: none;
    box-sizing: border-box;
    transition: all 0.15s ease-out;
    /* Giữ transition để nếu có thay đổi gì (như resize) thì mượt */
}

/* Ẩn thẻ ngắt trang (Chung) */
.thx-ec-text-block hr.thx-ec-page-break,
.thx-ec-text-clone hr.thx-ec-page-break {
    display: none;
}

/* Ẩn hiệu ứng chuyển trang (Chung) */
.thx-ec-text-block>*:not(.thx-ec-ui-control),
.thx-ec-text-clone>*:not(.thx-ec-ui-control) {
    transition: opacity 0.25s ease-in-out;
    opacity: 1;
}

.thx-ec-text-block.is-switching>*:not(.thx-ec-ui-control),
.thx-ec-text-clone.is-switching>*:not(.thx-ec-ui-control) {
    opacity: 0;
}


/* =========================================
   2. INTERACTIVE EFFECTS (EXCLUSIVE FOR ORIGINAL)
   Chỉ bản gốc (.thx-ec-text-block) mới có những hiệu ứng này
   ========================================= */

/* Chỉ hiện con trỏ tay ở bản gốc */
.thx-ec-text-block .seg {
    cursor: pointer;
}

/* Hover Effect */
.thx-ec-text-block .seg:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Selected State (Shift + Click) */
.thx-ec-text-block .seg.is-selected {
    background-color: #fff8e1;
    color: inherit;
}

/* Active State (Đang đọc) */
.thx-ec-text-block .seg.is-active {
    background-color: #fff9c4;
    box-shadow: 0 0 4px 1px #ffd54f;
    color: #222;
    position: relative;
    z-index: 2;
}

/* Focus Mode (Làm mờ xung quanh) */
.thx-ec-text-block.focus-mode .seg:not(.is-selected):not(.is-active) {
    opacity: 0.5;
    filter: grayscale(100%);
    transition: opacity 0.3s;
}

.thx-ec-text-block.focus-mode .seg.is-selected,
.thx-ec-text-block.focus-mode .seg.is-active {
    opacity: 1;
    filter: none;
}


/* =========================================
   3. DOCUMENT PAGINATION TABS
   (Giữ nguyên không đổi)
   ========================================= */
.thx-ec-doc-pagination-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px auto 25px;
    max-width: 480px;
    border-bottom: 2px solid #f0f0f1;
    padding-bottom: 0;
}



.thx-ec-tab-item {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    color: #666;
    background-color: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.thx-ec-tab-item:hover {
    color: #007cba;
    background-color: #f9f9f9;
}

.thx-ec-tab-item.active {
    color: #007cba;
    border-bottom-color: #007cba;
    background-color: #fff;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 600px) {
    .thx-ec-doc-pagination-tabs {
        margin: 20px auto;
    }

    .thx-ec-tab-item {
        padding: 10px 15px;
        font-size: 14px;
        flex: 1;
        text-align: center;
    }
    
    /* Cải thiện kích thước chữ (Touch Targets) trên mobile */
    .thx-ec-text-block, 
    .thx-ec-text-clone {
        font-size: 1.05rem; /* ~16.8px */
        line-height: 1.7;
    }
}