/* ========================================
   ANSWER REVIEW PAGE STYLES
   ======================================== */

/* Review Question Card */
.review-question-card {
    position: relative;
    transition: all 0.3s ease;
}

.review-question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-badge.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.status-badge.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.status-badge.skipped {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.status-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Review Options */
.review-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    transition: all 0.3s ease;
    position: relative;
}

.review-option .option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    flex-shrink: 0;
}

.review-option .option-text {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Correct Answer Styling */
.review-option.correct-answer {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
}

.review-option.correct-answer .option-label {
    background: var(--success);
    color: white;
}

/* Wrong Answer Styling */
.review-option.wrong-answer {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
}

.review-option.wrong-answer .option-label {
    background: var(--danger);
    color: white;
}

/* User Selected */
.review-option.user-selected {
    border-width: 3px;
}

/* Badges */
.correct-badge,
.wrong-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.correct-badge {
    background: var(--success);
    color: white;
}

.wrong-badge {
    background: var(--danger);
    color: white;
}

/* Filter Buttons */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Explanation Box */
.explanation-box {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .status-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .review-option {
        padding: 12px;
    }

    .review-option .option-label {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .answer-summary {
        grid-template-columns: 1fr !important;
    }
}

/* Print Styles */
@media print {
    .review-question-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .status-badge {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* ========================================
   AI EXPLANATION BUTTON & MODAL
   ======================================== */

.ai-explain-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.ai-explain-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.ai-explain-btn:active {
    transform: translateY(0);
}

.ai-explain-btn i {
    font-size: 1.1rem;
}

/* AI Explanation Modal */
.ai-explanation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.ai-explanation-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ai-explanation-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.ai-explanation-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-explanation-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-explanation-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ai-explanation-body {
    padding: 24px;
}

.ai-explanation-loading {
    text-align: center;
    padding: 40px;
}

.ai-explanation-loading i {
    font-size: 3rem;
    color: #6366f1;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ai-explanation-text {
    line-height: 1.8;
    color: #1f2937;
    font-size: 1rem;
}

.ai-explanation-text h4 {
    color: #6366f1;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.ai-explanation-text p {
    margin-bottom: 15px;
}

.ai-explanation-text ul,
.ai-explanation-text ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.ai-explanation-text li {
    margin-bottom: 8px;
}

.ai-explanation-text strong {
    color: #6366f1;
    font-weight: 600;
}

.ai-explanation-text code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #ef4444;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-explanation-content {
        max-height: 95vh;
        margin: 10px;
    }

    .ai-explanation-header {
        padding: 16px;
    }

    .ai-explanation-header h3 {
        font-size: 1.1rem;
    }

    .ai-explanation-body {
        padding: 16px;
    }

    .ai-explain-btn {
        width: 100%;
        justify-content: center;
    }
}