* {
    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;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: #2c3e50;
    color: white;
    padding: 20px 30px;
}

header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.exam-info {
    display: flex;
    gap: 15px;
    font-size: 16px;
    color: #ecf0f1;
}

.separator {
    color: #7f8c8d;
}

#timer {
    font-weight: bold;
    color: #3498db;
}

#timer.warning {
    color: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.screen {
    display: none;
    padding: 30px;
}

.screen.active {
    display: block;
}

/* Start Screen */
#start-screen {
    text-align: center;
}

#start-screen h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

#exam-selector {
    margin: 20px 0;
}

#exam-selector select {
    padding: 10px 20px;
    font-size: 16px;
    border: 2px solid #3498db;
    border-radius: 5px;
    background: white;
    cursor: pointer;
}

.saved-exams {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.saved-exam-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 10px 0;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
}

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

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e67e22;
}

.btn-warning.flagged {
    background: #e74c3c;
}

.btn-success {
    background: #27ae60;
    color: white;
    margin-top: 20px;
}

.btn-success:hover {
    background: #229954;
}

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #ecf0f1;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%);
    transition: width 0.3s;
}

.question-counter {
    text-align: center;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* Question Container */
#question-container {
    margin: 30px 0;
}

#question-text {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 25px;
    line-height: 1.6;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.choice {
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.choice:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.choice.selected {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.choice-letter {
    font-weight: bold;
    min-width: 30px;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 10px;
}

/* Question Grid */
.question-grid-toggle {
    text-align: center;
    margin: 20px 0;
}

.question-grid {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.question-grid.hidden {
    display: none;
}

.question-grid h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#grid-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
}

.grid-btn {
    padding: 10px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.grid-btn:hover {
    background: #e9ecef;
}

.grid-btn.answered {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.grid-btn.flagged {
    background: #f39c12;
    color: white;
    border-color: #e67e22;
}

.grid-btn.current {
    border-color: #2c3e50;
    border-width: 3px;
}

/* Results Screen */
.results-summary {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-size: 18px;
    color: #7f8c8d;
}

.result-value {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
}

#review-container {
    margin-top: 30px;
}

#review-container h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.review-question {
    background: #f8f9fa;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.review-question.incorrect {
    border-left-color: #e74c3c;
}

.review-question.correct {
    border-left-color: #27ae60;
}

.review-question-header {
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}

.review-answer {
    margin: 5px 0;
    padding: 8px;
    border-radius: 4px;
}

.review-answer.your-answer {
    background: #e8f4f8;
}

.review-answer.correct-answer {
    background: #d5f4e6;
}

.review-answer.incorrect-answer {
    background: #fadbd8;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }

    header h1 {
        font-size: 20px;
    }

    .exam-info {
        flex-direction: column;
        gap: 5px;
    }

    .navigation {
        flex-direction: column;
    }

    #grid-buttons {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }
}

.site-credit {
    padding: 16px 30px 20px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
}
