/* 🔷 ROOT LAYOUT */
#theory-grading-scene-root {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #f4f7fb;
    font-family: "Poppins", sans-serif;
    overflow: hidden; /* 🚨 important */
}

/* 🔷 TOPBAR */
.tg-topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #0a2a43;
    color: white;
}

/* 🔙 BACK BUTTON */
.tg-topbar .tg-back-btn {
    background: #123d5c;
    border: none;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* 🔥 TITLE */
.tg-title {
    flex: 1;
    text-align: center;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* 🔷 SCROLLABLE CONTENT */
.tg-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 0;
}

/* 🔷 CONTAINER */
.tg-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;

    padding-bottom: 24px;
    background: #0a2a43;
}

/* 🔷 QUESTION BLOCK */
.tg-question-block {
    background: #e2e8f0;
    border-radius: 0;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* 🔷 QUESTION HEADER */
.tg-question-header {
    font-size: 15px;
    font-weight: 600;
    color: #0a2a43;
    margin-bottom: 10px;
}

/* 🔷 PART BLOCK */
.tg-part-block {
    background: #f8fafc;
    border-radius: 10px;
    padding: 4px;
    border: 1px solid #e2e8f0;
}

/* 🔷 PART TITLE */
.tg-part-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

/* 🔷 QUESTION TEXT */
.tg-part-question {
    background: #eef3f8;
    border-left: 4px solid #0a2a43;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* 🔷 IMAGE */
.tg-part-image img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* 🔷 STUDENT ANSWER */
.tg-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.tg-student-answer {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    margin-bottom: 10px;
}

/* 🔷 INPUTS */
.tg-grading-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 🔥 CORRECT ANSWER TEXTAREA */
.tg-correct-answer-input {
    width: 100%;
    min-height: 90px;
    max-height: 180px;
    resize: vertical;

    padding: 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;

    background: #e2e8f0; /* 🔥 DIFFERENT */
    font-size: 13px;

    overflow-y: auto;
    white-space: pre-wrap;
}

/* 🔷 SCORE */
.tg-score-input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #94a3b8;
    font-size: 14px;
}

/* 🔷 FOCUS */
.tg-score-input:focus {
    outline: none;
    border-color: #0a2a43;
    box-shadow: 0 0 0 2px rgba(10, 42, 67, 0.2);
}

/* 🔥 FIXED FOOTER */
.tg-bottom-buttons {
    flex-shrink: 0;
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

/* 🔷 BUTTON */
.tg-bottom-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

/* 💾 SAVE */
.tg-save-grade-btn {
    background: #0a2a43;
    color: white;
}

/* 🔷 ERROR */
.tg-error {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    gap: 16px;
}

.tg-comment-section {
    width: 100%;
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.tg-comment-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.tg-comment-input {
    width: 100%;
    min-height: 100px;
    resize: vertical;

    padding: 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
}
.tg-image-answer,
.tg-marking-image {
    margin-top: 10px;
}

.tg-answer-img,
.tg-marking-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    border: 1px solid #ccc;
    display: block;
}

.tg-answer-img {
    cursor: pointer;
}
/* Base image behavior */
.tg-part-image img,
.tg-answer-img,
.tg-marking-img {
    max-width: 100%;
    border-radius: 10px;
    cursor: zoom-in;
    transition:
        transform 0.25s ease,
        max-width 0.25s ease,
        max-height 0.25s ease,
        box-shadow 0.25s ease;
}

/* Zoomed fullscreen state */
.tg-part-image img.zoomed,
.tg-answer-img.zoomed,
.tg-marking-img.zoomed {
    position: fixed;
    inset: 0;
    margin: auto;

    width: auto;
    height: auto;

    max-width: 100vw;
    max-height: 95vh;

    z-index: 99999;

    background: rgba(0, 0, 0, 0.88);

    padding: 10px;
    border-radius: 12px;

    cursor: zoom-out;

    transform: scale(1.02);

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.tg-correct-answer-box {
    margin-bottom: 14px;
}

.tg-correct-answer-display {
    background: #f5f7fa;
    border: 1px solid #d6dce5;
    border-radius: 10px;
    padding: 12px;
    line-height: 1.6;
    color: #123;
    white-space: normal;
    word-break: break-word;
    font-size: 14px;
}

.tg-correct-answer-display p {
    margin: 0;
}