/* Global font size reduction */
html {
    font-size: 87.5%; /* Makes everything 14px instead of 16px */
}

/* Base styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
}

* {
    box-sizing: border-box;
}

/* ===========================================
   EXAM PAGE PANEL LAYOUT (Scoped to .panel-container)
   =========================================== */

.panel-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Panel */
.panel-container .header-panel {
    background-color: #cfe2ff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: padding-right 0.3s ease;
}

/* Question Panel */
.panel-container .question-panel {
    background-color: #f5f5f5;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    transition: padding-right 0.3s ease;
}

.review-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.review-checkbox-container input[type="checkbox"] {
    margin: 0;
}

.review-checkbox-container label {
    margin: 0;
    cursor: pointer;
    user-select: none;
}

/* Question Content */
.panel-container .question-content {
    background-color: white;
    padding: 20px;
    padding-bottom: 16px;
    flex-grow: 0;
    overflow-y: auto;
    position: relative;
    transition: padding-right 0.3s ease;
}

/* Dynamic padding now handled by React ExamRenderer - no fixed padding needed */
.panel-container .question-content .pb-question-container {
    padding-bottom: 0;
}

.question-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 4px;
}

.question-content .question-text {
    margin-left: 30px;
    white-space: pre-wrap;
}

.question-content .question-rich-content {
    margin-left: 30px;
    overflow-x: auto;
    line-height: 1.45;
}

.question-content .question-rich-content p {
    margin: 0 0 12px;
}

.question-content .question-rich-content ul,
.question-content .question-rich-content ol {
    margin: 0 0 12px 22px;
    padding: 0;
}

.question-content .question-rich-content li {
    margin-bottom: 4px;
}

.question-content .question-rich-content pre {
    margin: 12px 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow-x: auto;
    white-space: pre-wrap;
}

.question-content .question-rich-content code {
    font-family: "Courier New", Courier, monospace;
    background: transparent;
    padding: 0;
}

.question-content .question-rich-content table {
    margin: 12px 0;
    border-collapse: collapse;
    width: auto;
    max-width: 100%;
    font-size: 0.95em;
}

.question-content .question-rich-content th,
.question-content .question-rich-content td {
    border: 1px solid #8c98a4;
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.question-content .question-rich-content th {
    background-color: #eef2f6;
    font-weight: 700;
}

.question-content .question-rich-content table table {
    margin: 0;
    font-size: 1em;
}

.question-content .question-rich-content table.question-rich-table--block {
    width: 100%;
    max-width: 100%;
}

.question-content .question-rich-content table.question-rich-table--block td {
    border: none;
    padding: 10px 12px;
    background: #f8f9fa;
    white-space: pre-wrap;
    font-family: "Courier New", Courier, monospace;
}

/* Options Panel */
.panel-container .options-panel {
    background-color: white;
    padding: 20px;
    padding-bottom: 80px; /* Space for fixed navigation bar at bottom */
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
    transition: padding-right 0.3s ease;
}

.options-panel .form-check {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
}

.options-panel .form-check-input {
    margin-top: 0;
    margin-bottom: 0;
    align-self: flex-start;
}

.form-check-label.d-flex {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.35;
    white-space: pre-wrap;
    margin: 0;
}

.option-text-content {
    white-space: pre-wrap;
}

.retain-option-formatting-btn.is-enabled {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.option-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.option-marker {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    min-width: 50px;
    margin-top: 3px;
}

.option-marker input {
    margin-right: 6px;
    margin-top: 3px;
}

.option-letter {
    font-weight: bold;
    margin-top: 1px;
}

.option-content {
    white-space: pre-wrap;
    line-height: 1.4;
    flex-grow: 1;
    word-break: break-word;
}

/* Navigation Panel - Fixed to bottom of viewport */
.panel-container .nav-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #f5f5f5;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    transition: padding-right 0.3s ease;
    z-index: 1000;
}

/* ===========================================
   QUESTION LIST SIDEBAR
   =========================================== */

#questionListContainer {
    position: fixed;
    right: 0;
    width: 180px;
    background-color: #f8f9fa;
    border-left: 1px solid #dee2e6;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    overflow: hidden;
    max-height: 100vh;
}

#questionListHeader {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
    align-items: center;
    flex-shrink: 0;
}

#questionListContent {
    overflow-y: auto;
    flex-grow: 1;
    max-height: calc(100vh - 120px);
}

#questionListContainer > div:nth-child(2) {
    flex-shrink: 0;
}

.question-list-item {
    display: flex;
    padding: 8px 10px;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.question-list-item:hover {
    background-color: #e9ecef;
}

.question-list-item.current {
    background-color: #cfe2ff;
    font-weight: bold;
}

.question-number {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    flex-shrink: 0;
}

.question-answer {
    flex-grow: 1;
    text-align: right;
    padding-left: 10px;
    padding-right: 10px;
    min-width: 0;
}

.question-marked {
    width: 50px;
    text-align: center;
    color: #333;
    font-weight: bold;
    flex-shrink: 0;
}

/* Custom scrollbar */
#questionListContent::-webkit-scrollbar {
    width: 8px;
}

#questionListContent::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#questionListContent::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#questionListContent::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===========================================
   SCORE BAR & RESULTS
   =========================================== */

.scorebar-container {
    position: relative;
    width: 600px;
    margin: 40px auto;
    font-family: Arial, sans-serif;
    text-align: center;
}

.scorebar-label {
    font-size: 16px;
    margin-bottom: 8px;
}

.scorebar-shell {
    position: relative;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.scorebar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 5px 0 0 5px;
}

.scorebar-fill.pass {
    background-color: #28a745;
}

.scorebar-fill.fail {
    background-color: #dc3545;
}

.scorebar-marker {
    position: absolute;
    top: -20px;
    transform: translateX(-50%);
    font-size: 14px;
    color: #000;
    border-left: 2px solid black;
    height: 50px;
    line-height: 20px;
}

.scorebar-value {
    margin-top: 10px;
    font-size: 18px;
    font-weight: bold;
}

.score-display {
    margin-bottom: 30px;
}

.score-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.score-number.passing {
    color: #28a745;
}

.score-number.failing {
    color: #dc3545;
}

/* ===========================================
   STATUS INDICATORS & COLORS
   =========================================== */

.correct {
    color: green;
    font-weight: bold;
}

.incorrect {
    color: red;
    font-weight: bold;
}

.question-answer.correct {
    color: green;
    font-weight: bold;
}

.question-answer.incorrect {
    color: red;
    font-weight: bold;
}

.warning {
    color: red;
    margin-top: 10px;
    display: none;
}

.no-answer {
    color: red;
    font-weight: bold;
    margin-bottom: 10px;
}

/* ===========================================
   FORM ELEMENTS (Non-Bootstrap overrides)
   =========================================== */

.form-check {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.form-check-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.form-check-option .form-check-input {
    margin-top: 0.1rem;
    position: relative;
    top: 2px;
    flex-shrink: 0;
}

.option-label {
    font-weight: normal;
    margin-right: 6px;
    white-space: nowrap;
}

.option-text {
    white-space: pre-wrap;
}

.form-check-input {
    position: absolute;
    left: 0;
    top: 3px;
}

/* ===========================================
   BUTTON GROUPS & NAVIGATION
   =========================================== */

.left-buttons, .right-buttons {
    display: flex;
    gap: 10px;
}
