* {
    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;
    overflow: hidden;
}

.screen {
    display: none;
    width: 100vw;
    height: 100vh;
}

.screen.active {
    display: flex;
}

/* Welcome Screen */
#welcome-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.welcome-container {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.welcome-container h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
}

.welcome-container p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 2rem;
}

#student-name {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

#student-name:focus {
    border-color: #667eea;
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
}

.start-btn:hover {
    transform: translateY(-2px);
}

.test-info {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    color: #666;
}

/* Test Screen */
#test-screen {
    flex-direction: column;
    background: #f5f7fa;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.student-info {
    font-weight: 600;
    color: #333;
}

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c;
    background: #fff5f5;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 2px solid #e74c3c;
}

.question-nav {
    font-weight: 600;
    color: #333;
}

.test-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.question-panel {
    flex: 2;
    padding: 2rem;
    overflow-y: auto;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.subject-tag {
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.subject-tag.chemistry {
    background: #e74c3c;
}

.subject-tag.maths {
    background: #27ae60;
}

.question-number {
    font-weight: 600;
    color: #666;
}

.question-text {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.options {
    display: grid;
    gap: 1rem;
}

.option {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.option-label {
    font-weight: 600;
    margin-right: 1rem;
    min-width: 30px;
}

.navigation-panel {
    flex: 1;
    background: white;
    padding: 2rem;
    border-left: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex: 1;
}

.question-btn {
    aspect-ratio: 1;
    border: 2px solid #e1e5e9;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-btn:hover {
    border-color: #667eea;
}

.question-btn.current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.question-btn.answered {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.nav-buttons button {
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#prev-btn, #next-btn {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

#prev-btn:hover, #next-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

#prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn {
    background: #e74c3c !important;
    color: white !important;
    border: 2px solid #e74c3c !important;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: #c0392b !important;
    border-color: #c0392b !important;
}

/* Result Screen */
#result-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.result-container {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 600px;
    width: 90%;
}

.result-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.student-result h3 {
    text-align: center;
    color: #667eea;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.score-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.score-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.score-label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.score-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.subject-wise-score h4 {
    margin-bottom: 1rem;
    color: #333;
}

.subject-scores {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.subject-score {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.result-actions {
    display: flex;
    gap: 1rem;
}

.review-btn, .restart-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.review-btn {
    background: #667eea;
    color: white;
}

.restart-btn {
    background: #27ae60;
    color: white;
}

.review-btn:hover {
    background: #5a6fd8;
}

.restart-btn:hover {
    background: #229954;
}

/* Responsive */
@media (max-width: 768px) {
    .test-content {
        flex-direction: column;
    }
    
    .navigation-panel {
        border-left: none;
        border-top: 1px solid #e1e5e9;
        flex: none;
        height: 200px;
    }
    
    .question-grid {
        grid-template-columns: repeat(10, 1fr);
    }
    
    .nav-buttons {
        flex-direction: row;
    }
    
    .score-summary {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
}
/* Test Selection Styles */
.test-selection {
    margin: 2rem 0;
    text-align: left;
}

.test-selection h3 {
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

.test-options {
    display: grid;
    gap: 2rem;
}

.test-category h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.test-option-btn {
    width: 100%;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.test-option-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.test-option-btn.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.test-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.test-details {
    font-size: 0.9rem;
    opacity: 0.8;
}

.start-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.features-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.feature {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

/* Question Meta Styles */
.question-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.year-tag, .session-tag {
    background: #f8f9fa;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid #e1e5e9;
}

.year-tag {
    background: #e8f4fd;
    color: #1976d2;
    border-color: #1976d2;
}

.session-tag {
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #7b1fa2;
}

/* Enhanced subject tags */
.subject-tag.physics {
    background: #2196f3;
}

.subject-tag.chemistry {
    background: #f44336;
}

.subject-tag.mathematics {
    background: #4caf50;
}

/* Review Screen Styles */
#review-screen {
    display: none;
    flex-direction: column;
    background: #f5f7fa;
}

.review-header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.review-question {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.review-question.correct {
    border-left: 5px solid #27ae60;
}

.review-question.incorrect {
    border-left: 5px solid #e74c3c;
}

.review-question.unanswered {
    border-left: 5px solid #f39c12;
}

.review-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.review-status {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.review-status.correct {
    background: #d4edda;
    color: #155724;
}

.review-status.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.review-status.unanswered {
    background: #fff3cd;
    color: #856404;
}

.review-options {
    margin: 1rem 0;
}

.review-option {
    padding: 0.8rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.review-option.user-answer {
    background: #fff3cd;
    border-color: #ffc107;
}

.review-option.correct-answer {
    background: #d4edda;
    border-color: #28a745;
}

.review-option.user-answer.correct-answer {
    background: #d4edda;
    border-color: #28a745;
}

.review-explanation {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid #667eea;
}

.explanation-title {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
}