/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.back-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    transition: background 0.3s;
}

.back-link:hover {
    background: rgba(255,255,255,0.3);
}

.test-info {
    font-size: 1.2em;
    margin-top: 10px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
}

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

/* Actions */
.actions {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.form-group input[type="file"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 14px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    cursor: pointer;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
    border-left: 4px solid #c53030;
}

/* Info Box */
.info-box {
    background: #ebf8ff;
    border-left: 4px solid #3182ce;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

/* File List */
.files-section {
    margin-top: 30px;
}

.files-section h3 {
    margin-bottom: 15px;
    color: #2d3748;
}

.file-list {
    list-style: none;
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
}

.file-list li {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.file-list li:last-child {
    border-bottom: none;
}

/* Code */
pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
}

code {
    font-family: 'Courier New', monospace;
}

details {
    margin-top: 20px;
}

summary {
    cursor: pointer;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Test Styles */
.progress-bar {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #48bb78, #38a169);
    height: 100%;
    transition: width 0.3s;
}

.test-card {
    min-height: 400px;
}

.question-number {
    font-size: 14px;
    color: #718096;
    margin-bottom: 10px;
    font-weight: 600;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3748;
    line-height: 1.5;
}

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

.option-label {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.option-label:hover {
    background: #f7fafc;
    border-color: #667eea;
}

.option-label input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
}

.option-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

.test-navigation {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Question Navigator */
.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.nav-btn {
    padding: 12px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #f7fafc;
    transform: translateY(-2px);
}

.nav-btn.answered {
    background: #c6f6d5;
    border-color: #48bb78;
}

.nav-btn.current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.legend {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #718096;
}

.legend-item {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 5px;
    vertical-align: middle;
}

.legend-item.answered {
    background: #c6f6d5;
    border: 2px solid #48bb78;
}

.legend-item.current {
    background: #667eea;
}

.legend-item.unanswered {
    background: white;
    border: 2px solid #e2e8f0;
}

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

.result-header {
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.result-header.pass {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.result-header.fail {
    background: linear-gradient(135deg, #fc8181, #f56565);
    color: white;
}

.result-header h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.score-big {
    font-size: 4em;
    font-weight: 700;
    line-height: 1;
}

.score-details {
    font-size: 1.5em;
    margin-top: 10px;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-item.correct {
    background: #c6f6d5;
}

.stat-item.incorrect {
    background: #fed7d7;
}

.stat-item.unanswered {
    background: #e2e8f0;
}

.stat-item.total {
    background: #bee3f8;
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #718096;
}

.test-settings {
    text-align: left;
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.test-settings p {
    margin-bottom: 8px;
}

/* Review */
.review-item {
    border-left: 4px solid #e2e8f0;
    padding: 20px;
    margin-bottom: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

.review-item.correct {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.review-item.incorrect {
    border-left-color: #f56565;
    background: #fff5f5;
}

.review-item.unanswered {
    border-left-color: #cbd5e0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-num {
    font-weight: 700;
    color: #2d3748;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.review-item.correct .status-badge {
    background: #48bb78;
    color: white;
}

.review-item.incorrect .status-badge {
    background: #f56565;
    color: white;
}

.review-item.unanswered .status-badge {
    background: #cbd5e0;
    color: #4a5568;
}

.review-question {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2d3748;
}

.review-options {
    margin-bottom: 15px;
}

.review-option {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: white;
}

.review-option.correct-option {
    background: #c6f6d5;
    font-weight: 600;
}

.review-option.wrong-option {
    background: #fed7d7;
    font-weight: 600;
}

.review-answer {
    font-size: 14px;
    color: #4a5568;
}

.review-answer p {
    margin-bottom: 5px;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .score-big {
        font-size: 3em;
    }
}
