@charset "utf-8";
/* ============================================
Exam Styles - RUDN Test Platform
File: assets/css/exams.css
Updated: Consistent with dashboard2.php & exam_selection4.php
============================================ */

:root {
    --bg-color: #f4f7fa;
    --container-bg: #ffffff;
    --text-color: #343a40;
    --text-light: #6c757d;
    --primary-color: #0088dd;
    --primary-dark: #091c39;
    --secondary-color: #28a745;
    --danger-color: #dc3545;
    --border-color: #dee2e6;
    --border-radius: 12px;
    --shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    margin: 0;
    padding: 0 !important;
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: var(--text-color);
    display: flex !important;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
HEADER STYLES
============================================ */
#exam-header-bar {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: white;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

#header {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
	width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 35px;
}

.header-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}
.header-lsp-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

#exam-header-bar h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-display-name {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.user-display-name .lnr {
    font-size: 16px;
}

#progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

#progress-indicator {
    display: flex;
    gap: 8px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.progress-dot.active {
    background: white;
    transform: scale(1.2);
}

.progress-dot.completed {
    background: #28a745;
}

#timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    min-width: 70px;
    text-align: center;
}

#timer.warning {
    background: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
MAIN CONTAINER
============================================ */
#exam-container {
    width: 97vw;
    max-width: none;
    background-color: var(--container-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    margin: 20px;
    border: 1px solid var(--border-color);
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
	margin: 1.5% auto !important;
}

/* ============================================
AUDIO CONTAINER
============================================ */
#audio-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.play-button {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.play-button:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 136, 221, 0.4);
}

.play-button.disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    width: 0%;
    transition: width 0.3s;
}

.time-display {
    font-size: 13px;
    color: #666;
    min-width: 45px;
}

/* ============================================
CONTENT SECTIONS
============================================ */
.part {
    /*background: white;
    border-radius: 15px;
    padding: 35px;*/
    margin-bottom: 25px;
    /*box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);*/
    display: none;
}
#intro-screen {
    text-align: center;
}

#intro-screen h1 {
    margin-bottom: 30px;
    color: #0088dd;
}

.exam-info-list {
    list-style: none;
    padding: 0;
    margin: 20px auto; 
    max-width: 500px;
    text-align: left;
}

.exam-info-list li {
    padding: 5px 0 10px 35px;
    position: relative;
    color: #666;
    line-height: 1.6;
    text-align: left;
}

.exam-info-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 5px;
    color: #0088dd;
    font-weight: bold;
    font-size: 16px;
}

.part.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.part.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.part h2 {
    color: #0088dd;
    margin-bottom: 20px;
    font-size: 24px;
}

.part h3 {
    color: #333;
    margin: 25px 0 0 0;
    font-size: 18px;
}
.part .column-answers.questions h3 {
	margin: 0 0 20px;
}
.part h3.blue-head {
    color: #0088dd;
	margin-top: 10px;
}

.part h3.passage-title {
	color: #0088dd;
	margin: 0 0 -10px;
}

.part p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.part input[type="text"] {
    width: 100%;
    padding: 7px 15px;
    border: 1px solid #999;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.part input[type="text"]:focus {
    outline: none;
    border-color: #0088dd;
}

.part textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.part textarea:focus {
    outline: none;
    border-color: #0088dd;
}

/* ============================================
BUTTON STYLES
============================================ */
.btn {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    font-family: var(--font-family);
}

#navigation .btn#next-btn, #navigation .btn#prev-btn {
    background: linear-gradient(135deg, #34a143 0%, #0a4b13 100%);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 136, 221, 0.4);
}

.btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

#navigation .btn {
    min-width: 140px;
}

#finish-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

#finish-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* ============================================
NAVIGATION BAR
============================================ */
#navigation {
    padding: 5px 30px 15px;
    /*background: white;
    border-top: 1px solid var(--border-color);*/
    text-align: center;
    width: 100%;
   /* box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);*/
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-shrink: 0;
}

/* ============================================
TWO-COLUMN LAYOUT
============================================ */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
}
.two-column-layout.bigger {
	grid-template-columns: 3fr 2fr;
}
.column-text {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    /*max-height: 500px;*/
    overflow-y: auto;
}

.column-answers {
    background: white;
    /*padding: 25px;*/
    border-radius: 10px;
}
.questions.audio {
	margin-top: 15px;
	display: grid;
  	grid-template-columns: 1fr 1fr;
  	gap: 30px;
}
.questions.audio > div {
	margin-bottom: 0 !important;
}
.column-answers.questions input[type="radio"],
.questions.audio input[type="radio"]{
	margin-right: 7px;
}
.quest-inline {
	display: inline-block;
	margin-right: 60px;
	margin-top: 15px;
}
.questions > div:last-of-type {
  margin-bottom: 0;
  padding: 15px;
}

.reading-text {
    line-height: 1.8;
    color: #333;
	padding: 5px 20px !important;
}
.reading-text.demiwide, .audio-text.demiwide {
	line-height: 2.1;
}
.reading-text.wide, .audio-text.wide {
	line-height: 2.3;
}
.reading-text.extra, .audio-text.extra {
	line-height: 3;
    padding: 30px !important;
    margin-top: 15px;
}
.audio-text {
	line-height: 3;
    color: #333;
	padding: 5px 20px 20px !important;
}
.reading-text h3, .audio-text h3 {
    color: #0088dd;
    margin-top: 20px;
}
.reading-text h4, .audio-text h4 {
    color: #0088dd;
    margin: 15px 0;
}
.reading-text h4.black, .audio-text h4.black {
	color: #333;
	font-size: 114%;
}
.reading-text input[type="text"], .audio-text input[type="text"] {
  width: 160px;
  padding: 7px 10px;
  font-weight: 500;
  font-size: 120%;
  letter-spacing: .5px;
  font-family: inherit;
}
.reading-text select, .audio-text select {
  background: #fff;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #999;
  margin-left: 5px;
  font-size: 15px;
  font-family: var(--font-family);
  margin-right: 5px;
}

.reading-text div.reading-text:not(:last-of-type), .audio-text div.reading-text:not(:last-of-type) {
	margin-bottom: 30px;
}
.reading-text span.adig, .word-formation-table .adig, .audio-text span.adig {
  display: inline-block;
  background: #999;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  font-size: 84%;
  font-weight: 500;
  line-height: 1.5;
}
.reading-text span.example, .audio-text span.example {
  padding: 7px 15px;
  background: #fff;
  border: 1px #bbb solid;
  border-radius: 7px;
  font-weight: 500;
  font-size: 120%;
}
.reading-text .emoicons, .audio-text .emoicons {
	font-size:40px;
}
.reading-text .ascii-art {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.2;
  white-space: pre;
  margin: 10px 0 0;
}
.reading-text .red-let, .audio-text .red-let {
  background: #ff0000;
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
}
.reading-text .green-let, .audio-text .green-let {
  background: #00ff00;
  color: black;
  padding: 2px 4px;
  border-radius: 3px;
}


/* ============================================
GAP FILL INPUTS
============================================ */
.cloze-input,
.gap-fill-input {
    display: inline-block;
    width: 120px;
    padding: 5px 10px;
    margin: 0 5px;
    border: 2px solid #0088dd;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
}

.gap-fill-table {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.table-row:last-child {
    border-bottom: none;
}

.question-label {
    flex: 1;
    color: #333;
}
/* ============================================
 WORD Formation Layout 
============================================ */
.word-formation-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 30px 0;
    background: #f8f9fa;
    border-radius: 10px;
}

.word-formation-table tr {
    border-bottom: 2px solid #e1e1e1;
}

.word-formation-table tr:last-child {
    border-bottom: none;
}

.word-formation-table td {
    padding: 20px 15px;
    vertical-align: middle;
}

.word-formation-table .text-column {
    width: 75%;
    line-height: 1.8;
    color: #333;
	border-bottom: 1px solid #ccc;
}

.word-formation-table .word-column {
    width: 25%;
    text-align: center;
    font-weight: 700;
    color: #0088dd;
    font-size: 110%;
    text-transform: uppercase;
    padding-right: 25px;
    background: #f8f9fa;
	border-bottom: 1px solid #ccc;
}

.word-formation-table input.cloze-input {
    width: 140px;
    display: inline-block;
    margin: 0 5px;
	font-family: var(--font-family);
}

#exam-container #content:has(#part-1.part.visible > .writing-layout) { padding: 25px 30px; }
.part:has(.writing-layout) { margin-bottom: 0; }
.writing-layout { display: flex; gap: 25px; min-height: 450px; margin-top: 15px; }
.writing-layout .col-response { flex: 1.3; display: flex; flex-direction: column; }
.writing-layout .col-response:has(textarea#q1) { flex: 0.9; }	
.writing-layout .col-response textarea {
    flex: 1; min-height: 380px; font-size: 16px; line-height: 1.6;
    padding: 15px; border: 2px solid #0088dd; border-radius: 10px;
    resize: vertical; background: #fafbfc; transition: border-color 0.2s;
}
.writing-layout .col-response textarea:focus { border-color: #0056b3; background: #fff; outline: none; }
.writing-layout .col-instructions {
    flex: 0.9; background: #f8f9fa; padding: 20px; border-radius: 10px;
    border: 1px solid #e9ecef; max-height: 600px; overflow-y: auto;
    font-size: 15px; line-height: 1.5;
}
.writing-layout .col-instructions .task-email { background:#FFF; padding:20px 20px 0; border:1px solid #CCC; margin-bottom:10px; }
	.writing-layout .col-instructions .task-email p {line-height: 1.5}
.writing-layout .col-instructions p { margin-bottom: 9px; }
.writing-layout .col-instructions h3 { margin-top: 0; margin-bottom: 15px; }
.writing-layout .col-instructions ul { padding-left: 20px; margin: 10px 0; }
.writing-layout .col-instructions strong { color: #0088dd; }
.word-count-bar {
    text-align: right; padding: 8px 12px; font-weight: 600; font-size: 0.95em;
    margin-top: 8px; background: #fff; border-radius: 6px; border: 1px solid #dee2e6;
}
.word-count-bar.valid { color: #28a745; border-color: #28a745; background: #f0fff4; }
.word-count-bar.invalid { color: #dc3545; border-color: #dc3545; background: #fff5f5; }
.writing-results-container { max-width: 1200px; margin: 30px auto; padding: 20px; text-align: center; }
.score-summary { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 20px 0; }
.circle-score { position: relative; width: 120px; height: 120px; }
.circle-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.circle-score .bg { fill: none; stroke: #e9ecef; stroke-width: 3; }
.circle-score .circle { fill: none; stroke-width: 3; stroke-linecap: round; }
.score-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 24px; font-weight: bold; }
.criteria-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin: 20px 0; }
.criterion-card { background: #f8f9fa; padding: 15px; border-radius: 10px; border: 1px solid #dee2e6; }
.progress-track { background: #dee2e6; height: 8px; border-radius: 4px; margin: 10px 0; overflow: hidden; }
.progress-fill { height: 100%; transition: width 0.5s; }
.actions { display: flex; gap: 15px; justify-content: center; margin-top: 30px; }
.btn.secondary { background: #6c757d; }
.ai-assessment-overlay { text-align: center; padding: 60px 20px; }
.spinner { border: 4px solid #f3f3f3; border-top: 4px solid #0088dd; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.analysis-section { margin: 30px 0; text-align: left; }
.analysis-card { background: #fff; padding: 15px; border-radius: 10px; border: 1px solid #dee2e6; margin-bottom: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.analysis-card h4 { margin: 0 0 10px 0; color: #0088dd; }
.analysis-card p { margin: 0; line-height: 1.6; color: #495057; white-space: pre-line; }
.errors-section { margin: 30px 0; text-align: left; }
.error-list { background: #fff; padding: 15px 25px; border-radius: 10px; border-left: 4px solid #e74c3c; margin-bottom: 20px; list-style-type: disc; }
.error-list li { margin-bottom: 6px; line-height: 1.5; }
.no-errors { color: #28a745; font-style: italic; list-style: none; }
.task-feedback { background: #e7f3ff; padding: 15px; border-radius: 10px; margin: 20px 0; text-align: left; }
.task-feedback p { line-height: 1.6; white-space: pre-line; }

/*.word-formation-table .adig {
    font-weight: 600;
    color: #0088dd;
    margin-right: 5px;
}*/

/* Responsive */
@media (max-width: 768px) {
    .word-formation-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e1e1e1;
        border-radius: 8px;
    }
    
    .word-formation-table td {
        display: block;
        width: 100%;
    }
    
    .word-formation-table .text-column {
        width: 100%;
        padding-bottom: 10px;
    }
    
    .word-formation-table .word-column {
        width: 100%;
        text-align: left;
        padding-top: 10px;
        padding-right: 15px;
        background: #f0f4f8;
    }
}

/* ============================================
REVIEW SECTION
============================================ */

/* Answer Review Grid Layout */
#answer-review {
    margin-top: 40px;
    text-align: left;
    padding: 30px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

#answer-review h3 {
    text-align: center;
    margin-bottom: 25px;
    border: none;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
    gap: 15px;
}

.review-block {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.review-block.correct {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
}

.review-block.incorrect {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, #f8d7da 0%, #ffffff 100%);
}

.review-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.review-question {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-color);
}

.review-answer {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    word-break: break-word;
    min-height: 20px;
}
.review-answer.answer-long {
    font-size: 70%;
	line-height: 100%;
    display: block;
    margin-top: 0;
}

.review-icon {
    font-size: 24px;
    font-weight: bold;
    margin-top: 5px;
}

.review-block.correct .review-icon {
    color: var(--secondary-color);
}

.review-block.incorrect .review-icon {
    color: var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
    .review-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .review-block {
        padding: 12px 8px;
    }
    
    .review-question {
        font-size: 12px;
    }
    
    .review-answer {
        font-size: 14px;
    }
    
    .review-icon {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .review-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .review-block {
        padding: 10px 5px;
    }
}

/* ============================================
RESULTS SCREEN STYLES
============================================ */
#results-screen {
    text-align: center;
    padding: 40px 30px 0 !important;
    margin-bottom: 0 !important;
}

#results-screen h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #0088dd;
    border: none;
}

#time-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    font-style: normal;
}

/* Score Section */
#score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    /*margin: 30px 0;*/
    font-size: 1.2em;
}

.result-icon {
    font-size: 64px;
    animation: bounce 1s ease infinite;
	display: none;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Circular Progress */
.score-circle {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 20px auto;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
    transition: stroke-dasharray 0.5s ease;
}

@keyframes progress {
    0% {
        stroke-dasharray: 0, 100;
    }
}

.score-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 700;
    color: var(--result-color, #0088dd);
}

.score-fraction {
    font-size: 20px;
    color: #666;
    font-weight: 500;
}

/* Level Badge */
#level-display {
    margin: 25px 0;
}

.level-badge { 
	background: #0088dd; 
	color: #fff; 
	padding: 12px 30px; 
	border-radius: 20px; 
	font-size: 20px; 
	text-transform: uppercase;
    letter-spacing: 1px;
    animation: fadeIn 0.5s ease;
	display: inline-block;
	font-weight: 700;
	margin-bottom: 15px;
}

.level-description {
    font-size: 15px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Result Type Classes */
.result-excellent #results-screen h2 {
    color: #28a745;
}

.result-good #results-screen h2 {
    color: #20c997;
}

.result-satisfactory #results-screen h2 {
    color: #ffc107;
}

.result-basic #results-screen h2 {
    color: #fd7e14;
}

.result-needs-work #results-screen h2 {
    color: #e74c3c;
}

/* Answer Review */
#answer-review {
    margin-top: 40px;
    text-align: left;
    padding: 30px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

#answer-review h3 {
    text-align: center;
    margin-bottom: 25px;
    border: none;
    font-size: 22px;
}

/* Responsive */
@media (max-width: 768px) {
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-percentage {
        font-size: 32px;
    }
    
    .result-icon {
        font-size: 48px;
    }
    
    .level-badge {
        font-size: 18px;
        padding: 10px 20px;
    }
}
/*.review-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-mark {
    font-size: 20px;
    font-weight: bold;
}

.review-mark.correct {
    color: #28a745;
}

.review-mark.incorrect {
    color: #e74c3c;
}

.review-user-ans {
    font-weight: 600;
    color: #0088dd;
}*/

/* ============================================
FOOTER
============================================ */
.page-footer {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    font-size: 14px;
    width: 100%;
}

.page-footer p {
    margin: 0;
    opacity: 0.9;
}

/* ============================================
RESPONSIVE
============================================ */
@media (max-width: 992px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 768px) {
    #exam-header-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .header-left {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-logo {
        height: 40px;
    }
    
    #exam-header-bar h1 {
        font-size: 16px;
    }
    
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    #navigation {
        padding: 10px 15px;
        flex-wrap: wrap;
    }
    
    .part {
        padding: 20px;
    }
    
    .page-footer {
        padding: 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .header-logo {
        height: 35px;
    }
    
    #exam-header-bar h1 {
        font-size: 14px;
    }
    
    .user-display-name {
        font-size: 12px;
    }
    
    #timer {
        font-size: 12px;
        padding: 5px 10px;
    }
}
/* Стили для автоматически расширяющегося input */
.auto-width-input {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    padding: 4px 6px;
    border: none;
    border-bottom: 2px solid #ccc;
    background: transparent;
    color: #333;
    outline: none;
    transition: border-color 0.3s, width 0.2s ease-out;
    vertical-align: middle;
    margin: 0 2px;
    min-width: 40px;
    max-width: 300px;
    text-align: center;
	width: auto !important;
}

.auto-width-input:focus {
    border-bottom-color: #0088dd;
    background-color: #f9fbfd;
}

/* Адаптация под цвета состояний (если нужно будет подсвечивать ошибки прямо во время теста) */
.auto-width-input.correct {
    border-bottom-color: #28a745;
    color: #155724;
    background: rgba(40, 167, 69, 0.1);
}
.auto-width-input.incorrect {
    border-bottom-color: #dc3545;
    color: #721c24;
    background: rgba(220, 53, 69, 0.1);
}
/* -- Система нарушений и кастомное модальное окно --> */

.violation-badge {
  position: fixed; top: 80px; right: 20px; background: #dc3545; color: white;
  padding: 8px 15px; border-radius: 20px; font-weight: 600; font-size: 14px;
  z-index: 1100; box-shadow: 0 4px 15px rgba(220,53,69,0.4); display: none;
  align-items: center; gap: 8px; transition: all 0.3s;
}
.violation-badge.visible { display: flex; animation: pulseRed 1.5s infinite; }
@keyframes pulseRed { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }

.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(9,28,57,0.65); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content {
  background: #ffffff; border-radius: 16px; padding: 30px; max-width: 460px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25); transform: translateY(30px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal-content { transform: translateY(0) scale(1); }
.modal-header { font-size: 20px; font-weight: 700; color: #dc3545; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.modal-body { font-size: 15px; color: #495057; line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
.modal-btn {
  padding: 10px 24px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer;
  font-family: 'Montserrat', sans-serif; font-size: 14px; transition: all 0.2s;
}
.modal-btn.cancel { background: #f1f3f5; color: #495057; }
.modal-btn.cancel:hover { background: #e9ecef; }
.modal-btn.confirm { background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%); color: white; }
.modal-btn.confirm:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,53,69,0.3); }

.dropdown-question-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    vertical-align: middle;
    flex-wrap: nowrap;
}
.dropdown-question-wrapper .question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #999999;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.dropdown-question-wrapper select {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.text-input-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    vertical-align: middle;
    flex-wrap: nowrap;
}

.text-input-wrapper .question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #999;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.text-input-wrapper input[type="text"] {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ============================================
TRUE/FALSE PILL TOGGLE
Клик по зоне → бегунок расширяется в эту сторону
============================================ */
.tf-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    transition: background 0.2s, border-color 0.2s;
    padding: 10px 15px 5px !important;
}
.tf-row:hover {
    background: #fff;
    border-color: #0088dd;
    box-shadow: 0 2px 8px rgba(0, 136, 221, 0.08);
}
.tf-toggle {
    flex-shrink: 0;
}
.tf-number {
    font-weight: 700;
    color: #0088dd;
    font-size: 16px;
    min-width: 18px;
    margin-left: 15px;
}
.tf-question-text {
    flex: 1;
    color: #333;
    line-height: 1.5;
    font-size: 15px;
}

/* Переключатель - контейнер */
.tf-switch {
    position: relative;
    display: inline-block;
    width: 140px;
    height: 36px;
    cursor: pointer;
    border-radius: 18px;
    background-color: #adb5bd; /* серый = не выбрано */
    transition: background-color 0.35s ease;
    overflow: hidden;
    user-select: none;
}

/* Зоны клика */
.tf-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.35s ease;
    user-select: none;
}
.tf-zone-true { left: 0; }
.tf-zone-false { right: 0; }

.tf-zone:hover {
    opacity: 0.8;
}
.tf-zone.tf-zone-true {
	padding-right:5px;
}
.tf-zone.tf-zone-false {
	padding-left:5px;
}
/* Бегунок (pill) - по умолчанию круг по центру */
.tf-pill {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background-color: white;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 2;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.68, -0.15, 0.265, 1.35);
}
.tf-pill:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    transform: translateX(-50%) scale(1.05);
}

.tf-switch.tf-true .tf-pill:hover {
    transform: translateX(0) scale(1.05);
}

.tf-switch.tf-false .tf-pill:hover {
    transform: translateX(-100%) scale(1.05);
}

/* TRUE выбрано - бегунок расширяется вправо, перекрывая FALSE */
.tf-switch.tf-true {
    background-color: #28a745;
}
.tf-switch.tf-true .tf-zone-true {
    opacity: 1;
}
.tf-switch.tf-true .tf-zone-false {
    opacity: 0.15;
}
.tf-switch.tf-true .tf-pill {
    left: 46%;
    width: 72px;
    transform: translateX(0);
}

/* FALSE выбрано - бегунок расширяется влево, перекрывая TRUE */
.tf-switch.tf-false {
    background-color: #dc3545;
}
.tf-switch.tf-false .tf-zone-false {
    opacity: 1;
}
.tf-switch.tf-false .tf-zone-true {
    opacity: 0.15;
}
.tf-switch.tf-false .tf-pill {
    left: 54%;
    width: 72px;
    transform: translateX(-100%);
}

/* Адаптив */
@media (max-width: 768px) {
    .tf-row {
        flex-wrap: wrap;
    }
    .tf-question-text {
        flex-basis: 100%;
        margin-top: 4px;
    }
}




/* ============================================
   WORD ORDER (Jumbled Sentences)
   ============================================ */
.word-order-question {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    min-height: 50px;
    border: 1px solid #dee2e6;
}

.word-block {
    display: inline-block;
    padding: 8px 14px;
    background: white;
    border: 2px solid #0088dd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.word-block:hover {
    background: #0088dd;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 136, 221, 0.3);
}

.word-block.used {
    opacity: 0.25;
    pointer-events: none;
    border-color: #ccc;
    background: #f0f0f0;
}

.word-block.selected {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.word-block.selected:hover {
    background: #dc3545;
    border-color: #dc3545;
}

.answer-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    background: white;
    border: 2px dashed #0088dd;
    border-radius: 8px;
    min-height: 55px;
    align-items: center;
    margin-bottom: 10px;
}

.answer-line:empty::before,
.answer-placeholder {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

.clear-btn {
    padding: 6px 14px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
	text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.3px;
}

.clear-btn:hover {
    background: #dc3545;
    transform: translateY(-1px);
}

/* Адаптив */
@media (max-width: 768px) {
    .word-block {
        padding: 6px 10px;
        font-size: 13px;
    }
    .word-bank, .answer-line {
        padding: 10px;
    }
}

/* ============================================
   WORD ORDER - НОМЕР ВОПРОСА
   ============================================ */
.question-number-label {
    font-size: 18px;
    font-weight: 700;
    /*color: #0088dd;*/
    margin: 0 0 10px 0;
	float: right;
}

.word-order-question {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

/* ============================================
   OPEN CLOZE (Write Questions)
   ============================================ */
.open-cloze-question {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.open-cloze-question .question-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.open-cloze-question .answer-hint {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
    padding: 8px 12px;
    background: white;
    border-left: 3px solid #0088dd;
    border-radius: 4px;
    font-style: italic;
}

.open-cloze-question .open-cloze-input {
    border: 2px solid #0088dd;
    border-radius: 6px;
    margin-bottom: 8px;
}

.open-cloze-question .question-suffix {
    font-size: 16px;
    color: #666;
    margin-left: 5px;
}

/* Адаптив */
@media (max-width: 768px) {
    .open-cloze-question .open-cloze-input {
        font-size: 14px;
        padding: 8px;
    }
}

/* ============================================
   LAW WRITING RESULTS - ENHANCED DESIGN
   ============================================ */
.writing-results-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 10px 40px;
}

.results-main-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 30px;
}

/* Score + Level Row */
.score-level-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.circle-score-large {
    position: relative;
    width: 140px;
    height: 140px;
}

.circle-score-large svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-score-large .circle-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 2.5;
}

.circle-score-large .circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    animation: circleProgress 1.2s ease-out forwards;
}

@keyframes circleProgress {
    from { stroke-dasharray: 0 100; }
}

.score-percentage-large {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

.level-badge-large {
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Task Results Grid */
.task-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.task-result-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px 15px;
    text-align: center;
}

.task-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-result-score {
    font-size: 24px;
    font-weight: 700;
    color: #0088dd;
}

/* Section Titles */
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 35px 0 20px;
    text-align: center;
}

/* Detailed Answers */
.detailed-answers-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.answers-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #0088dd;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #ccc;
}

.answer-item.answer-correct {
    border-left-color: #28a745;
    background: #f0fff4;
}

.answer-item.answer-incorrect {
    border-left-color: #e74c3c;
    background: #fff5f5;
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.answer-number {
    font-weight: 700;
    font-size: 16px;
    color: #0088dd;
}

.answer-status {
    font-weight: 700;
    font-size: 14px;
}

.answer-correct .answer-status {
    color: #28a745;
}

.answer-incorrect .answer-status {
    color: #e74c3c;
}

.answer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.answer-user, .answer-correct-ref {
    font-size: 14px;
    color: #333;
}

.answer-user strong, .answer-correct-ref strong {
    color: #495057;
    margin-right: 8px;
}

.answer-text {
    font-style: italic;
    color: #666;
}

.answer-feedback {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
}

/* Criteria Grid */
.criteria-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.criterion-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 18px 15px;
    text-align: center;
}

.criterion-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.criterion-score {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Task Analysis */
.task-analysis-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.task-analysis-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #0088dd;
}

.task-analysis-title {
    font-size: 15px;
    font-weight: 700;
    color: #0088dd;
    margin-bottom: 12px;
}

.task-analysis-text {
    font-size: 14px;
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

/* Errors Block */
.errors-block {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 20px;
}

.errors-block .no-errors {
    color: #28a745;
    font-style: italic;
    margin: 0;
    font-size: 14px;
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-list li {
    padding: 10px 15px;
    margin: 8px 0;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 5px;
    font-size: 14px;
    color: #856404;
}

/* Recommendations */
.recommendations-block {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
}

.recommendations-block h4 {
    color: #0088dd;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.recommendations-block p {
    color: #495057;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* Action Buttons */
.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

.btn-result {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
}

.btn-back {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: white;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 136, 221, 0.4);
}

.btn-analysis {
    background: linear-gradient(135deg, #091c39 0%, #0088dd 100%);
    color: white;
}

.btn-analysis:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(9, 28, 57, 0.4);
}

.btn-retry {
    background: #6c757d;
    color: white;
}

.btn-retry:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .task-results-grid {
        grid-template-columns: 1fr;
    }
    .criteria-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .score-level-row {
        flex-direction: column;
    }
    .results-actions {
        flex-direction: column;
    }
    .btn-result {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .criteria-grid {
        grid-template-columns: 1fr;
    }
    .results-main-title {
        font-size: 24px;
    }
}