:root {
    --primary-color: #2a6496;
    --secondary-color: #f8f9fa;
    --accent-color: #e74c3c;
    --text-color: #333;
    --border-color: #dee2e6;
    --success-color: #27ae60;
    --error-color: #e74c3c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

h2 {
    color: var(--primary-color);
    margin: 25px 0 15px 0;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

h3 {
    color: var(--primary-color);
    margin: 20px 0 10px 0;
}

.exam-info {
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.exam-info p {
    margin-bottom: 10px;
}

.section {
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.intro-text {
    margin-bottom: 20px;
}

.question-block {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: var(--secondary-color);
}

.question {
    font-weight: bold;
    margin-bottom: 10px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.option:hover {
    background-color: #e9ecef;
}

.option input {
    margin-right: 10px;
}

.true-false .option {
    width: auto;
    display: inline-flex;
    margin-right: 20px;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #1d4568;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#submit-btn {
    background-color: #27ae60;
    font-weight: bold;
    padding: 12px 24px;
    font-size: 1.1rem;
    display: block;
    margin: 20px auto;
}

#submit-btn:hover {
    background-color: #219653;
}

.result {
    display: none;
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.result h2 {
    color: var(--primary-color);
    border-bottom: none;
}

.score {
    font-size: 2rem;
    margin: 20px 0;
    font-weight: bold;
}

.feedback {
    margin-top: 10px;
    font-weight: bold;
}

.correct-answer {
    color: var(--success-color);
}

.wrong-answer {
    color: var(--error-color);
}

.section-score {
    margin: 15px 0;
    font-size: 1.1rem;
}

.message {
    margin-top: 20px;
    font-style: italic;
}

.hidden {
    display: none;
}

.progress-container {
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    position: sticky;
    top: 10px;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.progress-bar {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.text {
    margin-bottom: 15px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .question-block {
        padding: 10px;
    }
}

.match-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.match-item select {
    margin-left: 10px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Styles for showing correct/incorrect answers */
.option.correct {
    background-color: rgba(39, 174, 96, 0.2);
}

.option.incorrect {
    background-color: rgba(231, 76, 60, 0.2);
}

.footer {
    text-align: center;
    padding: 16px 0;
    color: #888;
    font-size: 0.95rem;
    background: none;
    margin-top: 40px;
}

.progress-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.timer-datetime-group {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 1.1rem;
}

.exam-timer-row {
    display: none;
}

body.exam-inactive #exam-form,
body.exam-inactive #exam-timer,
body.exam-inactive #submit-btn,
body.exam-inactive .progress-bar {
    pointer-events: none;
    opacity: 0.5;
}
body.exam-inactive #exam-timer {
    opacity: 0.7;
}
#start-exam-btn {
    background-color: #27ae60;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 18px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
#start-exam-btn:hover {
    background-color: #219653;
}
#reset-exam-btn {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 18px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
#reset-exam-btn:hover {
    background-color: #c0392b;
}

.exam-guide {
    background: #f8f9fa;
    border-left: 4px solid #2a6496;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 1rem;
    color: #333;
}

.writing-info {
    margin-bottom: 18px;
    font-size: 1.05rem;
}
.writing-task {
    margin-bottom: 28px;
}
.writing-task textarea {
    font-size: 1.05rem;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    resize: vertical;
    min-height: 180px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.word-count {
    margin-top: 6px;
    font-size: 0.98rem;
    color: #888;
    text-align: right;
}
.writing-eval {
    background: #f8f9fa;
    border-left: 4px solid #2a6496;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 1rem;
    color: #333;
}
.writing-eval ul {
    margin: 8px 0 8px 18px;
}
.writing-task ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 12px;
}
.writing-task ul li {
    margin-bottom: 14px;
    padding-left: 32px;
    position: relative;
}
.writing-task ul li strong {
    display: inline-block;
    width: 22px;
    font-size: 1.08em;
    color: #2a6496;
    position: absolute;
    left: 0;
    top: 0;
}
.writing-task ul li em {
    display: block;
    color: #555;
    font-size: 0.98em;
    margin-top: 2px;
    margin-bottom: 2px;
}
.writing-note {
    font-size: 0.93rem;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}