/* =========================================
   1. CORE POPUP STYLES
   ========================================= */
#lelh-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: lelh-fade-in 0.2s ease-out;
}
#lelh-custom-dict-popup[style*="display: block"] { display: flex !important; }
@keyframes lelh-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* HEADER */
.lelh-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;
}
.lelh-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 */
.lelh-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;
}
.lelh-dict-close:hover { background-color: #f0f0f0; color: #333; }
.lelh-dict-close svg { display: block; }

/* BODY */
.lelh-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;
}
.lelh-dict-body::-webkit-scrollbar { width: 6px; }
.lelh-dict-body::-webkit-scrollbar-track { background: #f9f9f9; }
.lelh-dict-body::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 3px; }

/* --- BACK NAVIGATION BAR --- */
.lelh-dict-back-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;
}
.lelh-dict-back-bar:hover { background-color: #eef3f7; color: #0073aa; }
.lelh-dict-back-bar svg { width: 16px; height: 16px; margin-right: 6px; fill: currentColor; }
.lelh-dict-back-bar b { color: #333; margin-left: 4px; }

/* LOADING */
.lelh-dict-loading {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    height: 100%; background: #fff; color: #888; font-size: 14px; /* animation: lelh-fade-in 0.3s ease-out; */
}
.lelh-loading-spinner {
    width: 40px; height: 40px; border: 3px solid #f0f2f5; border-top: 3px solid #0073aa;
    border-radius: 50%; animation: lelh-spin 0.8s linear infinite; margin-bottom: 15px;
}
.lelh-loading-text { font-weight: 500; color: #666; }
.lelh-loading-text b { color: #0073aa; }
@keyframes lelh-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* MOBILE */
@media (max-width: 600px) {
    #lelh-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: lelh-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes lelh-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .lelh-dict-close { width: 40px; height: 40px; } 
}

/* OVERRIDE LABAN CONTENT */
.lelh-laban-content #lbdictex_find_popup { width: 90% !important; height: auto !important; border: none !important; position: static !important; box-shadow: none !important; background: transparent !important; }
.lelh-laban-content .popup_details { padding: 0 20px 40px 20px !important; height: auto !important; width: 100% !important; box-sizing: border-box !important; }
.lelh-laban-content .input_box, .lelh-laban-content .footer, .lelh-laban-content .popup_powered, .lelh-laban-content .clr { display: none !important; }
.lbexpopup { float: left !important; }

/* TABS */
.lelh-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;
}
.lelh-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;
}
.lelh-laban-content .tab.tab-popup a:hover { background: #e4e6eb; }
.lelh-laban-content .tab.tab-popup a.active { background: #0073aa; color: #fff; box-shadow: 0 3px 8px rgba(0, 115, 170, 0.3); }

/* WORD HEADER */
.lelh-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; }
.lelh-laban-content h2 { font-size: 26px; font-weight: 800; color: #222; margin: 0 0 10px 0; line-height: 1.2; }
.lelh-laban-content .color-black, .lelh-laban-content .color-orange { font-family: "Lucida Sans Unicode", sans-serif; color: #666; font-weight: 400; font-size: 15px; margin-left: 8px; }

/* AUDIO */
.lelh-laban-content .fl { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.lelh-laban-content .sp_uk, .lelh-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;
}
.lelh-laban-content .sp_uk:hover, .lelh-laban-content .sp_us:hover { border-color: #0073aa; color: #0073aa; background: #f0f7fc; }
.lelh-laban-content .sp_uk::before { content: "\1F50A UK"; font-size: 11px; margin-right: 0; }
.lelh-laban-content .sp_us::before { content: "\1F50A US"; font-size: 11px; margin-right: 0; }
.lelh-laban-content .sp_uk, .lelh-laban-content .sp_us { font-size: 0; }
.lelh-laban-content .sp_uk::before, .lelh-laban-content .sp_us::before { font-size: 11px; visibility: visible; }

/* CONTENT */
.lelh-laban-content .content { font-size: 15px; line-height: 1.6; color: #333; }
.lelh-laban-content .content a { pointer-events: none !important; color: inherit !important; text-decoration: none !important; }

.lelh-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;
}
.lelh-laban-content .green.bold { color: #27ae60; font-weight: 600; font-size: 16px; margin-top: 15px; display: block; }
/* .lelh-laban-content .green.bold::before { content: "•"; color: #27ae60; margin-right: 8px; font-weight: bold; } */
.lelh-laban-content .color-light-blue { color: #444; margin-left: 20px; margin-top: 6px; display: block; font-family: "Georgia", serif; font-style: italic; }
.lelh-laban-content .margin25 { margin-left: 20px; color: #777; font-size: 14px; margin-top: 2px; }
.lelh-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 */
.lelh-laban-content span:has(> a[href*="find?"]) { font-size: inherit; color: #666; }
.lelh-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;
}
.lelh-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;
}
.lelh-laban-content a[href*="find?"]:hover { text-decoration: underline; color: #d32f2f !important; }