/* Quiz Styles */
.quiz-container {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.quiz-header {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.quiz-info {
    flex: 1;
    min-width: 300px;
}

.quiz-info h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.quiz-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Domain Selection */
.domain-selection {
    flex: 1;
    min-width: 300px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.domain-form {
    margin-top: 15px;
}

.domain-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border-radius: 5px;
}

.domain-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.domain-checkbox:hover {
    background: #f0f7ff;
}

.domain-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
}

.domain-checkbox input:checked + .checkmark {
    background: #3498db;
    border-color: #3498db;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.domain-checkbox input:checked + .checkmark:after {
    display: block;
}

/* Progress Bar */
.quiz-progress {
    margin-bottom: 30px;
}

.progress-bar {
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #1abc9c);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Question Cards */
.questions-container {
    position: relative;
    min-height: 400px;
}

.question-card {
    display: none;
    animation: fadeIn 0.5s ease;
}

.question-card.active {
    display: block;
}

@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;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.question-number {
    font-weight: bold;
    color: #3498db;
    font-size: 1.1rem;
}

.question-domain {
    background: #e8f4fc;
    color: #2980b9;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.question-difficulty {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.difficulty-easy {
    background: #d5f4e6;
    color: #27ae60;
}

.difficulty-medium {
    background: #fff3cd;
    color: #f39c12;
}

.difficulty-hard {
    background: #fde8e8;
    color: #e74c3c;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #2c3e50;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

/* Answers */
.answers-container {
    display: grid;
    gap: 10px;
    margin-bottom: 25px;
}

.answer-option {
    position: relative;
}

.answer-option input[type="radio"] {
    display: none;
}

.answer-option label {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.answer-option label:hover {
    border-color: #3498db;
    background: #f0f7ff;
    transform: translateX(5px);
}

.answer-option input:checked + label {
    border-color: #3498db;
    background: #e8f4fc;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.2);
}

.answer-letter {
    width: 35px;
    height: 35px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.answer-option input:checked + label .answer-letter {
    background: #2980b9;
}

.answer-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.5;
}

/* Explanation */
.explanation-container {
    margin-top: 25px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2e7d32;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.explanation-content {
    color: #555;
    line-height: 1.6;
}

/* Question Navigation */
.question-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.btn-prev, .btn-next, .btn-submit {
    min-width: 150px;
}

.btn-filter {
    margin-right: 10px;
}

/* Quiz Controls */
.quiz-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.question-jump {
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-jump select {
    padding: 8px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.question-jump select:focus {
    outline: none;
    border-color: #3498db;
}

/* Timer */
.quiz-timer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 100;
}

/* Flagged questions */
.question-card.flagged .question-header {
    border-left: 4px solid #ff9800;
    padding-left: 10px;
}

/* Results Page Styles */
.results-container {
    flex: 1;
}

.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .results-summary {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.score-circle {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    border-radius: 50%;
    background: #ecf0f1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.score-value {
    font-size: 3rem;
    font-weight: bold;
    color: #2c3e50;
    z-index: 2;
}

.score-grade {
    font-size: 1.2rem;
    color: #7f8c8d;
    z-index: 2;
}

.score-details {
    margin: 25px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.detail-item {
    text-align: center;
}

.detail-label {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.3rem;
    font-weight: bold;
}

.detail-value.correct {
    color: #27ae60;
}

.detail-value.incorrect {
    color: #e74c3c;
}

.summary-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Domain Performance */
.domain-performance {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.domain-stat {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.domain-name {
    flex: 2;
    font-size: 0.9rem;
    color: #2c3e50;
}

.domain-bar {
    flex: 3;
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #1abc9c);
    border-radius: 5px;
    transition: width 1s ease;
}

.domain-score {
    flex: 1;
    text-align: right;
    font-weight: bold;
    color: #2c3e50;
}

/* Detailed Results */
.detailed-results {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.result-item {
    margin-bottom: 30px;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid;
    animation: slideIn 0.5s ease;
}

.result-item.correct {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.result-item.incorrect {
    background: #ffebee;
    border-left-color: #f44336;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.result-number {
    font-weight: bold;
    color: #2c3e50;
}

.result-domain {
    background: rgba(255,255,255,0.8);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.result-status {
    font-weight: bold;
}

.result-item.correct .result-status {
    color: #4caf50;
}

.result-item.incorrect .result-status {
    color: #f44336;
}

.result-question {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #2c3e50;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.answer-result {
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: white;
    position: relative;
}

.correct-answer {
    border-color: #4caf50;
    background: #e8f5e9;
}

.incorrect-answer {
    border-color: #f44336;
    background: #ffebee;
}

.user-selection, .correct-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.user-selection {
    background: #3498db;
    color: white;
}

.correct-indicator {
    background: #4caf50;
    color: white;
}

.result-explanation {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}