/* ===== Quiz Styles ===== */

/* Quiz Carousel */
.quiz-carousel {
    touch-action: pan-y;
    user-select: none;
    min-height: calc(100vh - 200px);
    position: relative;
}

.quiz-cards-wrapper {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Question Card */
.question-card {
    min-width: 100%;
    max-width: 100%;
    padding: 16px;
    flex-shrink: 0;
}

.question-card-inner {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    position: relative;
}

.question-card-inner.answered {
    border-color: #E8E7FF;
    background: #FAFAFF;
}

.question-card-inner.correct {
    border-color: #2E7D32;
    background: linear-gradient(135deg, #F0FFF9, #E8FFF6);
}

.question-card-inner.partial {
    border-color: #FFC107;
    background: linear-gradient(135deg, #FFFDF0, #FFF8E1);
}

.question-card-inner.wrong {
    border-color: #B5432A;
    background: linear-gradient(135deg, #FFF5F7, #FFEBEE);
}

/* Locked indicator */
.question-card-inner.answered::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%239CA3AF' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z' clip-rule='evenodd'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0.4;
}

/* Question number badge */
.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1B3A5C, #2A5580);
    color: white;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

/* Media container */
.question-media {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    max-height: 280px;
    position: relative;
    background: #f3f4f6;
}

.question-media img,
.question-media video {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    border-radius: 16px;
    transition: opacity 0.3s;
}

.question-media img:hover {
    opacity: 0.95;
}

.question-media video {
    object-fit: contain;
    background: black;
}

/* Question text */
.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.7;
    color: #1A1A2E;
    margin-bottom: 20px;
    flex: 1;
}

/* Difficulty badge */
.difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.difficulty-badge.d-1 { background: #E8FFF6; color: #B08C3E; }
.difficulty-badge.d-2 { background: #E8F5E9; color: #2E7D32; }
.difficulty-badge.d-3 { background: #FFF8E1; color: #F57F17; }
.difficulty-badge.d-4 { background: #FFF3E0; color: #E65100; }
.difficulty-badge.d-5 { background: #FFEBEE; color: #C62828; }

/* Reveal Answer Button */
.btn-reveal {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1B3A5C, #2A5580);
    color: white;
    border: none;
    border-radius: 16px;
    font-family: 'Heebo', sans-serif;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-reveal:hover::before {
    left: 100%;
}

.btn-reveal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

.btn-reveal:active {
    transform: scale(0.98) translateY(0);
}

/* Answer Section */
.answer-section {
    margin-top: 16px;
    animation: slideDown 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.answer-box {
    background: linear-gradient(135deg, #F8F7FF, #EEF0FF);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    border-right: 4px solid #1B3A5C;
    position: relative;
}

.answer-label {
    font-size: 12px;
    font-weight: 600;
    color: #1B3A5C;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.answer-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1A1A2E;
    line-height: 1.5;
}

.explanation-box {
    background: #FFFDF0;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
    border-right: 3px solid #FFC107;
}

.explanation-label {
    font-size: 11px;
    font-weight: 600;
    color: #F57F17;
    margin-bottom: 4px;
}

.explanation-text {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
}

/* Rating Buttons */
.rating-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.rating-btn {
    padding: 14px 8px;
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    background: white;
    font-family: 'Heebo', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.rating-btn .rating-emoji {
    font-size: 28px;
    transition: transform 0.3s;
}

.rating-btn .rating-points {
    font-size: 11px;
    color: #9CA3AF;
    transition: color 0.3s;
}

.rating-btn:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.rating-btn:hover:not(.disabled) .rating-emoji {
    transform: scale(1.15);
}

.rating-btn.correct { border-color: #2E7D32; background: #F0FFF9; color: #2E7D32; }
.rating-btn.partial { border-color: #C9A84C; background: #FFFDF0; color: #8D6E1E; }
.rating-btn.wrong { border-color: #B5432A; background: #FFF5F7; color: #B5432A; }

.rating-btn.correct:hover:not(.disabled), .rating-btn.correct.selected {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    color: white;
    border-color: #2E7D32;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
}

.rating-btn.partial:hover:not(.disabled), .rating-btn.partial.selected {
    background: linear-gradient(135deg, #FFC107, #FFB300);
    color: white;
    border-color: #FFC107;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.rating-btn.wrong:hover:not(.disabled), .rating-btn.wrong.selected {
    background: linear-gradient(135deg, #B5432A, #FF3366);
    color: white;
    border-color: #B5432A;
    box-shadow: 0 4px 15px rgba(255, 101, 132, 0.4);
}

.rating-btn.selected .rating-emoji {
    transform: scale(1.2);
}

.rating-btn.selected .rating-points {
    color: rgba(255,255,255,0.8);
}

.rating-btn.disabled:not(.selected) {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
    transform: scale(0.95);
}

/* Quiz dots */
.quiz-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E5E7EB;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.quiz-dot.active {
    width: 24px;
    border-radius: 4px;
    background: #1B3A5C;
    box-shadow: 0 2px 6px rgba(108, 99, 255, 0.4);
}

.quiz-dot.answered {
    background: #C9A84C;
}

.quiz-dot.answered.active {
    background: #B08C3E;
}

/* Swipe hint */
.swipe-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px;
    color: #9CA3AF;
    font-size: 24px;
    z-index: 5;
    pointer-events: none;
    animation: fadeHint 2s ease infinite;
}

@keyframes fadeHint {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Results Breakdown */
.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #F9FAFB;
    transition: all 0.2s;
}

.result-item:hover {
    background: #F3F4F6;
    transform: translateX(-2px);
}

.result-item .result-q-num {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.result-item .result-q-num.correct { background: linear-gradient(135deg, #C9A84C, #B08C3E); }
.result-item .result-q-num.partial { background: linear-gradient(135deg, #FFC107, #FFB300); }
.result-item .result-q-num.wrong { background: linear-gradient(135deg, #B5432A, #FF3366); }
.result-item .result-q-num.unanswered { background: #9CA3AF; }

.result-item .result-q-text {
    flex: 1;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}

.result-item .result-q-score {
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

/* Quiz summary bottom sheet */
.quiz-summary-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 45;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-height: 60vh;
    overflow-y: auto;
}

.quiz-summary-sheet.visible {
    transform: translateY(0);
}
