/* =========================
   EXAM UI — ĐỒNG BỘ INDEX UI
   GIỮ NGUYÊN LOGIC + SIZE
========================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;

    /* 🔥 FONT ĐỒNG BỘ INDEX */
    font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}

:root{

    /* =========================
       INDEX COLOR SYSTEM
    ========================= */

    --blue-main:#2563eb;
    --blue-dark:#1d4ed8;

    --blue-soft:#eff6ff;
    --blue-border:#dbeafe;

    --text-main:#0f172a;
    --text-soft:#64748b;

    --green:#10b981;

    --white:#ffffff;

    --bg-main:#f8fbff;

    --card-bg:#ffffff;

    --shadow-soft:
    0 10px 30px rgba(37,99,235,0.06);

    --shadow-hover:
    0 14px 36px rgba(37,99,235,0.12);

    --header-gradient:
    linear-gradient(
        135deg,
        #0f172a 0%,
        #162d63 45%,
        #2563eb 100%
    );
}


/* =========================
   FONT GLOBAL
========================= */

html{
    font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;

    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

body{

    background:var(--bg-main);

    color:var(--text-main);

    font-family:inherit;
}

/* 🔥 FIX TOÀN BỘ FORM CONTROL */
button,
input,
textarea,
select,
label,
a,
span,
div{
    font-family:inherit;
}

/* 🔥 FIX TIMER FONT */
.timer-box,
#timer{
    font-family:inherit !important;
}

#timer{
    font-variant-numeric:tabular-nums;
    font-feature-settings:"tnum";
}

/* =========================
   PAGE
========================= */

.exam-page{

    min-height:100vh;

    overflow:visible;

    background:
    radial-gradient(
        circle at top left,
        rgba(37,99,235,0.04),
        transparent 30%
    ),
    var(--bg-main);
    border-radius:var(--bg-radius);
}

/* =========================
   HEADER
========================= */

.exam-header{

    height:64px;

    background:var(--header-gradient);

    border-bottom:
    1px solid rgba(255,255,255,0.08);

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 14px;

    position:fixed;

    top:0;
    left:0;
    right:0;

    z-index:999;

    backdrop-filter:blur(14px);

    box-shadow:
    0 10px 30px rgba(15,23,42,0.24);
}

.header-left,
.header-right{

    display:flex;

    align-items:center;

    gap:10px;
}

/* =========================
   TOP BUTTON
========================= */

.top-btn{

    height:42px;

    padding:0 18px;

    border-radius:14px;

    border:
    1px solid rgba(255,255,255,0.14);

    background:
    rgba(255,255,255,0.08);

    backdrop-filter:blur(10px);

    color:white;

    font-size:14px;

    font-weight:700;

    cursor:pointer;

    text-decoration:none;

    display:flex;

    align-items:center;

    justify-content:center;

    transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;

    letter-spacing:0.1px;
}

.top-btn:hover{

    background:
    rgba(255,255,255,0.16);

    transform:translateY(-1px);

    box-shadow:
    0 8px 18px rgba(255,255,255,0.08);
}

.active-mode{

    background:
    linear-gradient(
        135deg,
        #3b82f6,
        #2563eb
    ) !important;

    color:white !important;

    border:none !important;

    box-shadow:
    0 10px 22px rgba(37,99,235,0.34);
}

/* =========================
   START BUTTON
========================= */

.exam-start-btn{

    background:
    linear-gradient(
        135deg,
        #f59e0b,
        #d97706
    ) !important;

    color:white;

    border:none;

    font-weight:800;

    box-shadow:
    0 10px 24px rgba(245,158,11,0.24);
}

.exam-start-btn:hover{

    transform:translateY(-1px);

    opacity:0.98;
}

/* =========================
   SUBMIT BUTTON
========================= */

.submit-btn{

    background:
    linear-gradient(
        135deg,
        #10b981,
        #059669
    );

    color:white;

    border:none;

    font-weight:800;

    box-shadow:
    0 10px 24px rgba(16,185,129,0.22);
}

.submit-btn:hover{

    opacity:0.97;
}

/* =========================
   TIMER
========================= */

.timer-box{

    height:42px;

    padding:0 18px;

    border-radius:14px;

    background:
    rgba(255,255,255,0.10);

    border:
    1px solid rgba(255,255,255,0.14);

    display:flex;

    align-items:center;

    gap:8px;

    font-size:18px;

    font-weight:800;

    color:white;

    backdrop-filter:blur(8px);
}

.swal-title-sm{
    font-size:1.35rem !important;
    font-weight:700 !important;
    line-height:1.3 !important;
}

/* =========================
   SWEETALERT MOBILE COMPACT
========================= */
@media (max-width:768px){

    .swal2-popup{
        width:88% !important;
        padding:1rem !important;
        border-radius:14px !important;
    }

    .swal-title-sm{
        font-size:.96rem !important;
        font-weight:700 !important;
        line-height:1.25 !important;
        margin-bottom:.25rem !important;
    }

    .swal2-html-container{
        font-size:.82rem !important;
        line-height:1.5 !important;
        margin:.45rem 0 0 !important;
    }

    .swal2-actions{
        margin-top:.8rem !important;
        gap:6px !important;
    }

    .swal2-confirm,
    .swal2-cancel{
        font-size:.8rem !important;
        padding:.48rem 1rem !important;
        border-radius:9px !important;
        min-width:92px !important;
    }

}
/* =========================
   CONTAINER
========================= */

.exam-container{

    display:flex;

    gap:16px;

    padding:0 !important;
    margin:0 !important;

    height:auto;

    min-height:calc(100vh - 64px);

    overflow:visible;
}

/* =========================
   LEFT
========================= */

.exam-left{

    flex:1 1 auto;

    min-width:0;

    width:100%;

    overflow:visible;

    padding-right:0;

}

/* =========================
   RIGHT SIDEBAR
========================= */

.exam-right{

    width:285px;

    background:
    rgba(255,255,255,0.92);

    backdrop-filter:blur(16px);

    border-radius:24px;

    padding:18px;

    overflow-y:auto;

    border:
    1px solid rgba(219,234,254,0.9);

    box-shadow:
    var(--shadow-soft);
}

/* =========================
   QUESTION CARD
========================= */

.question-card{

    background:var(--card-bg);

    border:
    1px solid rgba(219,234,254,0.95);

    border-radius:26px;

    padding:20px;

    margin-bottom:10px;

    box-shadow:
    var(--shadow-soft);

    min-height:auto;

    transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.question-card:hover{

    box-shadow:
    var(--shadow-hover);
}


/* =========================
   QUESTION TOP
========================= */

.question-top{

    display:flex;

    justify-content:space-between;

    align-items:flex-start;
}

.display-mode{

    font-size:11px;

    font-weight:800;

    letter-spacing:0.7px;

    color:#64748b;

    margin-bottom:6px;
}

.big-title{

    font-size:27px;

    font-weight:900;

    color:#0f172a;

    line-height:1.08;

    margin-bottom:3px;
}

.sub-title{

    font-size:12px;

    color:var(--text-soft);

    line-height:1.5;
}

.question-status {
    background: transparent;
    border: none;
    color: #0f172a;
    min-width: 40px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    box-shadow: none;
}

@media (max-width: 768px) {
    .question-status {
        display: none !important;
    }
}
/* =========================
   TAG
========================= */

/* =========================
   TAG ROW - GỌN & CÂN ĐỐI
========================= */

.tag-row {

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 6px;

    margin: 10px 0 12px;

}


/* TAG CHUNG */

.tag {

    padding: 0;

    margin: 0;

    background: none;

    border: none;

    border-radius: 0;

    color: #315ca8;

    font-size: 12px;

    font-weight: 700;

    line-height: 1.4;

}


/* LOẠI CÂU HỎI */

.blue-tag {

 color: #315ca8;

}


/* DẤU NGĂN CÁCH */

.tag + .tag::before {

    content: "|";

    color: #010d1d;

    margin-right: 6px;

    font-weight: 400;

}

/* =========================
   MOBILE - TAG 1 DÒNG
========================= */

@media (max-width: 768px) {

    .tag-row {

        display: flex;

        flex-wrap: nowrap;

        align-items: center;

        width: 100%;

        white-space: nowrap;

        overflow: hidden;

        margin: 8px 0 10px;

        gap: 0;

    }

    .tag {

        font-size: 9px;

        line-height: 1.3;

        white-space: nowrap;

        flex-shrink: 1;

    }

    .blue-tag {

        font-size: 9px;

        white-space: nowrap;

    }

    /* DẤU | SÁT HAI BÊN */

    .tag + .tag::before {

        content: "|";

        margin: 0 5px;

        color: #010d1d;

        font-weight: 400;

    }

}
/* =========================
   QUESTION TEXT
========================= */

/* =========================
   QUESTION TEXT & CODE BLOCKS
========================= */

.question-text {
    font-size: 18px;
    line-height: 1.6;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
    padding: 0;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Nhãn ngôn ngữ (Python, C++, HTML...) */
.question-text .code-lang-label {
    font-style: italic;
    font-weight: bold;
    margin-top: 8px !important;
    margin-bottom: 2px !important;
    color: #475569;
    font-size: 16px;
}

/* Khối Code Consolas ôm sát nội dung, nền trong suốt */

.question-text .code-block {

    font-family: 'Consolas', 'Courier New', Courier, monospace !important;

    background-color: transparent !important;

    border: 1px solid #e2e8f0;

    border-left: 4px solid #2563eb;

    border-radius: 6px;

    padding: 8px 12px !important;

    margin: 4px 0 8px 0 !important;

    line-height: 1.4;

    font-size: 14px;

    color: #0f172a;

    overflow-x: auto;

    white-space: pre;
}


.question-text .code-block code {

    font-family: inherit;

    display: block;

    margin: 0 !important;

    padding: 0 !important;

    font-weight: 400;

    background: transparent !important;

}

/* =========================
   ĐỊNH DẠNG CHUẨN ĐOÀN VĂN / DÒNG VĂN BẢN (FIX DÍNH CHÙM)
========================= */
.question-text .text-line,
.text-line {
    display: block !important;       /* Ép mỗi dòng thành một khối riêng biệt, chống dính chùm 100% */
    width: 100% !important;
    margin: 4px 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
    font-weight: 700 !important;     /* Giữ nguyên độ đậm cho chữ câu hỏi */
    word-wrap: break-word !important;
    white-space: normal !important;  /* Bắt buộc trình duyệt xuống dòng bình thường, không gom ngang */
}

.text-line {
    margin: 4px 0 !important;
    padding: 0 !important;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Tự động ép các dòng liệt kê ý nhỏ thụt lề và tách dòng rõ ràng */
.text-line:has-text("-"), 
.text-line {
    text-indent: 0;
}

/* Nếu dòng bắt đầu bằng dấu gạch ngang, tạo lề trái nhẹ cho đẹp mắt */
.text-line[style*="margin-left"] {
    display: block !important;
    margin-left: 16px !important;
    font-weight: 600 !important;
}

/* =========================
   ANSWER ITEM
========================= */

.answer-item{

    display:flex;

    align-items:center;

    gap:13px;

    border:
    1.5px solid #dbeafe;

    background:white;

    border-radius:18px;

    padding:12px 12px;

    margin-bottom:8px;

    cursor:pointer;

    transition:0.2s ease;

    min-height:60px;
}

.answer-item:hover{

    border-color:#93c5fd;

    background:#f8fbff;

    box-shadow:
    0 8px 18px rgba(37,99,235,0.06);
}

.answer-item.active{

    border-color:#2563eb;

    background:#eef5ff;

    box-shadow:
    0 10px 20px rgba(37,99,235,0.08);
}

/* =========================
   ANSWER CIRCLE
========================= */

.answer-circle{

    width:42px;

    height:42px;

    border-radius:14px;

    background:#f8fbff;

    border:
    1.5px solid #dbeafe;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:18px;

    font-weight:900;

    color:#2563eb;

    flex-shrink:0;
}

/* =========================
   ANSWER TEXT
========================= */

.answer-text{

    font-size:18px;

    font-weight:400;

    line-height:1.45;

    color:#1e293b;
}

/* =========================
   SIDEBAR TITLE
========================= */

.sidebar-title {

    font-size: 16px;

    line-height: 1.15;

    font-weight: 900;

    color: #0f172a;

    margin-bottom: 8px;

    text-align: center;
}

.sidebar-sub{

    font-size:14px;

    line-height:1.5;

    color:#64748b;

    margin-bottom:18px;
}

/* =========================
   PART TITLE
========================= */

.part-title{

    background:#f8fbff;

    border:
    1px solid #dbeafe;

    border-radius:14px;

    padding:10px;

    text-align:center;

    color:#1d4ed8;

    font-size:13px;

    font-weight:800;

    margin-top:18px;

    margin-bottom:12px;
}

.p-title{

    background:#eef4fd;

    border:1px dashed #bfdbfe;

    border-radius:10px;

    padding:6px 10px;

    text-align:center;

    color:#694758;

    font-size:12px;

    font-style:italic;

    font-weight:500;

    line-height:1.4;

    margin:12px 0 10px;

}


.sidebar-info{

    margin:8px 0 6px;

    text-align:center;

    line-height:1.5;

}

.sidebar-exam-id{

    display:inline-block;

    padding:2px 8px;

    border-radius:999px;

    background:#eff6ff;

    border:1px solid #bfdbfe;

    color:#2563eb;

    font-size:12px;

    font-weight:700;

}

.sidebar-divider{

    margin:0 6px;

    color:#94a3b8;

}

.sidebar-exam-title{

    font-size:13px;

    font-weight:600;

    color:#334155;

}

.sidebar-note{

    text-align:center;

    font-size:12px;

    color:#64748b;

}
/* =========================
   GRID
========================= */

.question-grid{

    display:grid;

    grid-template-columns:
    repeat(5,1fr);

    gap:6px;
}

/* =========================
   QUESTION NAV
========================= */

.question-nav{

    height:36px;

    border-radius:10px;

    border:1.5px solid #dbeafe;

    background:white;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:13px;

    font-weight:800;

    color:#2563eb;

    cursor:pointer;

    transition:0.2s ease;

    user-select:none;
}

.question-nav:hover{

    border-color:#93c5fd;

    background:#f8fbff;

    transform:translateY(-1px);
}

.question-nav.current{

    background:
    linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );

    color:white;

    border:none;

    box-shadow:
    0 8px 18px rgba(37,99,235,0.22);
}

.question-nav.done{

    background:
    linear-gradient(
        135deg,
        #10b981,
        #059669
    );

    color:white;

    border:none;
}

/* =========================
   PROGRESS
========================= */

.progress-box{

    margin-top:0px;
}

.progress-title{

    font-size:14px;

    font-weight:300;

    color:#3b1e35;

    margin-bottom:12px;

    display:flex;

    justify-content:space-between;
}

.progress{

    width:100%;

    height:16px;

    background:#dbeafe;

    border-radius:999px;

    overflow:hidden;

    position:relative;

    border:
    1px solid #bfdbfe;
}

.progress-bar{

    height:100%;

    width:0%;

    border-radius:999px;

    background:
    linear-gradient(
        90deg,
        #2563eb,
        #3b82f6,
        #60a5fa
    );

    transition:
    width 0.35s ease;

    position:relative;

    overflow:hidden;
}

.progress-bar::after{

    content:"";

    position:absolute;

    inset:0;

    background:
    linear-gradient(
        120deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0) 100%
    );

    animation:
    progressGlow 2s linear infinite;
}

@keyframes progressGlow{

    from{
        transform:translateX(-100%);
    }

    to{
        transform:translateX(100%);
    }
}

/* =========================
   SCROLLBAR
========================= */

::-webkit-scrollbar{
    width:6px;
}

::-webkit-scrollbar-thumb{

    background:#cbdcfb;

    border-radius:999px;
}

/* =========================
   SINGLE MODE
========================= */

.question-page{
    display:none;
}

/* =========================
   SINGLE NAVIGATION
========================= */

.single-navigation{

    display:flex;

    gap:8px;

    margin-top:14px;
}

.single-nav-btn{

    flex:1;

    height:42px;

    border:none;

    border-radius:12px;

    cursor:pointer;

    font-size:12px;

    font-weight:800;

    color:white;

    transition:0.25s ease;

    display:flex;

    align-items:center;

    justify-content:center;

    padding:0 10px;

    background:
    linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );

    box-shadow:
    0 8px 22px rgba(37,99,235,0.20);
}

.single-nav-btn:hover{

    transform:translateY(-2px);

    box-shadow:
    0 12px 28px rgba(37,99,235,0.28);
}

.single-nav-btn:active{
    transform:scale(0.98);
}

.single-nav-btn.disabled{

    background:#dbeafe !important;

    color:#94a3b8 !important;

    cursor:not-allowed;

    box-shadow:none;

    opacity:0.85;
}

/* =========================
   TRUE FALSE
========================= */

.true-false-row{

    display:flex;

    align-items:center;

    justify-content:space-between;

    gap:14px;

    padding:14px 16px;

    margin-bottom:12px;

    border:1.5px solid #dbeafe;

    border-radius:18px;

    background:
    linear-gradient(
        135deg,
        #ffffff,
        #f8fbff
    );

    transition:0.2s ease;

    box-shadow:
    0 4px 14px rgba(37,99,235,0.04);
}

.true-false-row:hover{

    border-color:#93c5fd;

    transform:translateY(-1px);

    box-shadow:
    0 10px 20px rgba(37,99,235,0.08);
}

.tf-label{

    width:40px;
    height:40px;

    border-radius:12px;

    background:#eff6ff;

    border:1.5px solid #dbeafe;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:18px;

    font-weight:900;

    color:#2563eb;

    flex-shrink:0;
}

.tf-content{

    flex:1;

    font-size:18px;

    font-weight:400;

    line-height:1.5;

    color:#1e293b;
}

.tf-actions{

    display:flex;

    align-items:center;

    gap:8px;
}

.tf-btn{

    display:flex;

    align-items:center;

    justify-content:center;

    gap:8px;

    padding:10px 14px;

    border-radius:14px;

    border:1.5px solid #dbeafe;

    background:white;

    font-size:14px;

    font-weight:800;

    color:#2563eb;

    cursor:pointer;

    transition:0.2s ease;

    user-select:none;
}

.tf-btn:hover{

    border-color:#93c5fd;

    background:#f8fbff;
}

.tf-btn input:checked + span,
.tf-btn:has(input:checked){

    background:
    linear-gradient(
        135deg,
        #10b981,
        #059669
    );

    color:white;

    border:none;

    box-shadow:
    0 8px 18px rgba(16,185,129,0.18);
}

.tf-btn input{
    display:none;
}

/* =========================
   NOTE
========================= */

.phan2-note{

    margin-top:14px;

    padding:12px 14px;

    border-radius:14px;

    background:#eff6ff;

    border:1px dashed #bfdbfe;

    font-size:13px;

    font-weight:700;

    color:#1d4ed8;

    text-align:center;
}

/* =========================
   LOCKED
========================= */

.locked{

    pointer-events:none;

    opacity:0.4;
}

.sidebar-locked{

    opacity:0.35;

    filter:grayscale(0.3);

    pointer-events:none;

    user-select:none;
}

/* =========================
   OVERLAY
========================= */

.start-overlay,
.exam-overlay{

    position:fixed;

    inset:0;

    display:flex;

    align-items:center;

    justify-content:center;

    z-index:99999;
}

.start-overlay{

    background:rgba(0,0,0,0.6);
}

.exam-overlay{

    background:rgba(15,23,42,0.65);
}

.start-box{

    background:#fff;

    padding:25px;

    border-radius:16px;

    text-align:center;

    width:320px;

    box-shadow:
    0 20px 50px rgba(15,23,42,0.18);
}

/* =========================
   RESPONSIVE
========================= */

@media(max-width:1400px){

    .big-title{
        font-size:26px;
    }

    .question-text{
        font-size:20px;
    }

    .answer-text{
        font-size:17px;
    }

    .exam-right{
        width:255px;
    }

    .question-card{
        padding:18px;
    }

    .single-navigation{
        flex-direction:column;
    }

    .single-nav-btn{
        width:100%;
    }
}

/* =========================
   CORRECT ANSWER
========================= */

.tf-btn.user-correct{

    background:
        linear-gradient(
            135deg,
            #fff7cc,
            #ffe066
        ) !important;

    border:2px solid
        #f4b400 !important;

    box-shadow:
        0 0 0 3px rgba(244,180,0,0.15);

    color:#2563eb !important;
}

/* chữ luôn xanh */

.tf-btn.user-correct,
.tf-btn.user-correct *{

    color:#2563eb !important;
}

/* =========================
   ĐÁP ÁN ĐÚNG CÔNG BỐ
========================= */

.tf-btn.correct-answer{

    background:
        rgba(34,197,94,0.12);

    border:2px solid
        #22c55e;

    color:#2563eb !important;
}

/* =========================
   USER CHỌN SAI
========================= */

.tf-btn.user-wrong{

    background:
        rgba(239,68,68,0.15);

    border:2px solid
        #ef4444;

    color:#2563eb !important;
}

/* =========================
   ĐÁP ÁN KHÔNG ĐƯỢC CHỌN
========================= */

.tf-btn.dimmed-answer{

    opacity:0.35;

    filter:grayscale(20%);
}

/* LOCKED */

.locked{

    opacity:.5;
    pointer-events:none;
}

/* =========================
   ĐÁP ÁN ĐÚNG
========================= */

.correct-answer{

    position:relative;

    background:linear-gradient(
        135deg,
        #f0fdf4,
        #dcfce7
    ) !important;

    border:1px solid #16a34a !important;

    animation:
        correctBorder 2.5s ease-in-out infinite;

}


/* =========================
   USER CHỌN ĐÚNG
========================= */

.user-correct{

    position:relative;

    background:linear-gradient(
        135deg,
        #fffde7,
        #fef08a
    ) !important;

    border:1px solid #eab308 !important;

    animation:
        correctUserBorder 2.2s ease-in-out infinite;

}


/* =========================
   USER CHỌN SAI
========================= */

.user-wrong{

    position:relative;

    background:linear-gradient(
        135deg,
        #fff1f2,
        #fecaca
    ) !important;

    border:1px solid #dc2626 !important;

    animation:
        wrongBorder 2.2s ease-in-out infinite;

}


/* =========================
   VIỀN ĐÁP ÁN ĐÚNG
========================= */

@keyframes correctBorder{

    0%,
    100%{

        box-shadow:
            0 0 0 0
            rgba(22,163,74,0.15);

    }

    50%{

        box-shadow:
            0 0 0 3px
            rgba(22,163,74,0.12);

    }

}


/* =========================
   VIỀN USER CHỌN ĐÚNG
========================= */

@keyframes correctUserBorder{

    0%,
    100%{

        box-shadow:
            0 0 0 0
            rgba(234,179,8,0.15);

    }

    50%{

        box-shadow:
            0 0 0 3px
            rgba(234,179,8,0.16);

    }

}


/* =========================
   VIỀN USER CHỌN SAI
========================= */

@keyframes wrongBorder{

    0%,
    100%{

        box-shadow:
            0 0 0 0
            rgba(220,38,38,0.12);

    }

    50%{

        box-shadow:
            0 0 0 3px
            rgba(220,38,38,0.14);

    }

}

/* =========================
   ĐÁP ÁN KHÔNG ĐƯỢC ĐÁNH DẤU
========================= */

.dimmed-answer{

    opacity:0.45 !important;

    filter:saturate(0.65);

    transition:
        opacity 0.25s ease,
        filter 0.25s ease;

}


/* =========================
   KHÔNG LÀM MỜ ĐÁP ÁN ĐÚNG
========================= */

.correct-answer{

    opacity:1 !important;

    filter:none !important;

}


/* =========================
   KHÔNG LÀM MỜ ĐÁP ÁN USER CHỌN
========================= */

.user-correct,
.user-wrong{

    opacity:1 !important;

    filter:none !important;

}

.timer-locked{

    opacity:0.35;

    pointer-events:none;
}

.dimmed-answer{

    opacity: 0.35;

    filter: grayscale(40%);
}

/* =========================
   SUBMIT MODAL
========================= */

.submit-modal{

    position:fixed;

    inset:0;

    background:rgba(15,23,42,.55);

    backdrop-filter:blur(6px);

    z-index:99999;

    display:none;

    align-items:center;

    justify-content:center;

    padding:24px;
}

.submit-modal.show{

    display:flex;
}

.submit-modal-box{

    width:100%;

    max-width:560px;

    background:white;

    border-radius:24px;

    padding:28px;

    box-shadow:
        0 20px 60px rgba(0,0,0,.18);

    animation:modalShow .25s ease;
}

@keyframes modalShow{

    from{

        opacity:0;
        transform:translateY(12px) scale(.96);
    }

    to{

        opacity:1;
        transform:none;
    }
}

.submit-modal-title{

    font-size:26px;

    font-weight:800;

    color:#0f172a;

    margin-bottom:14px;
}

.submit-modal-text{

    font-size:16px;

    color:#334155;

    line-height:1.6;

    margin-bottom:18px;
}

.unanswered-list{

    display:flex;

    flex-wrap:wrap;

    gap:12px;

    margin-bottom:24px;
}

.unanswered-item{

    min-width:62px;

    height:46px;

    padding:0 14px;

    border-radius:999px;

    border:2px solid #f59e0b;

    background:

        linear-gradient(
            180deg,
            #fffdf7 0%,
            #fef3c7 100%
        );

    color:#2563eb;

    font-weight:700;

    font-size:14px;

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:pointer;

    box-shadow:
        0 4px 12px rgba(245,158,11,.14);

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.unanswered-item:hover{

    transform:
        translateY(-2px)
        scale(1.02);

    box-shadow:
        0 8px 18px rgba(245,158,11,.22);

    background:

        linear-gradient(
            180deg,
            #fff7d6 0%,
            #fde68a 100%
        );
}

.submit-modal-actions{

    display:flex;

    gap:14px;

    justify-content:flex-end;
}

.modal-btn{

    border:none;

    padding:14px 20px;

    border-radius:14px;

    font-size:15px;

    font-weight:700;

    cursor:pointer;

    transition:.2s;
}

.cancel-btn{

    background:#e2e8f0;

    color:#0f172a;
}

.cancel-btn:hover{

    background:#cbd5e1;
}

.submit-confirm-btn{

    background:#2563eb;

    color:white;
}

.submit-confirm-btn:hover{

    transform:translateY(-2px);

    background:#1d4ed8;
}

/* =========================
   PHẦN II MODAL ITEM
========================= */

.unanswered-part2{

    border:2px solid #3b82f6;

    background:

        linear-gradient(
            180deg,
            #eff6ff 0%,
            #dbeafe 100%
        );

    color:#2563eb;

    box-shadow:
        0 6px 16px rgba(59,130,246,.18);
}

.unanswered-part2:hover{

    background:

        linear-gradient(
            180deg,
            #dbeafe 0%,
            #bfdbfe 100%
        );

    box-shadow:
        0 10px 24px rgba(59,130,246,.26);
}
.quiz-box{
    display:flex;
    flex-direction:column;
    gap:18px;
}

/* câu hỏi tách rõ */
.quiz-question{
    white-space: pre-wrap;
    word-break: break-word;
}

/* tách option rõ hơn */
.quiz-options{
    display:flex;
    flex-direction:column;
    gap:12px;
}

/* mỗi đáp án phải có line-height rõ */
.quiz-option{
    line-height:1.5;
    white-space: normal;
}

/* tránh dính text */
.quiz-question,
.quiz-option{
    overflow-wrap: break-word;
}

/* =========================
   HEADER SCORE
========================= */

.score-header-box{

    display:flex;

    align-items:center;

    gap:8px;

    padding:0 16px;

    height:44px;

    border-radius:12px;

    background:linear-gradient(
        135deg,
        #f97316,
        #ea580c
    );

    border:1px solid #bfdbfe;

    font-weight:700;

    color:#ffffff;

    white-space:nowrap;
}

.score-icon{

    font-size:15px;
}

.score-header-value{

    font-size:16px;

    font-weight:800;
}

/* =========================
   TOOLTIP CÔNG CỤ
========================= */

.tool-btn-wrapper{

    position:relative;
    display:inline-flex;
}

.tool-tooltip{

    position:absolute;

    top:calc(100% + 10px);
    right:0;

    min-width:260px;
    max-width:320px;

    padding:12px 14px;

    background:#0f172a;
    color:#fff;

    font-size:13px;
    line-height:1.5;

    border-radius:12px;

    box-shadow:
        0 10px 30px rgba(0,0,0,.15);

    opacity:0;
    visibility:hidden;

    transform:translateY(-6px);

    transition:.25s ease;

    z-index:9999;

    pointer-events:none;
}

.tool-tooltip::before{

    content:"";

    position:absolute;

    top:-6px;
    right:22px;

    width:12px;
    height:12px;

    background:#0f172a;

    transform:rotate(45deg);
}

.tool-btn-wrapper:hover .tool-tooltip{

    opacity:1;
    visibility:visible;

    transform:translateY(0);
}

.boundary-alert{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:99999;
}

.boundary-alert.show{
    display:flex;
}

.boundary-alert-box{
    width:320px;
    background:#fff;
    border-radius:16px;
    padding:24px;
    text-align:center;
    box-shadow:0 20px 50px rgba(0,0,0,.2);
}

.boundary-alert-title{
    font-size:18px;
    font-weight:700;
    margin-bottom:12px;
}

.boundary-alert-text{
    color:#475569;
    margin-bottom:20px;
}

.boundary-alert-btn{
    border:none;
    background:#2563eb;
    color:#fff;
    padding:10px 22px;
    border-radius:10px;
    cursor:pointer;
}

.ai-learning-card{
    width:100%;
    max-width:1200px;   /* 👈 quan trọng */
    margin:0 auto 24px; /* 👈 căn giữa + tạo khoảng dưới */
    padding:0 16px;     /* 👈 tạo khoảng 2 bên */
    box-sizing:border-box;

    height:auto !important;
    overflow:visible !important;

    position:relative;
    z-index:1;
}
.exam-page{
    width:100%;
    max-width:1200px;

    margin:0 auto;

    padding:78px 16px 20px; /* chừa header fixed */

    box-sizing:border-box;
}
/* =================================================
AI REPORT WIDTH SYNC EXAM CONTENT
ĐỒNG BỘ CHIỀU RỘNG VỚI PHẦN NỘI DUNG
================================================= */

.ai-learning-card{

    width:100% !important;

    max-width:1200px !important;

    margin:0 auto 20px !important;

    padding:0 !important;

    box-sizing:border-box;

    height:auto !important;

    overflow:visible !important;

    position:relative;

    z-index:1;

}
body.single-mode{
    overflow: hidden; /* ❌ khóa scroll toàn trang */
    height: 100vh;
}

body.single-mode .exam-left{
    height: calc(100vh - 90px);
    overflow-y: auto;
}

body.full-mode{
    overflow: auto;
    height: auto;
}

body.single-mode .exam-left{
    height: calc(100vh - 90px);
    overflow-y: auto;   /* hoặc hidden nếu bạn muốn “1 câu 1 màn” */
}

.exam-right{
    position: sticky;
    top: 90px;
    height: calc(100vh - 90px);
}

.tool-btn-wrapper{
    position:relative;
    display:inline-block;
}

.tool-menu{
    position:absolute;
    top:calc(100% + 8px);
    right:0;

    width:180px;

    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:12px;

    box-shadow:0 12px 30px rgba(0,0,0,0.12);

    display:none;
    flex-direction:column;

    overflow:hidden;
    z-index:9999;
}

.tool-menu.show{
    display:flex;
}

.tool-item{
    padding:10px 12px;
    background:#fff;
    border:none;
    text-align:left;

    font-size:14px;
    font-weight:600;
    color:#0f172a;

    cursor:pointer;

    transition:0.15s;
}

.tool-item:hover{
    background:#f1f5f9;
}

.ai-warning{
    width: 100%;
    display: block;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff1f2;
    color: #dc2626;
    font-weight: 700;
    border: 1px solid #fecdd3;
}
/* =================================================
MOBILE HEADER - 3 DÒNG ỔN ĐỊNH
KHÔNG ĐỔI HTML
================================================= */

@media(max-width:768px){

.exam-header{

    height:auto !important;
    min-height:150px !important;

    padding:8px !important;

    display:flex !important;
    flex-wrap:wrap !important;

    align-items:center !important;
    justify-content:center !important;

    gap:6px !important;

}


/* ======================
DÒNG 1
THOÁT - TỪNG CÂU - ĐẦY ĐỦ
====================== */

.header-left{

    width:100% !important;

    display:flex !important;

    justify-content:center !important;

    gap:6px !important;

}



/* ======================
DÒNG 2
KHMT - THUD - TIMER - ĐIỂM
====================== */


.header-right{

    width:100% !important;

    display:flex !important;

    justify-content:center !important;

    align-items:center !important;

    flex-wrap:wrap !important;

    gap:6px !important;

}



/* thu nhỏ tất cả */

.top-btn,
.timer-box,
.score-header-box,
.tool-btn-wrapper,
.exam-start-btn,
.submit-btn,
.ai-btn{


    height:36px !important;

    min-height:36px !important;

    padding:0 10px !important;

    font-size:11px !important;

    border-radius:11px !important;

    white-space:nowrap !important;

}



/* ======================
AI + CÔNG CỤ + NỘP
tự xuống hàng
====================== */


.ai-action-box{

    width:auto !important;

    display:flex !important;

    justify-content:center !important;

    gap:6px !important;

}



/* không cho nút biến mất */

.exam-header a,
.exam-header button,
.exam-header div{

    visibility:visible !important;

    opacity:1 !important;

}


}


/* MOBILE NHỎ */

@media(max-width:420px){

.top-btn,
.timer-box,
.score-header-box,
.tool-btn-wrapper,
.exam-start-btn,
.submit-btn,
.ai-btn{

    height:32px !important;

    padding:0 7px !important;

    font-size:10px !important;

}

}
/* ======================
FIX RIÊNG NÚT ĐIỂM MOBILE
GIỮ NGUYÊN BỐ CỤC
====================== */

@media(max-width:768px){

.score-header-box{

    display:flex !important;

    visibility:visible !important;

    opacity:1 !important;

    flex:0 0 auto !important;

    width:auto !important;

    min-width:55px !important;

    position:relative !important;

    z-index:10 !important;

}

}
/* =================================================
MOBILE RESPONSIVE EXAM PAGE
GIỮ NGUYÊN DESKTOP
CHỈ FIX ĐIỆN THOẠI
================================================= */

@media(max-width:768px){


/* =========================
BODY
========================= */

body{

    overflow-x:hidden;

}


/* =========================
PAGE WRAPPER
========================= */

.exam-page{

    width:100%;

    padding:

        160px 8px 20px !important;

}



/* =========================
HEADER FIX
========================= */


.exam-header{

    position:fixed;

    height:auto;

    min-height:78px;

    padding:6px 8px;

}



.header-left,
.header-right{

    gap:5px;

}



/* =========================
ẨN BỚT TEXT DÀI
========================= */


.top-btn{

    font-size:11px;

    height:32px;

    padding:0 7px;

}



/* =========================
MAIN CONTAINER
========================= */


.exam-container{

    display:block !important;

    width:100%;

    height:auto;

}



/* =========================
LEFT CONTENT
========================= */


.exam-left{

    width:100% !important;

    height:auto !important;

    overflow:visible !important;

    padding:0 !important;

}



/* =========================
SIDEBAR
ĐƯA XUỐNG DƯỚI
========================= */


.exam-right{

    width:100% !important;

    height:auto !important;

    position:relative !important;

    top:auto !important;

    margin-top:16px;

    padding:14px;

    border-radius:18px;

}



/* =========================
QUESTION CARD
========================= */


.question-card{

    width:100%;

    border-radius:18px;

    padding:14px;

    margin-bottom:12px;

}



/* =========================
QUESTION HEADER
========================= */


.question-top{

    flex-direction:column;

    gap:10px;

}



.big-title{

    font-size:20px;

    line-height:1.25;

}



.display-mode{

    font-size:10px;

}



.sub-title{

    font-size:12px;

}



.question-status{

    width:100%;

    min-width:auto;

    padding:8px;

}



/* =========================
QUESTION TEXT
========================= */


.question-text{

    font-size:16px !important;

    line-height:1.55;

    margin-top:0;

}



/* =========================
ANSWER
========================= */


.answer-item{

    min-height:52px;

    padding:10px;

    gap:10px;

    border-radius:14px;

}



.answer-circle{

    width:34px;

    height:34px;

    border-radius:10px;

    font-size:15px;

}



.answer-text{

    font-size:15px;

    line-height:1.45;

}



/* =========================
TRUE FALSE
========================= */


.true-false-row{

    flex-direction:column;

    align-items:stretch;

    gap:10px;

    padding:12px;

}



.tf-label{

    width:34px;

    height:34px;

}



.tf-content{

    font-size:15px;

}



.tf-actions{

    width:100%;

}



.tf-btn{

    flex:1;

    padding:9px;

    font-size:13px;

}



/* =========================
SIDEBAR MOBILE
========================= */


.sidebar-title{

    font-size:18px;

}



.sidebar-sub{

    font-size:12px;

}



.question-grid{

    grid-template-columns:

        repeat(8,1fr);

}



.question-nav{

    height:32px;

    font-size:12px;

}



/* =========================
PROGRESS
========================= */


.progress{

    height:12px;

}



/* =========================
NAV BUTTON
========================= */


.single-navigation{

    flex-direction:row;

}



.single-nav-btn{

    height:38px;

    font-size:12px;

}


@media(max-width:768px){

.ai-report-container,
.ai-learning-card{

    width:100%;
    max-width:none;
    margin:0;
    padding:0;

}

}
/* =========================
AI REPORT
========================= */

.ai-topic-card-mini{

    width:100% !important;

    max-width:none !important;

    box-sizing:border-box;

}

.ai-summary-row{

    flex-direction:column;

}



.ai-divider{

    display:none;

}



.ai-topic-card-mini{

    flex-direction:column;

}



/* =========================
MODAL
========================= */


.submit-modal{

    padding:12px;

}



.submit-modal-box{

    padding:18px;

    border-radius:18px;

}



.submit-modal-title{

    font-size:20px;

}



.submit-modal-actions{

    flex-direction:column;

}



.modal-btn{

    width:100%;

}



/* =========================
TOOL MENU
========================= */


.tool-menu{

    right:-20px;

    width:160px;

}



}



/* =================================================
MOBILE NHỎ
================================================= */

@media(max-width:420px){


.exam-page{

    padding-left:5px !important;

    padding-right:5px !important;

}



.question-card{

    padding:12px;

}



.big-title{

    font-size:16px;

}



.question-text{

    font-size:15px !important;

}



.answer-text{

    font-size:14px;

}



.question-grid{

    grid-template-columns:

        repeat(6,1fr);

}



.timer-box{

    font-size:11px;

}



.score-header-box{

    display:none;

}



.ai-action-box{

    display:none;

}



}

/* =================================================
MOBILE - THU NHỎ MENU CÔNG CỤ
XEM KẾT QUẢ + LÀM LẠI
================================================= */

@media(max-width:768px){

    .tool-menu{

        width:210px !important;

        left:50% !important;

        right:auto !important;

        transform:translateX(-50%) !important;

    }


    .tool-item{

        padding:8px 12px !important;

        font-size:8px !important;

        line-height:1.35 !important;

        border-radius:8px !important;

        white-space:nowrap !important;

    }

}


@media(max-width:420px){

    .tool-menu{

        width:210px !important;

        left:50% !important;

        right:auto !important;

        transform:translateX(-50%) !important;

    }


    .tool-item{

        padding:7px 10px !important;

        font-size:9px !important;

        line-height:1.25 !important;

        min-height:32px !important;

        height:auto !important;

        white-space:nowrap !important;

    }

}

 /* =================================================
 MOBILE - SUBMIT MODAL RESPONSIVE
 ================================================= */

@media(max-width:768px){

    .submit-modal{

        padding:12px !important;

        align-items:center !important;

    }


    .submit-modal-box{

        width:100% !important;

        max-width:360px !important;

        padding:18px !important;

        border-radius:18px !important;

        max-height:85vh !important;

        overflow-y:auto !important;

    }


    .submit-modal-title{

        font-size:20px !important;

        line-height:1.3 !important;

        text-align:center !important;

        margin-bottom:12px !important;

    }


    .submit-modal-text{

        font-size:14px !important;

        line-height:1.5 !important;

        text-align:center !important;

        margin-bottom:14px !important;

    }


    .unanswered-list{

        gap:8px !important;

        justify-content:center !important;

        margin-bottom:16px !important;

    }


    .unanswered-item{

        min-width:48px !important;

        height:38px !important;

        padding:0 10px !important;

        font-size:13px !important;

        border-radius:12px !important;

    }


    .submit-modal-actions{

        flex-direction:column !important;

        gap:10px !important;

    }


    .modal-btn{

        width:100% !important;

        height:42px !important;

        padding:0 12px !important;

        border-radius:12px !important;

        font-size:14px !important;

    }

}


@media(max-width:420px){

    .submit-modal-box{

        max-width:330px !important;

        padding:15px !important;

        border-radius:16px !important;

    }


    .submit-modal-title{

        font-size:18px !important;

    }


    .submit-modal-text{

        font-size:13px !important;

    }


    .unanswered-item{

        min-width:44px !important;

        height:34px !important;

        font-size:12px !important;

    }


    .modal-btn{

        height:38px !important;

        font-size:13px !important;

    }

}

/* =================================================
AI REPORT MOBILE ULTRA COMPACT
GIẢM CHIỀU CAO - GIỮ ĐẸP
================================================= */

@media(max-width:768px){

.ai-report-container{

    padding:6px !important;

    border-radius:14px !important;

}



/* HEADER */

.ai-header{

    padding:8px 10px !important;

    border-radius:12px !important;

    margin-bottom:6px !important;

}


.ai-header h2{

    font-size:15px !important;

    line-height:1.25 !important;

    margin:4px 0 !important;

}


.ai-header p{

    font-size:12px !important;

    line-height:1.3 !important;

    margin:0 !important;

}


.ai-badge{

    font-size:11px !important;

    padding:4px 8px !important;

    border-radius:8px !important;

}



/* CARD CHUNG */

.ai-summary-card,
.ai-text-card{

    padding:8px !important;

    border-radius:10px !important;

    margin-bottom:6px !important;

    box-shadow:
    0 2px 8px rgba(37,99,235,.05) !important;

}



/* TIÊU ĐỀ */

.ai-text-card h3{

    font-size:13px !important;

    line-height:1.25 !important;

    padding-bottom:4px !important;

    margin-bottom:6px !important;

}



/* TEXT */

.ai-text-card p{

    font-size:12px !important;

    line-height:1.4 !important;

    margin:0 !important;

}



/* ĐIỂM TỔNG */

.ai-big-level{

    font-size:12px !important;

    padding:5px 8px !important;

    border-radius:8px !important;

}



/* PHÂN TÍCH ITEM */

.ai-summary-row{

    gap:5px !important;

}


.ai-item{

    padding:5px 6px !important;

    border-radius:7px !important;

    font-size:11px !important;

    line-height:1.25 !important;

}



/* TOPIC */

.ai-topic-card-mini{

    padding:8px !important;

    border-radius:8px !important;

    margin-bottom:6px !important;

}



.ai-topic-name{

    font-size:13px !important;

}


.ai-subtopic,
.ai-topic-detail,
.ai-topic-label{

    font-size:11px !important;

    line-height:1.25 !important;

}


.ai-topic-score{

    font-size:16px !important;

}



.ai-topic-right{

    padding-top:5px !important;

}



/* NÚT THU GỌN */

.ai-close-area{

    padding:4px 0 !important;

}


.ai-hide-btn{

    height:26px !important;

    padding:0 12px !important;

    font-size:10px !important;

    border-radius:8px !important;

}



/* đồng bộ ngoài */

.exam-page{

    padding-left:8px !important;

    padding-right:8px !important;

}

}




@media(max-width:420px){


.ai-report-container{

    padding:5px !important;

}



.ai-header{

    padding:7px 8px !important;

}



.ai-summary-card,
.ai-text-card{

    padding:7px !important;

    margin-bottom:5px !important;

}



.ai-text-card h3{

    font-size:12px !important;

}


.ai-text-card p{

    font-size:11px !important;

}



.ai-item{

    font-size:10px !important;

    padding:4px 5px !important;

}



.ai-topic-card-mini{

    padding:7px !important;

}



.ai-topic-name{

    font-size:12px !important;

}



.ai-hide-btn{

    height:24px !important;

    padding:0 10px !important;

    font-size:10px !important;

}

}

.warning-modal{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.65);

    display:none;

    align-items:center;

    justify-content:center;

    z-index:999999;

    padding:16px;

}



.warning-box{

    width:95%;

    max-width:560px;

    background:white;

    padding:22px 28px;

    border-radius:20px;

    text-align:center;

    box-shadow:0 20px 50px rgba(0,0,0,.3);

    animation:warningShow .25s ease;

}



.warning-icon{

    font-size:38px;

    margin-bottom:8px;

}



.warning-box h3{

    color:#dc2626;

    font-size:20px;

    margin:0 0 10px;

}



.warning-box p{

    font-size:15px;

    line-height:1.45;

    margin:0;

    color:#334155;

}



.warning-box button{

    margin-top:18px;

    padding:11px 28px;

    border:none;

    border-radius:12px;

    background:#2563eb;

    color:white;

    font-size:15px;

    font-weight:600;

    cursor:pointer;

}



.warning-box button:hover{

    opacity:.9;

}


@media(max-width:768px){

    .warning-modal{

        padding:12px;

    }


    .warning-box{

        width:94%;

        max-width:360px;

        padding:16px 16px;

        border-radius:16px;

    }


    .warning-icon{

        font-size:30px;

        margin-bottom:6px;

    }


    .warning-box h3{

        font-size:17px;

        margin-bottom:8px;

    }


    .warning-box p{

        font-size:13px;

        line-height:1.35;

    }


    .warning-box button{

        width:100%;

        padding:11px;

        font-size:14px;

        margin-top:14px;

    }

}

/* =========================================================
   AI HEADER
   DESKTOP + MOBILE
   ========================================================= */


/* =========================================================
   DESKTOP
   ========================================================= */

.ai-header{

    width:100%;

    box-sizing:border-box;

    text-align:center;

    padding:
        20px 24px 18px;

    margin:
        0 0 16px;

    border-radius:18px;

    background:
        linear-gradient(
            135deg,
            #f8fbff,
            #eef5ff
        );

    border:
        1px solid #dbeafe;

    box-shadow:
        0 6px 18px rgba(37,99,235,.08);

}


/* =========================================================
   AI BADGE
   ========================================================= */

.ai-badge{

    display:inline-flex;

    align-items:center;

    justify-content:center;

    width:max-content;

    max-width:100%;

    box-sizing:border-box;

    padding:
        5px 11px;

    margin:
        0 auto 8px;

    border-radius:999px;

    background:#dbeafe;

    color:#1d4ed8;

    font-size:11px;

    font-weight:700;

    line-height:1.3;

    white-space:nowrap;

}


/* =========================================================
   AI TITLE
   ========================================================= */

.ai-header h2{

    margin:
        0 0 8px;

    padding:0;

    color:#0f172a;

    font-size:20px;

    font-weight:800;

    line-height:1.3;

    letter-spacing:.2px;

}


/* =========================================================
   STUDENT NAME
   ========================================================= */

.ai-student-name{

    display:flex;

    align-items:center;

    justify-content:center;

    flex-wrap:wrap;

    gap:4px;

    margin:
        4px 0 3px;

    color:#475569;

    font-size:13px;

    font-weight:500;

    line-height:1.5;

}

.ai-student-name strong{

    color:#92400e;

    font-weight:700;

}


/* =========================================================
   EXAM ID
   ========================================================= */

.ai-exam-id{

    display:flex;

    align-items:center;

    justify-content:center;

    flex-wrap:wrap;

    gap:4px;

    margin:
        2px 0 8px;

    color:#475569;

    font-size:13px;

    font-weight:500;

    line-height:1.5;

}

.ai-exam-id strong{

    color:#1d4ed8;

    font-weight:800;

}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.ai-header p{

    max-width:720px;

    margin:
        7px auto 0;

    padding:0;

    color:#64748b;

    font-size:12px;

    font-weight:400;

    line-height:1.5;

}


/* =========================================================
   MOBILE <= 768px
   ========================================================= */

@media (max-width:768px){

    .ai-header{

        width:100%;

        box-sizing:border-box;

        padding:
            13px 12px 12px;

        margin:
            0 0 10px;

        border-radius:13px;

        box-shadow:
            0 4px 12px rgba(37,99,235,.07);

    }


    /* =========================
       BADGE
       ========================= */

    .ai-badge{

        padding:
            4px 9px;

        margin:
            0 auto 6px;

        font-size:9.5px;

        line-height:1.25;

        border-radius:999px;

    }


    /* =========================
       TITLE
       ========================= */

    .ai-header h2{

        margin:
            0 0 6px;

        font-size:15px;

        line-height:1.3;

        letter-spacing:0;

        word-break:normal;

        overflow-wrap:normal;

    }


    /* =========================
       STUDENT
       ========================= */

    .ai-student-name{

        gap:3px;

        margin:
            3px 0 2px;

        font-size:11px;

        line-height:1.4;

    }

    .ai-student-name strong{

        font-size:11px;

    }


    /* =========================
       EXAM
       ========================= */

    .ai-exam-id{

        gap:3px;

        margin:
            1px 0 5px;

        font-size:11px;

        line-height:1.4;

    }

    .ai-exam-id strong{

        font-size:11px;

    }


    /* =========================
       DESCRIPTION
       ========================= */

    .ai-header p{

        margin:
            5px auto 0;

        font-size:9.5px;

        line-height:1.4;

        max-width:100%;

    }

}


/* =========================================================
   MOBILE <= 390px
   ========================================================= */

@media (max-width:390px){

    .ai-header{

        padding:
            11px 9px 10px;

        margin-bottom:8px;

        border-radius:11px;

    }


    .ai-badge{

        padding:
            3px 8px;

        margin-bottom:5px;

        font-size:9px;

    }


    .ai-header h2{

        font-size:13px;

        line-height:1.3;

        margin-bottom:5px;

    }


    .ai-student-name{

        font-size:10px;

        line-height:1.35;

        margin:
            2px 0 1px;

    }

    .ai-student-name strong{

        font-size:10px;

    }


    .ai-exam-id{

        font-size:10px;

        line-height:1.35;

        margin:
            1px 0 4px;

    }

    .ai-exam-id strong{

        font-size:10px;

    }


    .ai-header p{

        font-size:9px;

        line-height:1.35;

        margin-top:4px;

    }

}


/* =========================================================
   MOBILE <= 360px
   SIÊU GỌN NHƯNG KHÔNG BÓP CHỮ
   ========================================================= */

@media (max-width:360px){

    .ai-header{

        padding:
            10px 8px 9px;

        border-radius:10px;

    }


    .ai-badge{

        font-size:8.5px;

        padding:
            3px 7px;

    }


    .ai-header h2{

        font-size:12px;

        line-height:1.3;

    }


    .ai-student-name,
    .ai-student-name strong{

        font-size:9.5px;

    }


    .ai-exam-id,
    .ai-exam-id strong{

        font-size:9.5px;

    }


    .ai-header p{

        font-size:8.5px;

        line-height:1.3;

    }

}

/* Nhãn ngôn ngữ (Python, C++, HTML...) */
.code-lang-label {
    font-style: italic;
    font-weight: bold;
    margin-top: 6px !important;
    margin-bottom: 2px !important;
    color: #475569;
}

/* Khối Code ôm sát nội dung, có thanh cuộn ngang khi quá dài */
.code-block {
    font-family: 'Consolas', 'Courier New', Courier, monospace !important;
    background: transparent !important;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 6px;
    padding: 6px 10px !important;
    margin: 4px 0 6px 0 !important;
    line-height: 1.4;
    font-size: 14px;
    color: #0f172a;
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
    box-sizing: border-box;
}

.code-block code {
    font-family: inherit;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ép phần nội dung chứa câu hỏi/đáp án co giãn đúng chuẩn trong flexbox/grid */
.tf-content, .answer-text, .option-content {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

@keyframes pulseDot {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
    70% { transform: scale(1.3); opacity: 0.6; box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.blinking-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #2563eb;
    border-radius: 50%;
    /* Mặc định đặt trạng thái đứng yên (paused) */
    animation: pulseDot 1.5s infinite ease-in-out;
    animation-play-state: paused; 
}

/* Khi có class active thì bắt đầu nhấp nháy */
.blinking-dot.active-blink {
    animation-play-state: running;
}
/* ================================
   MOBILE - BLINKING DOT
================================ */
@media (max-width: 768px) {

    .blinking-dot {
        width: 9px;
        height: 9px;
        flex-shrink: 0;
    }

    @keyframes pulseDot {

        0% {
            transform: scale(1);
            opacity: 1;
            box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
        }

        70% {
            transform: scale(1.2);
            opacity: 0.6;
            box-shadow: 0 0 0 5px rgba(37, 99, 235, 0);
        }

        100% {
            transform: scale(1);
            opacity: 1;
            box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
        }

    }

}

/* =========================
   NÚT CÂU TRƯỚC / CÂU SAU
========================= */

.single-navigation .single-nav-btn{

    font-size:12px !important;

}