/* === Quiz Page Layout === */
.quiz-header {
    margin-bottom: var(--space-lg);
}

.quiz-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

.quiz-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.quiz-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quiz-feature-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.quiz-feature-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.quiz-about {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.quiz-article {
    line-height: 1.8;
    font-size: 1rem;
    color: var(--color-text);
}

.quiz-article h2 {
    margin-bottom: var(--space-md);
}

.quiz-article-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.quiz-article-image img {
    width: 100%;
    object-fit: cover;
}

.quiz-article p {
    margin-bottom: 1rem;
}

/* === Progress Bar === */
.quiz-progress {
    position: sticky;
    top: 64px;
    z-index: var(--z-sticky);
    background: var(--color-surface);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.progress-bar-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.progress-bar-track {
    flex: 1;
    height: 6px;
    background: var(--color-border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

/* === Question Card === */
.question-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.question-card.upcoming {
    opacity: 0.4;
    pointer-events: none;
}

.question-card.active {
    opacity: 1;
    pointer-events: auto;
    box-shadow: var(--shadow-md);
}

.question-card.answered {
    opacity: 0.7;
    pointer-events: none;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-primary-bg);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: var(--space-lg);
}

.question-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.question-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

/* === Answer Options === */
.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.option-btn {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: 14px var(--space-lg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.option-btn:hover:not(.answered) {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-bg);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.option-text {
    flex: 1;
}

.option-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

/* Correct answer */
.option-btn.correct {
    border-color: var(--color-success);
    background: var(--color-success-bg);
    animation: correctPulse 0.6s ease;
}

.option-btn.correct .option-letter {
    background: var(--color-success);
    color: #fff;
}

.option-btn.correct .option-icon {
    opacity: 1;
    color: var(--color-success);
}

/* Wrong answer */
.option-btn.wrong {
    border-color: var(--color-error);
    background: var(--color-error-bg);
    animation: wrongShake 0.4s ease;
}

.option-btn.wrong .option-letter {
    background: var(--color-error);
    color: #fff;
}

.option-btn.wrong .option-icon {
    opacity: 1;
    color: var(--color-error);
}

/* Answered but not selected */
.option-btn.answered {
    cursor: default;
    opacity: 0.6;
}

.option-btn.answered.correct {
    opacity: 1;
}

.option-btn.answered.wrong {
    opacity: 1;
}

/* === Answer Feedback === */
.answer-feedback {
    display: none;
    margin-top: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.6;
}

.answer-feedback.show {
    display: block;
    animation: fadeSlideUp 0.3s ease;
}

.answer-feedback.correct {
    background: var(--color-success-bg);
    color: #166534;
}

.answer-feedback.wrong {
    background: var(--color-error-bg);
    color: #991b1b;
}

/* === Quiz Result Box === */
.quiz-result {
    display: none;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideUp 0.5s ease;
}

.quiz-result.show {
    display: block;
}

.result-score-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--color-primary) 0%, var(--color-border-light) 0%);
    margin-bottom: var(--space-lg);
    position: relative;
}

.result-score-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: var(--color-surface);
}

.result-score-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}

.result-score-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.result-description {
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

.result-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.result-share {
    display: flex;
    gap: var(--space-sm);
}

/* === Personality Quiz Specifics === */
.option-btn.personality:hover:not(.selected) {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
}

.option-btn.personality.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
    transform: scale(1.02);
}

.option-btn.personality.dimmed {
    opacity: 0.5;
}

.personality-result {
    display: none;
    text-align: center;
    padding: var(--space-2xl);
    animation: fadeSlideUp 0.5s ease;
}

.personality-result.show {
    display: block;
}

.personality-result-image {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-xl);
    object-fit: cover;
    margin: 0 auto var(--space-lg);
    box-shadow: var(--shadow-lg);
}

.personality-result-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
}

.personality-result-desc {
    font-size: 1rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    line-height: 1.7;
}

/* === Resume Banner === */
.resume-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-light);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
}

.resume-text {
    font-size: 0.95rem;
    color: var(--color-primary-dark);
}

.resume-actions {
    display: flex;
    gap: var(--space-sm);
}

/* === End Quiz Button === */
.end-quiz-wrap {
    text-align: center;
    margin: var(--space-xl) 0;
    display: none;
}

.end-quiz-wrap.show {
    display: block;
    animation: fadeSlideUp 0.3s ease;
}

/* === Sidebar Quiz List === */
.sidebar-quiz-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sidebar-quiz-item {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.sidebar-quiz-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-quiz-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-quiz-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-quiz-title a {
    color: var(--color-text);
}

.sidebar-quiz-title a:hover {
    color: var(--color-primary);
}
