/* ============================================================
 * PHÒNG LUYỆN TSA - STYLES
 * ============================================================ */

body {
    background-color: #f3f4f6;
    color: #333;
    font-family: system-ui, -apple-system, sans-serif;
    overflow: hidden;
}
body.dashboard-active { overflow: auto; }

.math-content {
    word-break: break-word;
    white-space: normal;
    font-size: 16px;
    line-height: 1.6;
}
.math-content img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
    transform: translateZ(0);
    backface-visibility: hidden;
    image-rendering: crisp-edges;
    cursor: zoom-in;
}
mjx-container { outline: none !important; }

.circular-chart { display: block; margin: 0 auto; max-width: 100px; max-height: 100px; }
.circle-bg { fill: none; stroke: #f3f4f6; stroke-width: 3.8; }
.circle { fill: none; stroke-width: 3.8; stroke-linecap: round; }
.percentage { fill: #cc3232; font-family: sans-serif; font-size: 0.5em; text-anchor: middle; font-weight: bold; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
.custom-scrollbar { overflow-y: auto; }

/* ============ Random exam card ============ */
.RegisterExamCard_container__2yQDW.featured-random {
    position: relative;
    border: 2px solid #1890ff;
    background: linear-gradient(135deg, #e6f7ff 0%, #ffffff 60%);
    overflow: hidden;
}
.RegisterExamCard_container__2yQDW.featured-random::before {
    content: "NGẪU NHIÊN";
    position: absolute;
    top: 12px;
    right: -32px;
    transform: rotate(35deg);
    background: #ff4d4f;
    color: #fff;
    padding: 4px 40px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.RegisterExamCard_container__2yQDW.featured-random .RegisterExamCard_name__2WrTK {
    color: #096dd9;
    font-size: 18px;
}
.exam-card-db .RegisterExamCard_name__2WrTK {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 48px;
}

/* ============ Category tags ============ */
.category-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.category-toan    { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.category-dochieu { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.category-khoahoc { background: #e6f7ff; color: #096dd9; border: 1px solid #91d5ff; }
.category-default { background: #fafafa; color: #595959; border: 1px solid #d9d9d9; }
.exam-grid-item   { margin-bottom: 16px; }

/* ============ Search box ============ */
.exam-search-wrap {
    position: relative;
    width: 100%;
    max-width: 360px;
}
.exam-search-input {
    width: 100%;
    height: 38px;
    padding: 0 36px 0 38px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s;
    outline: none;
}
.exam-search-input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.15);
}
.exam-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bfbfbf;
    pointer-events: none;
}
.exam-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f0f0;
    color: #595959;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.exam-search-clear:hover { background: #d9d9d9; }
.search-result-info {
    color: #8c8c8c;
    font-size: 13px;
    margin-left: 12px;
}
.search-highlight {
    background: #fff3a3;
    color: #d48806;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* ============ Toolbar layout ============ */
.dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.dashboard-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.dashboard-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
@media (max-width: 640px) {
    .exam-search-wrap { max-width: 100%; }
    .dashboard-toolbar-left,
    .dashboard-toolbar-right { width: 100%; }
}

/* ============ Result Modal ============ */
.result-modal-root { position: fixed; inset: 0; z-index: 1000; }
.result-modal-root .ant-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}
.result-modal-root .ant-modal-wrap {
    position: absolute;
    inset: 0;
    overflow: auto;
    outline: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.result-modal-root .ant-modal {
    width: 800px;
    max-width: calc(100vw - 32px);
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 6px -4px rgba(0,0,0,.12), 0 6px 16px 0 rgba(0,0,0,.08), 0 9px 28px 8px rgba(0,0,0,.05);
}
.result-modal-root .ant-modal-content {
    padding: 24px;
    position: relative;
}
.result-modal-root .ant-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    color: rgba(0,0,0,.45);
    z-index: 10;
}
.result-modal-root .ant-modal-close:hover { color: rgba(0,0,0,.85); }

.result-info p { margin-bottom: 6px; }
.result-info p > span { font-weight: 500; color: #595959; }
.result-score-box {
    background: rgba(206, 22, 40, 0.063);
    padding: 15px;
    width: 90%;
    border-radius: 10px;
}
.result-score-main {
    color: rgb(206, 22, 40);
    font-size: 30px;
}
.payment-note {
    padding: 15px;
    width: 90%;
    color: rgb(3, 169, 244);
    font-size: 15px;
}
.result-actions-bottom {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.user-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.user-link:hover { color: #1890ff; }

/* ============ Resume draft notification ============ */
.draft-notify {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #614700;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.draft-notify button {
    margin-left: auto;
    background: #faad14;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.draft-notify button:hover { background: #d48806; }