/* Giao diện Học sinh - EZ Listening Practice */

.ez-listening-container {
    border: 1px solid #e1e8ed;
    padding: 30px;
    border-radius: 12px;
    background: #ffffff;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #333333;
    box-sizing: border-box;
}

/* --- TRÌNH PHÁT NHẠC MÀU XANH LÁ (STICKY MODE) --- */
.ez-custom-player {
    background: linear-gradient(135deg, #00b05a 0%, #00904a 100%);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 52px;
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 20px;
    z-index: 999;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 144, 74, 0.3);
    box-sizing: border-box;
    width: 100%;
}

.ez-play-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-right: 15px !important;
    width: 36px;
    height: 36px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    flex-shrink: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.ez-play-btn:hover {
    transform: scale(1.1);
    opacity: 0.95;
}

.ez-play-btn svg {
    width: 24px;
    height: 24px;
    display: block;
}

.ez-seek-bar {
    -webkit-appearance: none;
    appearance: none;
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin: 0;
    margin-right: 15px;
    transition: background 0.1s;
}

/* Thanh tua nhạc trên Chrome/Safari */
.ez-seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.ez-seek-bar::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.ez-time-display {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 45px;
    text-align: right;
}

/* --- GIAO DIỆN ĐIỀN TỪ (GAP FILL) --- */
.ez-gap-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a202c;
}

.ez-gap-content-area {
    line-height: 2.0 !important;
    font-size: 16px;
    white-space: pre-wrap;
    color: #2d3748;
}

.ez-gap-input {
    border: none !important;
    border-bottom: 2px dotted #a0aec0 !important;
    background: transparent !important;
    padding: 0 4px !important;
    margin: 0 4px !important;
    color: #2b6cb0 !important;
    font-weight: 600 !important;
    font-size: 17px !important;
    text-align: center !important;
    outline: none !important;
    display: inline-block !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    height: auto !important;
    min-height: unset !important;
    transition: all 0.2s;
}

.ez-gap-input:focus {
    border-bottom-style: solid !important;
    border-bottom-color: #00904a !important;
    background-color: rgba(0, 144, 74, 0.05) !important;
}

/* Trạng thái chấm điểm Đúng / Sai */
.ez-gap-input.correct {
    border-bottom: 2px solid #38a169 !important;
    color: #2f855a !important;
    background-color: #f0fff4 !important;
}

.ez-gap-input.wrong {
    border-bottom: 2px solid #e53e3e !important;
    color: #9b2c2c !important;
    background-color: #fff5f5 !important;
}

.ez-gap-example {
    font-style: italic;
    color: #718096;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 6px;
    margin: 0 4px;
    font-weight: 500;
}

/* Ngân hàng từ vựng (Word Bank) */
.ez-word-bank-wrap {
    margin-top: 25px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 15px;
}

.ez-word-bank-label {
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ez-word-bank {
    background: #f7fafc;
    border: 1px dashed #cbd5e0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.ez-bank-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #4a5568;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    user-select: none;
    transition: all 0.2s;
}

.ez-bank-item:hover {
    border-color: #00904a;
    color: #00904a;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.ez-bank-item.active {
    border-color: #00904a;
    background-color: #e6fffa;
    color: #00904a;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 144, 74, 0.1);
}

.ez-bank-item.used {
    opacity: 0.35;
    pointer-events: none;
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #a0aec0;
}

/* --- GIAO DIỆN TRẮC NGHIỆM (QUIZ) --- */
.ez-quiz-list {
    margin-top: 10px;
}

.ez-quiz-item {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
    transition: background 0.3s;
    border-radius: 6px;
    padding-left: 10px;
    padding-right: 10px;
}

.ez-quiz-item.correct {
    background-color: #f0fff4;
    border-bottom-color: #c6f6d5;
}

.ez-quiz-item.wrong {
    background-color: #fff5f5;
    border-bottom-color: #fed7d7;
}

.ez-quiz-question {
    font-weight: 600;
    font-size: 16px;
    color: #2d3748;
    margin-bottom: 12px;
    line-height: 1.5;
}

.ez-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Dàn hàng ngang trên màn hình lớn nếu phương án ngắn */
@media (min-width: 600px) {
    .ez-quiz-options {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .ez-quiz-option {
        flex: 1;
        min-width: 150px;
    }
}

.ez-quiz-option {
    display: flex !important;
    align-items: center !important;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s;
    user-select: none;
    box-sizing: border-box;
}

.ez-quiz-option:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.ez-quiz-option.selected {
    border-color: #3182ce;
    background-color: #ebf8ff;
    color: #2b6cb0;
    font-weight: 600;
}

.ez-quiz-option input[type="radio"] {
    margin: 0 10px 0 0 !important;
    padding: 0 !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
}

/* Kết quả chấm điểm Trắc Nghiệm */
.ez-quiz-option.correct-choice {
    border-color: #38a169 !important;
    background-color: #c6f6d5 !important;
    color: #22543d !important;
}

.ez-quiz-option.wrong-choice {
    border-color: #e53e3e !important;
    background-color: #fed7d7 !important;
    color: #742a2a !important;
}

/* --- PHẦN ĐIỀU KHIỂN & KẾT QUẢ --- */
.ez-controls-section {
    margin-top: 30px;
    border-top: 1px solid #edf2f7;
    padding-top: 25px;
    text-align: center;
}

.ez-check-btn {
    background: #3182ce !important;
    color: #ffffff !important;
    border: none !important;
    padding: 12px 30px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(49, 130, 206, 0.2);
    transition: all 0.2s;
}

.ez-check-btn:hover {
    background: #2b6cb0 !important;
    box-shadow: 0 6px 12px rgba(49, 130, 206, 0.3);
    transform: translateY(-1px);
}

.ez-check-btn:active {
    transform: translateY(0);
}

/* Con dấu kết quả (Stamp Effect) */
.ez-result-stamp {
    display: none;
    margin-top: 20px;
    padding: 8px 25px;
    border: 3px double #e53e3e;
    border-radius: 8px;
    color: #e53e3e;
    font-size: 20px;
    font-weight: 800;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    transform: rotate(-3deg);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.1);
}

/* --- TAPESCRIPT --- */
.ez-tapescript-wrapper {
    margin-top: 25px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 15px;
}

.ez-tapescript-toggle {
    background: transparent !important;
    border: none !important;
    color: #4a5568 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer;
    padding: 0 !important;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.ez-tapescript-toggle:hover {
    color: #00904a;
}

.ez-tapescript-content {
    margin-top: 15px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    color: #2d3748;
    border-left: 4px solid #00904a;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
    white-space: pre-wrap; /* Giữ nguyên xuống dòng của hội thoại gốc */
}

/* Đảm bảo responsive mobile */
@media (max-width: 600px) {
    .ez-listening-container {
        padding: 15px;
    }
    .ez-gap-content-area {
        font-size: 15px;
        line-height: 2.6;
    }
    .ez-custom-player {
        padding: 0 12px;
        top: 10px;
    }
    .ez-time-display {
        font-size: 11px;
        min-width: 35px;
    }
}
