/* Quiz Pages Styles */

/* Quiz Header */
.quiz-header {
    background: #000000;
    color: white;
    padding: 1.5rem 0 1rem;
}

.quiz-header h1 {
    font-size: 1.875rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.quiz-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Quiz Info Bar */
.quiz-info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-icon {
    font-size: 2rem;
}

.info-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.info-value {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #000000;
    background: #f9fafb;
}

.tab-btn.active {
    color: #000000;
    border-bottom-color: #000000;
}

/* Quiz Content */
.quiz-content {
    padding: 3rem 0;
    min-height: 60vh;
}

/* Quiz Grid */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.quiz-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    cursor: pointer;
}

.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #000000;
}

.quiz-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quiz-icon {
    width: 48px;
    height: 48px;
    background: #000000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.quiz-card-title {
    flex: 1;
}

.quiz-card-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.quiz-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    text-transform: capitalize;
}

.quiz-card-meta {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-item svg {
    width: 16px;
    height: 16px;
}

.quiz-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.difficulty-badge {
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    text-transform: capitalize;
}

.difficulty-badge.easy {
    background: #d1fae5;
    color: #065f46;
}

.difficulty-badge.intermediate {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-badge.hard {
    background: #fee2e2;
    color: #991b1b;
}

.btn-start-quiz {
    padding: 0.5rem 1.25rem;
    background: #000000;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-start-quiz:hover {
    background: #4338ca;
}

/* Quiz Sets Grid */
.quiz-sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.quiz-set-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.quiz-set-card:hover {
    border-color: #000000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.quiz-set-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.set-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000000;
}

.set-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.quiz-set-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quiz-set-content p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.btn-start-set {
    width: 100%;
    padding: 0.75rem;
    background: #000000;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-start-set:hover {
    background: #4338ca;
    transform: translateY(-2px);
}

/* Quiz Taking Styles */
.quiz-taking-body {
    background: #f9fafb;
}

.quiz-taking-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.quiz-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.quiz-header-left h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.quiz-header-left p {
    color: #6b7280;
    font-size: 0.875rem;
}

.quiz-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.quiz-progress-info {
    text-align: right;
}

.progress-text {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.btn-exit {
    padding: 0.5rem 1.25rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-exit:hover {
    background: #dc2626;
}

.quiz-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #000000;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Quiz Taking Content */
.quiz-taking-content {
    padding: 3rem 0;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.question-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.question-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.question-source {
    font-size: 0.875rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
}

.question-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #111827;
    margin-bottom: 2rem;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.option-item.selected {
    background: #f3f4f6;
    border-color: #000000;
}

.option-item.correct {
    background: #d1fae5;
    border-color: #10b981;
}

.option-item.incorrect {
    background: #fee2e2;
    border-color: #ef4444;
}

.option-item.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
    position: relative;
    margin-top: 0.125rem;
}

.option-item.selected .option-radio {
    border-color: #000000;
    background: #000000;
}

.option-item.selected .option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.option-item.correct .option-radio {
    border-color: #10b981;
    background: #10b981;
}

.option-item.incorrect .option-radio {
    border-color: #ef4444;
    background: #ef4444;
}

.option-content {
    flex: 1;
}

.option-label {
    font-weight: 600;
    color: #000000;
    margin-right: 0.5rem;
}

.option-text {
    color: #374151;
    line-height: 1.6;
}

/* Quiz Navigation */
.quiz-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

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

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

#btnNext, #btnFinish {
    margin-left: auto;
}

/* Results */
.results-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.results-header {
    margin-bottom: 2rem;
}

.results-icon {
    margin-bottom: 1rem;
}

.results-icon svg {
    color: #10b981;
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.results-header p {
    color: #6b7280;
    font-size: 1.125rem;
}

.results-score {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
}

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-percentage {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: #000000;
    line-height: 1;
}

.score-fraction {
    display: block;
    font-size: 1.125rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.results-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.result-item {
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item.correct {
    background: #d1fae5;
}

.result-item.incorrect {
    background: #fee2e2;
}

.result-label {
    font-weight: 500;
    color: #374151;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.result-item.correct .result-value {
    color: #10b981;
}

.result-item.incorrect .result-value {
    color: #ef4444;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Review */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.review-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.review-question {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.review-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.review-question-number {
    font-weight: 600;
    color: #000000;
}

.review-status {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.review-status.correct {
    background: #d1fae5;
    color: #065f46;
}

.review-status.incorrect {
    background: #fee2e2;
    color: #991b1b;
}

.review-question-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #111827;
    margin-bottom: 1rem;
}

.review-explanation {
    background: #f9fafb;
    border-left: 4px solid #000000;
    padding: 1rem;
    margin-top: 1rem;
}

.review-explanation-label {
    font-weight: 600;
    color: #000000;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.review-explanation-text {
    color: #374151;
    line-height: 1.6;
}

.review-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.section-description {
    color: #6b7280;
    font-size: 1.125rem;
}

/* Loading and Empty States */
.loading-state {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: #6b7280;
    font-size: 1.125rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 0;
}

.empty-state svg {
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .quiz-header h1 {
        font-size: 1.5rem;
    }
    
    .stats-bar {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .quiz-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-sets-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .quiz-header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .question-card {
        padding: 1.5rem;
    }
    
    .quiz-navigation {
        flex-direction: column;
    }
    
    #btnNext, #btnFinish {
        margin-left: 0;
    }
    
    .results-card {
        padding: 2rem 1.5rem;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-actions button {
        width: 100%;
    }
}
