* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-weight: 600;
}

.question-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
    transition: transform 0.2s ease;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.question-number {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #333;
}

.context-text {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    color: #856404;
    font-size: 0.95em;
    line-height: 1.6;
    font-style: italic;
}

.code-block {
    background: #2d2d2d;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
    border-left: 4px solid #667eea;
}

.code-block pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    background: transparent;
}

.code-block code {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    tab-size: 4;
    color: #f8f8f2;
}

/* Prism.js theme adjustments for better Java syntax highlighting */
.code-block .token.keyword {
    color: #c678dd;
    font-weight: 600;
}

.code-block .token.string {
    color: #98c379;
}

.code-block .token.comment {
    color: #5c6370;
    font-style: italic;
}

.code-block .token.function {
    color: #61afef;
}

.code-block .token.class-name {
    color: #e5c07b;
}

.code-block .token.number {
    color: #d19a66;
}

.code-block .token.operator {
    color: #56b6c2;
}

.code-block .token.punctuation {
    color: #abb2bf;
}

.options {
    list-style: none;
}

.option {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.option:hover {
    border-color: #667eea;
    background: #f0f0ff;
    transform: translateX(5px);
}

.option input[type="radio"],
.option input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option.selected {
    border-color: #667eea;
    background: #e8eaff;
}

.option.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

.option.correct-selected {
    border-color: #4caf50;
    background: #c8e6c9;
    font-weight: 600;
}

.option.incorrect {
    border-color: #f44336;
    background: #ffebee;
}

.correct-mark {
    color: #4caf50;
    font-weight: bold;
    font-size: 1.2em;
    margin-left: 10px;
}

.incorrect-mark {
    color: #f44336;
    font-weight: bold;
    font-size: 1.2em;
    margin-left: 10px;
}

.option input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.option input:disabled + label {
    cursor: not-allowed;
    opacity: 0.8;
}

.option.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.option.disabled:hover {
    transform: none;
    border-color: inherit;
    background: inherit;
}

.explanation {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.explanation.show {
    display: block;
}

.explanation-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 5px;
    display: inline-block;
}

.explanation-title.correct-title {
    color: #2e7d32;
    background: #c8e6c9;
}

.explanation-title.incorrect-title {
    color: #c62828;
    background: #ffcdd2;
}

.explanation-text {
    color: #555;
    line-height: 1.6;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results-container {
    text-align: center;
}

.score-display {
    margin: 30px 0;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.score-text {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.results-summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.summary-item {
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1em;
}

.summary-item.correct {
    background: #e8f5e9;
    color: #2e7d32;
}

.summary-item.incorrect {
    background: #ffebee;
    color: #c62828;
}

.summary-icon {
    font-size: 1.3em;
    margin-right: 8px;
}

.questions-review {
    text-align: left;
    margin-top: 40px;
}

.review-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 5px solid #ddd;
}

.review-item.correct {
    border-left-color: #4caf50;
}

.review-item.incorrect {
    border-left-color: #f44336;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.review-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.review-status.correct {
    background: #4caf50;
    color: white;
}

.review-status.incorrect {
    background: #f44336;
    color: white;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .question-card {
        padding: 20px;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .results-summary {
        flex-direction: column;
        gap: 15px;
    }
}

