/* ------------------------------
   GLOBAL
------------------------------ */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f5f5f5;
    
}
html, body {
    height: 100%;
    margin: 0;
}


.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;

    height: 100%;     /* REQUIRED */
    min-height: 0;    /* REQUIRED */
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 10px;

    height: 100%;     /* REQUIRED */
    min-height: 0;    /* REQUIRED */
}



.resizable-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;    /* NEW — prevents collapsing */
}

.divider {
    height: 6px;
    background: #ccc;
    cursor: row-resize;
    margin: 4px 0;
}

.divider:hover {
    background: #bbb;
}

/* ------------------------------
   HEADINGS
------------------------------ */
.nyu-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #57068C; /* NYU Violet */
    color: white;
    padding: 12px 16px;
    font-family: sans-serif;
    font-size: 14px;
    border-bottom: 8px solid white;   /* thin white line */
}

.nyu-logo {
    height: 64px;
    margin-right: 12px;
}

.left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.title-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.title {
    font-weight: bold;
    font-size: 18px;
}

.professors {
    font-size: 15px;
    font-style: italic;
    opacity: 0.95;
}

.right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-key-label {
    font-size: 13px;
    white-space: nowrap;
}

.key-box {
    padding: 3px 6px;
    font-size: 13px;
    border-radius: 3px;
    border: none;
    width: 180px;
}

.save-btn {
    padding: 4px 10px;
    font-size: 13px;
    background-color: white;
    color: #57068C;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

.save-btn:hover {
    background-color: #e6e6e6;
}

/* ------------------------------
   PANELS
------------------------------ */

.panel {
    flex: 1;
    background: white;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    display : flex;
    flex-direction: column;
}

.panel h3 {
    font-size: 0.95em;
    margin: 2px 0 6px 0;
    font-weight: bold;
}

/* ------------------------------
   FORM ELEMENTS
------------------------------ */

.panel textarea,
.panel input,
.panel select,
.panel button {
    font-size: 0.9em;
    padding: 4px 6px;
    width: 100%;
    box-sizing: border-box;
}

textarea {
    height: 110px;
    resize: vertical;
}

/* ------------------------------
   COMPACT CONTROL ROWS
------------------------------ */

.control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.control-row label {
    min-width: 90px;
    font-size: 0.9em;
    font-weight: bold;
}

/* ------------------------------
   CHAT
------------------------------ */

.scrollable {
    height: 180px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 8px;
    background: #fafafa;
}


/* ------------------------------
   GRADE STATUS
------------------------------ */

.grade-status-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

#grade-status {
    flex: 1;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.grade-points {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
    text-align: right;
    white-space: nowrap;
    background: #e8e8e8;
    color: #333;
    border: 1px solid #bbb;
}

.status-not-graded {
    background: #ccc;
    color: #333;
}

.status-correct {
    background: #c8f7c5;
    color: #2d7a2d;
}

.status-incorrect {
    background: #f7c5c5;
    color: #7a2d2d;
}

.status-error {
    color: orange;
    font-weight: bold;
}

.dashboard-link {
    margin-left: auto;
    color: #57068c;
    font-weight: bold;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.dashboard-link:hover {
    text-decoration: underline;
}


/* ------------------------------
   TEXT BLOCKS
------------------------------ */
#question-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;   /* panel can shrink */
}

/* Question and solution text areas */
#question-text {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #ccc;
    background: #fff;
    min-height: 0;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

/* Remove top margin from first element to avoid extra space */
#question-text > *:first-child {
    margin-top: 0;
}

/* Code blocks in question text */
#question-text pre {
    background-color: #f7f7f7;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

#question-text code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95em;
}

#question-text pre code {
    background-color: transparent;
    padding: 0;
    display: block;
}

#student-solution {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #ccc;
    background: #fff;
    white-space: pre-wrap;
    min-height: 0;
    font-size: 14px;
    font-family: monospace;
}

/* Explanation box scrolls independently */
#full-explanation-box {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #ccc;
    background: #fafafa;
    white-space: pre-wrap;
    min-height: 0;
}

/* Feedback and status */
#feedback-box, #grade-status {
    padding: 6px;
    margin-bottom: 6px;
}


.grade-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;

    height: 36px;
    min-height: 36px;
}

/* Prevent children from stretching vertically or horizontally */
.grade-row select,
.grade-row button {
    width: auto;
    flex: 0 0 auto;
    height: 28px;       /* NEW: force compact height */
    line-height: 1;     /* NEW: prevent vertical expansion */
    padding: 2px 6px;   /* NEW: compact padding */
    font-size: 0.9em;
    box-sizing: border-box;
}

/* Timeout input field */
.timeout-label {
    margin-left: 10px;
}

.timeout-input {
    width: 60px;
    margin-left: 4px;
}

