/* ============================================
   MCQ App Frontend Styles
   ============================================ */

/* Container */
.mcq-app-container {
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

/* Toolbar */
.mcq-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
}

.mcq-search-wrap {
    display: flex;
    flex: 1;
    min-width: 250px;
    gap: 6px;
}

.mcq-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

.mcq-search-input:focus {
    border-color: #4f46e5;
}

.mcq-search-btn {
    padding: 10px 20px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.mcq-search-btn:hover {
    background: #4338ca;
}

.mcq-filters {
    display: flex;
    gap: 8px;
}

.mcq-filters select {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
    min-width: 160px;
}

.mcq-filters select:focus {
    border-color: #4f46e5;
}

/* Stats Bar */
.mcq-stats {
    padding: 8px 0 16px;
    color: #666;
    font-size: 14px;
}

.mcq-count strong {
    color: #4f46e5;
}

/* MCQ Card */
.mcq-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.mcq-card:hover {
    border-color: #d0d5ff;
    box-shadow: 0 4px 12px rgba(79,70,229,0.08);
}

.mcq-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.mcq-question-number {
    color: #4f46e5;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.mcq-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mcq-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mcq-badge-difficulty { background: #fef3c7; color: #92400e; }
.mcq-badge-easy       { background: #d1fae5; color: #065f46; }
.mcq-badge-medium     { background: #fef3c7; color: #92400e; }
.mcq-badge-hard       { background: #fee2e2; color: #991b1b; }
.mcq-badge-source     { background: #e0e7ff; color: #3730a3; }

.mcq-question-text {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.6;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* Options */
.mcq-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
}

@media (max-width: 600px) {
    .mcq-options { grid-template-columns: 1fr; }
}

.mcq-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    line-height: 1.5;
    user-select: none;
}

.mcq-option:hover {
    border-color: #4f46e5;
    background: #f5f3ff;
}

.mcq-option.selected {
    border-color: #4f46e5;
    background: #eef2ff;
    font-weight: 500;
}

.mcq-option.correct {
    border-color: #10b981;
    background: #d1fae5;
    color: #065f46;
}

.mcq-option.wrong {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

.mcq-option-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    color: #4f46e5;
    flex-shrink: 0;
}

.mcq-option.correct .mcq-option-letter {
    background: #10b981;
    color: #fff;
}

.mcq-option.wrong .mcq-option-letter {
    background: #ef4444;
    color: #fff;
}

/* Action Buttons */
.mcq-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.mcq-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mcq-btn-show {
    background: #4f46e5;
    color: #fff;
}

.mcq-btn-show:hover { background: #4338ca; }

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

.mcq-btn-reset:hover { background: #e5e7eb; }

/* Explanation Box */
.mcq-explanation {
    margin-top: 12px;
    padding: 14px 18px;
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    border-radius: 6px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.mcq-explanation.visible { display: block; }

.mcq-explanation-label {
    font-weight: 700;
    color: #065f46;
    margin-bottom: 4px;
}

.mcq-explanation-text {
    color: #374151;
    font-size: 14px;
    line-height: 1.6;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Pagination */
.mcq-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.mcq-page-btn {
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #374151;
}

.mcq-page-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.mcq-page-btn.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.mcq-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Loading & Empty */
.mcq-loading {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 16px;
}

.mcq-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.mcq-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Error State */
.mcq-error {
    text-align: center;
    padding: 30px;
    background: #fef2f2;
    border-radius: 8px;
    color: #991b1b;
    margin: 20px 0;
}

/* Print Styles */
@media print {
    .mcq-toolbar, .mcq-pagination, .mcq-stats, .mcq-actions { display: none; }
    .mcq-card { break-inside: avoid; border: 1px solid #ccc; margin-bottom: 8px; }
    .mcq-explanation { display: block !important; }
}
