/* =========================================
   1. CORE POPUP STYLES
   ========================================= */
#thx-ec-custom-dict-popup {
    display: none;
    position: fixed;
    z-index: 2147483647;
    width: 400px;
    max-width: 90vw;
    height: 500px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0e0e0;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    animation: thx-ec-fade-in 0.2s ease-out;
}

#thx-ec-custom-dict-popup[style*="display: block"] {
    display: flex !important;
}

@keyframes thx-ec-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HEADER */
.thx-ec-dict-header {
    flex: 0 0 48px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thx-ec-dict-title {
    font-weight: 800;
    font-size: 13px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 5px;
}

/* Nút Đóng - Vuông, bo góc */
.thx-ec-dict-close {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #999;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.thx-ec-dict-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.thx-ec-dict-close svg {
    display: block;
}

/* BODY */
.thx-ec-dict-body {
    flex: 1 1 auto;
    width: 100%;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f9f9f9;
}

.thx-ec-dict-body::-webkit-scrollbar {
    width: 6px;
}

.thx-ec-dict-body::-webkit-scrollbar-track {
    background: #f9f9f9;
}

.thx-ec-dict-body::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

/* --- NAVIGATION BAR --- */
.thx-ec-dict-nav-bar {
    display: flex; align-items: center;
    padding: 10px 15px;
    background-color: #f7f9fa;
    border-bottom: 1px solid #e1e8ed;
    color: #555; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.2s;
}
.thx-ec-dict-nav-bar:hover { background-color: #eef3f7; color: #0073aa; }
.thx-ec-dict-nav-bar b { color: #333; margin-left: 4px; }

/* LOADING */
.thx-ec-dict-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    background: #fff;
    color: #888;
    font-size: 14px;
    /* animation: thx-ec-fade-in 0.3s ease-out; */
}

.thx-ec-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f2f5;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: thx-ec-spin 0.8s linear infinite;
    margin-bottom: 15px;
}

.thx-ec-loading-text {
    font-weight: 500;
    color: #666;
}

.thx-ec-loading-text b {
    color: #0073aa;
}

@keyframes thx-ec-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* MOBILE */
@media (max-width: 600px) {
    #thx-ec-custom-dict-popup {
        width: 100% !important;
        max-width: 100% !important;
        height: 70vh !important;
        top: auto !important;
        left: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 20px 20px 0 0;
        border: none;
        box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.15);
        animation: thx-ec-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes thx-ec-slide-up {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .thx-ec-dict-close {
        width: 40px;
        height: 40px;
    }
}

/* OVERRIDE LABAN CONTENT */
.thx-ec-laban-content #lbdictex_find_popup {
    width: 90% !important;
    height: auto !important;
    border: none !important;
    position: static !important;
    box-shadow: none !important;
    background: transparent !important;
}

.thx-ec-laban-content .popup_details {
    padding: 0 20px 40px 20px !important;
    height: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.thx-ec-laban-content .input_box,
.thx-ec-laban-content .footer,
.thx-ec-laban-content .popup_powered,
.thx-ec-laban-content .clr {
    display: none !important;
}

.lbexpopup {
    float: left !important;
}

/* TABS */
.thx-ec-laban-content .tab.tab-popup {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 -20px 20px -20px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 20px;
}

.thx-ec-laban-content .tab.tab-popup a {
    flex: 1;
    max-width: 80px;
    text-align: center;
    padding: 7px 0;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    border-radius: 30px !important;
    background: #f0f2f5;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.thx-ec-laban-content .tab.tab-popup a:hover {
    background: #e4e6eb;
}

.thx-ec-laban-content .tab.tab-popup a.active {
    background: #0073aa;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0, 115, 170, 0.3);
}

/* WORD HEADER */
.thx-ec-laban-content .world.word_en {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.thx-ec-laban-content h2 {
    font-size: 26px;
    font-weight: 800;
    color: #222;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.thx-ec-laban-content .color-black,
.thx-ec-laban-content .color-orange {
    font-family: "Lucida Sans Unicode", sans-serif;
    color: #666;
    font-weight: 400;
    font-size: 15px;
    margin-left: 8px;
}

/* AUDIO */
.thx-ec-laban-content .fl {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.thx-ec-laban-content .sp_uk,
.thx-ec-laban-content .sp_us {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    background: #fff;
    border: 1px solid #ddd;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 50px;
}

.thx-ec-laban-content .sp_uk:hover,
.thx-ec-laban-content .sp_us:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #f0f7fc;
}

.thx-ec-laban-content .sp_uk::before {
    content: "\1F50A UK";
    font-size: 11px;
    margin-right: 0;
}

.thx-ec-laban-content .sp_us::before {
    content: "\1F50A US";
    font-size: 11px;
    margin-right: 0;
}

.thx-ec-laban-content .sp_uk,
.thx-ec-laban-content .sp_us {
    font-size: 0;
}

.thx-ec-laban-content .sp_uk::before,
.thx-ec-laban-content .sp_us::before {
    font-size: 11px;
    visibility: visible;
}

/* CONTENT */
.thx-ec-laban-content .content {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.thx-ec-laban-content .content a {
    pointer-events: none !important;
    color: inherit !important;
    text-decoration: none !important;
}

.thx-ec-laban-content .bg-grey {
    background: #f9f9f9;
    padding: 5px 10px;
    color: #333;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    margin: 20px 0 15px 0;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
    display: inline-block;
}

.thx-ec-laban-content .green.bold {
    color: #27ae60;
    font-weight: 600;
    font-size: 16px;
    margin-top: 15px;
    display: block;
}

/* .thx-ec-laban-content .green.bold::before { content: "•"; color: #27ae60; margin-right: 8px; font-weight: bold; } */
.thx-ec-laban-content .color-light-blue {
    color: #444;
    margin-left: 20px;
    margin-top: 6px;
    display: block;
    font-family: "Georgia", serif;
    font-style: italic;
}

.thx-ec-laban-content .margin25 {
    margin-left: 20px;
    color: #777;
    font-size: 14px;
    margin-top: 2px;
}

.thx-ec-laban-content .bold.dot-blue {
    color: #8e44ad;
    font-weight: 700;
    margin-top: 20px;
    display: block;
    border-bottom: 1px dashed #d2b4de;
    padding-bottom: 2px;
}

/* RELATED WORDS */
.thx-ec-laban-content span:has(> a[href*="find?"]) {
    font-size: inherit;
    color: #666;
}

.thx-ec-laban-content span strong {
    display: block;
    margin-top: 25px;
    margin-bottom: 5px;
    font-size: 13px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.thx-ec-laban-content a[href*="find?"] {
    display: inline-block;
    color: #0073aa !important;
    font-size: 14px;
    text-decoration: none;
    margin-right: 8px;
    margin-bottom: 5px;
    pointer-events: auto !important;
}

.thx-ec-laban-content a[href*="find?"]:hover {
    text-decoration: underline;
    color: #d32f2f !important;
}