* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00695c;
    --primary-dark: #004d40;
    --primary-light: #4db6ac;
    --secondary: #ff6f00;
    --success: #2e7d32;
    --error: #c62828;
    --warning: #f57c00;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #212121;
    --text-light: #757575;
    --border: #e0e0e0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.header h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 5px;
}

.tagline {
    color: var(--text-light);
    font-size: 1rem;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card, .welcome-card, .results-card, .question-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Welcome Screen */
.welcome-card {
    text-align: center;
}

.welcome-card .icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.welcome-card h2 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.welcome-card > p {
    color: var(--text-light);
    margin-bottom: 30px;
}

.exam-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg);
    border-radius: 12px;
}

.info-item {
    text-align: center;
}

.info-item .label {
    display: block;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.info-item .value {
    display: block;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.subject-areas {
    text-align: left;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 12px;
    color: white;
}

.subject-areas h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.subject-areas ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.subject-areas li {
    padding-left: 20px;
    position: relative;
    font-size: 0.95rem;
}

.subject-areas li::before {
    content: '✓';
    position: absolute;
    left: 0;
}

/* Form */
.student-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.student-form input,
.student-form select {
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.student-form input:focus,
.student-form select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-submit {
    background: var(--secondary);
    color: white;
    width: 100%;
    margin-top: 20px;
}

.btn-submit:hover {
    background: #e65100;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Test Screen */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.test-info {
    display: flex;
    flex-direction: column;
}

#question-counter {
    font-weight: 600;
    color: var(--primary);
}

#category-display {
    font-size: 0.85rem;
    color: var(--text-light);
}

.timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.2rem;
}

.timer.warning {
    background: var(--warning);
    animation: pulse 1s infinite;
}

.timer.danger {
    background: var(--error);
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin-bottom: 25px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Question Card */
.question-card {
    margin-bottom: 25px;
    min-height: 300px;
}

.question-number {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 25px;
    color: var(--text);
}

/* Options */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    padding: 18px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option:hover {
    border-color: var(--primary-light);
    background: rgba(0, 105, 92, 0.05);
}

.option.selected {
    border-color: var(--primary);
    background: rgba(0, 105, 92, 0.1);
}

.option.correct {
    border-color: var(--success);
    background: rgba(46, 125, 50, 0.1);
}

.option.incorrect {
    border-color: var(--error);
    background: rgba(198, 40, 40, 0.1);
}

.option-letter {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.option.selected .option-letter {
    background: var(--primary);
    color: white;
}

.option-text {
    flex: 1;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.question-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}

.q-nav-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.q-nav-btn:hover {
    border-color: var(--primary);
}

.q-nav-btn.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.q-nav-btn.answered {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

/* Results Screen */
.results-card {
    text-align: center;
}

.result-header {
    margin-bottom: 30px;
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 15px;
}

.result-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.result-header.pass { color: var(--success); }
.result-header.fail { color: var(--error); }

#student-result-name {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Score Circle */
.score-display {
    margin: 30px 0;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg, var(--border) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: white;
    border-radius: 50%;
}

.score-value {
    position: relative;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.stat-item {
    padding: 20px 15px;
    border-radius: 12px;
    background: var(--bg);
}

.stat-item .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-item .stat-label {
    color: var(--text-light);
    font-size: 0.85rem;
}

.stat-item.correct .stat-value { color: var(--success); }
.stat-item.incorrect .stat-value { color: var(--error); }
.stat-item.skipped .stat-value { color: var(--warning); }
.stat-item.time .stat-value { color: var(--primary); }

/* Subject Breakdown */
.subject-breakdown {
    text-align: left;
    margin: 30px 0;
    padding: 25px;
    background: var(--bg);
    border-radius: 12px;
}

.subject-breakdown h3 {
    margin-bottom: 20px;
    color: var(--primary);
}

.breakdown-item {
    margin-bottom: 15px;
}

.breakdown-item:last-child {
    margin-bottom: 0;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.breakdown-name {
    font-weight: 500;
}

.breakdown-score {
    color: var(--primary);
    font-weight: 600;
}

.breakdown-bar {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.breakdown-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Review Screen */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.review-header h2 {
    color: var(--primary);
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.review-item.correct {
    border-left: 4px solid var(--success);
}

.review-item.incorrect {
    border-left: 4px solid var(--error);
}

.review-item.skipped {
    border-left: 4px solid var(--warning);
}

.review-question {
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.6;
}

.review-answers {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.review-option {
    padding: 12px 15px;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-option.correct-answer {
    background: rgba(46, 125, 50, 0.15);
    color: var(--success);
    font-weight: 500;
}

.review-option.user-wrong {
    background: rgba(198, 40, 40, 0.15);
    color: var(--error);
}

.explanation {
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 105, 92, 0.1), rgba(77, 182, 172, 0.1));
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.explanation strong {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .exam-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .subject-areas ul {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navigation {
        flex-direction: column;
    }

    .question-nav {
        order: -1;
        width: 100%;
    }

    .result-actions {
        flex-direction: column;
    }

    .timer {
        font-size: 1rem;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .welcome-card h2 {
        font-size: 1.4rem;
    }

    .question-text {
        font-size: 1rem;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    .score-circle::before {
        width: 120px;
        height: 120px;
    }

    .score-value {
        font-size: 2rem;
    }
}
