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

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* Header Styles */
.main-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.main-header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
}

/* Exam Grid */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.exam-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.exam-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.exam-card:hover::before {
    transform: scaleX(1);
}

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

.exam-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.exam-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.exam-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.info-item {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Exam Page Styles */
.exam-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

.exam-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

.exam-info h1 {
    margin-bottom: 15px;
    font-size: 2rem;
}

.exam-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.meta-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.progress-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #00d9ff;
    border-radius: 5px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-weight: 600;
    min-width: 50px;
}

/* Question Container */
.question-container {
    padding: 40px;
}

.loading {
    text-align: center;
    font-size: 1.5rem;
    color: #666;
    padding: 100px 0;
}

.question-card {
    animation: fadeIn 0.5s ease;
}

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

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.question-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
}

.question-topic {
    background: #f8f9fa;
    padding: 8px 20px;
    border-radius: 20px;
    color: #666;
    font-size: 0.9rem;
}

.difficulty-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.difficulty-easy {
    background: #d4edda;
    color: #155724;
}

.difficulty-medium {
    background: #fff3cd;
    color: #856404;
}

.difficulty-hard {
    background: #f8d7da;
    color: #721c24;
}

.difficulty-very_hard {
    background: #f5c6cb;
    color: #721c24;
}

.question-text {
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 30px;
    color: #333;
}

.marks-info {
    background: #e7f3ff;
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 20px;
    color: #0066cc;
    font-weight: 600;
}

.options-container {
    display: grid;
    gap: 15px;
}

.option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 15px 25px;
    border-radius: 12px;
    text-align: right;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(-5px);
}

.option-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.option-btn::before {
    content: attr(data-letter);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    font-weight: 600;
}

/* Exam Footer */
.exam-footer {
    background: #f8f9fa;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

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

.next-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.next-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.question-counter {
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
}

/* Results Page Styles */
.results-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

.results-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.results-main {
    padding: 40px;
}

.score-card {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 20px;
    margin-bottom: 40px;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.score-number {
    font-size: 4rem;
    font-weight: 700;
    color: white;
}

.score-total {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.score-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.score-message {
    color: #666;
    font-size: 1.2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
}

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

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Section Scores */
.section-scores {
    margin-bottom: 40px;
}

.section-scores h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.section-scores > div {
    display: grid;
    gap: 15px;
}

.section-score-item {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-name {
    font-weight: 600;
    color: #333;
}

.section-mark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: 600;
}

/* Answers Review */
.answers-review {
    margin-bottom: 40px;
}

.answers-review h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.answer-item {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.answer-item.correct {
    border-color: #28a745;
    background: #d4edda;
}

.answer-item.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.answer-question {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.answer-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.answer-status.correct {
    background: #28a745;
    color: white;
}

.answer-status.incorrect {
    background: #dc3545;
    color: white;
}

.answer-details {
    color: #666;
    line-height: 1.6;
}

.explanation {
    background: rgba(102, 126, 234, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    border-right: 3px solid #667eea;
}

.explanation strong {
    color: #667eea;
}

/* Actions */
.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    border: none;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.action-btn.secondary {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
}

.action-btn.secondary:hover {
    background: #667eea;
    color: white;
}

.results-footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2rem;
    }

    .exam-grid {
        grid-template-columns: 1fr;
    }

    .exam-header {
        padding: 20px;
    }

    .exam-info h1 {
        font-size: 1.5rem;
    }

    .question-container {
        padding: 20px;
    }

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

    .exam-footer {
        padding: 15px 20px;
    }

    .nav-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .results-main {
        padding: 20px;
    }

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

    .score-number {
        font-size: 3rem;
    }

    .score-total {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-btn {
        width: 100%;
    }
}

@media print {
    body {
        background: white;
    }

    .back-btn,
    .actions,
    .results-footer {
        display: none;
    }
}
