/**
 * mp-subtitles.css
 * MODULE STYLE: OVERLAY & TRANSCRIPT
 * ----------------------------------
 * [FIXED] Subtitles scale slightly (fixed px) in Fullscreen for 13-15" laptops.
 */

/* =========================================
   1. OVERLAY SUBTITLES (CHẾ ĐỘ NHÚNG)
   ========================================= */

.thx-ec-mp__embedded-subtitles {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    padding: 12px 24px;
    border-radius: 12px;
    margin: 0 auto 30px auto;
    max-width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease-out;
    z-index: 25;
    
    /* Chặn select text */
    user-select: none;
    -webkit-user-select: none;
}

/* Typography mặc định khi ở trong trang */
.thx-ec-mp__sub-en { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 4px; text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
.thx-ec-mp__sub-ipa { color: #fcd34d; font-size: 15px; font-style: italic; margin-bottom: 2px; opacity: 0.95; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.thx-ec-mp__sub-vi { color: #e2e8f0; font-size: 16px; font-weight: 400; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

/* Ẩn Text Box khi không phải chế độ Nhúng */
.thx-ec-mp--mode-split .thx-ec-mp__embedded-subtitles,
.thx-ec-mp--mode-video-text .thx-ec-mp__embedded-subtitles { display: none !important; }

/* -----------------------------------------------------------
   LOGIC TĂNG KÍCH THƯỚC CỐ ĐỊNH KHI FULLSCREEN (FIXED PX)
   Chỉ tăng khoảng 4-5px để vừa mắt trên màn hình laptop 13-15"
   ----------------------------------------------------------- */

.thx-ec-mp:fullscreen .thx-ec-mp__embedded-subtitles,
.thx-ec-mp:-webkit-full-screen .thx-ec-mp__embedded-subtitles {
    padding: 18px 32px; 
    border-radius: 14px;
    margin-bottom: 40px; 
}

/* Tăng font-size thêm một chút bằng giá trị px cố định */
.thx-ec-mp:fullscreen .thx-ec-mp__sub-en,
.thx-ec-mp:-webkit-full-screen .thx-ec-mp__sub-en {
    font-size: 23px; /* Gốc 18px -> Tăng 5px */
    margin-bottom: 6px;
}

.thx-ec-mp:fullscreen .thx-ec-mp__sub-ipa,
.thx-ec-mp:-webkit-full-screen .thx-ec-mp__sub-ipa {
    font-size: 19px; /* Gốc 15px -> Tăng 4px */
    margin-bottom: 4px;
}

.thx-ec-mp:fullscreen .thx-ec-mp__sub-vi,
.thx-ec-mp:-webkit-full-screen .thx-ec-mp__sub-vi {
    font-size: 20px; /* Gốc 16px -> Tăng 4px */
}


/* =========================================
   2. TRANSCRIPT PANEL (CHẾ ĐỘ RỜI)
   ========================================= */

.thx-ec-mp__transcript {
    display: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow-y: auto;
    height: 100%; max-height: 500px;
    position: absolute; top: 0; bottom: 0; right: 0; width: 35%;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

@media (max-width: 849px) {
    .thx-ec-mp__transcript { position: relative; width: 100%; height: 350px; }
}

.thx-ec-mp__transcript::-webkit-scrollbar { width: 6px; }
.thx-ec-mp__transcript::-webkit-scrollbar-track { background: transparent; }
.thx-ec-mp__transcript::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }

/* Item */
.thx-ec-mp__transcript-item {
    padding: 12px 14px; 
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer; transition: all 0.2s; position: relative;
}
.thx-ec-mp__transcript-item:last-child { border-bottom: none; }
.thx-ec-mp__transcript-item:hover { background-color: #f8fafc; }

.thx-ec-mp__transcript-item.is-active {
    background-color: #eff6ff; border-left: 4px solid #3b82f6; padding-left: 10px;
}

/* Typography */
.thx-ec-mp__transcript-en { font-size: 16px; font-weight: 600; color: #1e293b; margin-bottom: 4px; line-height: 1.4; }
.thx-ec-mp__transcript-ipa { font-size: 14px; color: #b45309; font-style: italic; margin-bottom: 2px; }
.thx-ec-mp__transcript-vi { font-size: 15px; color: #64748b; }

/* Loop Button */
.thx-ec-mp__loop-btn {
    position: absolute; top: 50%; right: 5px; 
    transform: translateY(-50%);
    width: 24px; height: 24px; border-radius: 50%;
    border: 1px solid #e2e8f0; background: #fff;
    color: #94a3b8; display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transition: all 0.2s;
    z-index: 5;
}
.thx-ec-mp__play-once-btn {
    position: absolute; top: 50%; right: 35px; 
    transform: translateY(-50%);
    width: 24px; height: 24px; border-radius: 50%;
    border: 1px solid #e2e8f0; background: #fff;
    color: #94a3b8; display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transition: all 0.2s;
    z-index: 5; font-size: 10px; font-weight: bold;
}
.thx-ec-mp__loop-btn::before { content: "↻"; font-weight: bold; font-size: 12px; }
.thx-ec-mp__transcript-item:hover .thx-ec-mp__loop-btn,
.thx-ec-mp__transcript-item:hover .thx-ec-mp__play-once-btn { opacity: 1; }
.thx-ec-mp__play-once-btn:hover { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.thx-ec-mp__loop-btn:hover { background: #22c55e; border-color: #22c55e; color: #fff; }
.thx-ec-mp__transcript-item.is-looping { background-color: #f0fdf4; border-left-color: #22c55e; }
.thx-ec-mp__transcript-item.is-looping .thx-ec-mp__loop-btn { opacity: 1; background: #22c55e; border-color: #22c55e; color: #fff; }

.thx-ec-mp__transcript-item.is-playing-once { background-color: #eff6ff; border-left-color: #3b82f6; }
.thx-ec-mp__transcript-item.is-playing-once .thx-ec-mp__play-once-btn { opacity: 1; background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* Visibility Toggles */
.thx-ec-mp.thx-ec-mp--hide-ipa .thx-ec-mp__sub-ipa, .thx-ec-mp.thx-ec-mp--hide-ipa .thx-ec-mp__transcript-ipa { display: none !important; }
.thx-ec-mp.thx-ec-mp--hide-vi .thx-ec-mp__sub-vi, .thx-ec-mp.thx-ec-mp--hide-vi .thx-ec-mp__transcript-vi { display: none !important; }

/* =========================================
   MOBILE RESPONSIVE (EMBEDDED SUBTITLES)
   ========================================= */
@media (max-width: 600px) {
    .thx-ec-mp__embedded-subtitles {
        padding: 6px 12px;
        margin-bottom: 10px;
        border-radius: 8px;
    }
    
    .thx-ec-mp__sub-en {
        font-size: 14px;
        margin-bottom: 2px;
    }
    
    .thx-ec-mp__sub-ipa {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .thx-ec-mp__sub-vi {
        font-size: 13px;
    }
}