/**
 * Archive MCQ Styling - Unified Design
 * Matches the clean styling from single-mcq.php
 */

/* ============================================
   ARCHIVE CONTAINER & LAYOUT
   ============================================ */

.mcq-archive-container {
    background: #f8f9fa;
    min-height: 100vh;
}

/* ============================================
   ARCHIVE HEADER - IMPROVED STYLING
   ============================================ */

.mcq-archive-header {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-bottom: 2px solid #dee2e6;
    padding: 3rem 0 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.archive-description {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.archive-description p {
    margin-bottom: 1rem;
}

.archive-description p:last-child {
    margin-bottom: 0;
}

.archive-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.meta-item i {
    color: #007bff;
    font-size: 1.1rem;
}

/* ============================================
   FILTERS SECTION - MODERN DESIGN
   ============================================ */

.mcq-archive-content {
    padding: 0 0 3rem;
}

.archive-filters {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.form-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    color: #374151;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 3rem;
}

.form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-select:hover {
    border-color: #d1d5db;
}

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

.filter-button,
.filter-reset {
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
}

.filter-button {
    background: #007bff;
    color: white;
}

.filter-button:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.25);
}

.filter-reset {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.filter-reset:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

/* ============================================
   MCQ LIST CONTAINER
   ============================================ */

.mcq-list-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.mcq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ============================================
   MCQ LIST ITEMS - MATCHING SINGLE-MCQ DESIGN
   ============================================ */

/* Remove all old styling borders and ugly elements */
.mcq-archive-container .mcq-list-item,
.mcq-list-container .mcq-list-item {
    border: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    background: white !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mcq-archive-container .mcq-list-item:hover,
.mcq-list-container .mcq-list-item:hover {
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.12) !important;
    transform: translateY(-3px) !important;
    border: none !important;
}

/* Clean header styling */
.mcq-archive-container .mcq-header,
.mcq-list-container .mcq-header {
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 1rem !important;
    margin-bottom: 1rem !important;
}

/* Clean meta badges */
.mcq-archive-container .mcq-meta span,
.mcq-list-container .mcq-meta span {
    border: none !important;
    box-shadow: none !important;
}

/* Clean content area */
.mcq-archive-container .mcq-content,
.mcq-list-container .mcq-content {
    padding: 0 !important;
}

/* Clean question styling */
.mcq-archive-container .mcq-question h3,
.mcq-list-container .mcq-question h3 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    line-height: 1.4 !important;
    margin-bottom: 1rem !important;
}

/* Clean description styling */
.mcq-archive-container .mcq-description,
.mcq-list-container .mcq-description {
    color: #475569 !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1.5rem !important;
}

/* Clean options container */
.mcq-archive-container .mcq-options,
.mcq-list-container .mcq-options {
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
}

/* Individual option styling */
.mcq-archive-container .mcq-option,
.mcq-list-container .mcq-option {
    margin-bottom: 0 !important;
}

/* Clean actions area */
.mcq-archive-container .mcq-actions,
.mcq-list-container .mcq-actions {
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 1rem !important;
    margin-top: 1.5rem !important;
}

/* Override existing MCQ list item styles with clean design */
.mcq-archive-container .mcq-list-item,
.mcq-list-container .mcq-list-item {
    background: #fff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    margin-bottom: 1.5rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.mcq-archive-container .mcq-list-item:hover,
.mcq-list-container .mcq-list-item:hover {
    border-color: #007bff !important;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.15) !important;
    transform: translateY(-2px) !important;
}

.mcq-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.mcq-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
}

.mcq-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mcq-difficulty {
    color: white;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.mcq-difficulty.difficulty-easy {
    background: #28a745;
}

.mcq-difficulty.difficulty-medium {
    background: #ffc107;
    color: #212529 !important;
}

.mcq-difficulty.difficulty-hard {
    background: #dc3545;
}

.mcq-subject {
    background: #007bff;
    color: white;
}

.mcq-subject:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.mcq-topic {
    background: #17a2b8;
    color: white;
}

.mcq-topic:hover {
    background: #138496;
    transform: translateY(-1px);
}

.premium-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* ============================================
   MCQ CONTENT - IMPROVED LAYOUT
   ============================================ */

.mcq-content {
    margin-bottom: 1.5rem;
}

.mcq-question h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.mcq-description {
    color: #4a5568;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
}

/* ============================================
   MCQ OPTIONS - MATCHING SINGLE-MCQ DESIGN
   ============================================ */

.mcq-options-container {
    margin-bottom: 1.5rem;
}

.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mcq-option {
    position: relative;
}

.mcq-radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.mcq-archive-container .mcq-option-label,
.mcq-list-container .mcq-option-label {
    display: flex !important;
    align-items: center !important;
    padding: 1rem 1.25rem !important;
    border: 1px solid #e9ecef !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: #fff !important;
    min-height: 60px !important;
}

.mcq-archive-container .mcq-option-label:hover,
.mcq-list-container .mcq-option-label:hover {
    border-color: #007bff !important;
    background: #f8f9fa !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15) !important;
}

.mcq-archive-container .mcq-radio:checked + .mcq-option-label,
.mcq-list-container .mcq-radio:checked + .mcq-option-label {
    border-color: #007bff !important;
    background: #e3f2fd !important;
}

.mcq-archive-container .option-letter,
.mcq-list-container .option-letter {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    background: #f1f5f9 !important;
    border-radius: 50% !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    margin-right: 0.75rem !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    color: #64748b !important;
    border: none !important;
}

.mcq-archive-container .mcq-radio:checked + .mcq-option-label .option-letter,
.mcq-list-container .mcq-radio:checked + .mcq-option-label .option-letter {
    background: #3b82f6 !important;
    color: white !important;
    border: none !important;
}

.mcq-archive-container .option-text,
.mcq-list-container .option-text {
    flex: 1 !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    color: #334155 !important;
    transition: all 0.2s ease !important;
    padding-right: 1rem !important;
}

.mcq-archive-container .mcq-radio:checked + .mcq-option-label .option-text,
.mcq-list-container .mcq-radio:checked + .mcq-option-label .option-text {
    color: #3b82f6 !important;
    font-weight: 600 !important;
}

.option-feedback {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ============================================
   FEEDBACK STATES - MATCHING SINGLE-MCQ
   ============================================ */

.mcq-option.correct .mcq-option-label {
    border-color: #28a745 !important;
    background: #d4edda !important;
}

.mcq-option.correct .option-letter {
    background: #28a745 !important;
    color: white !important;
}

.mcq-option.correct .option-text {
    color: #155724 !important;
    font-weight: 600 !important;
}

.mcq-option.correct .option-feedback {
    color: #28a745 !important;
}

.mcq-option.incorrect .mcq-option-label {
    border-color: #dc3545 !important;
    background: #f8d7da !important;
}

.mcq-option.incorrect .option-letter {
    background: #dc3545 !important;
    color: white !important;
}

.mcq-option.incorrect .option-text {
    color: #721c24 !important;
    font-weight: 600 !important;
}

.mcq-option.incorrect .option-feedback {
    color: #dc3545 !important;
}

.mcq-option.neutral {
    opacity: 0.6;
}

.mcq-option.neutral .mcq-option-label {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
}

.mcq-option.neutral .option-text {
    color: #6c757d !important;
}

.mcq-option.neutral .option-letter {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
}

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

/* ============================================
   RESULT DISPLAY
   ============================================ */

.mcq-result {
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #dee2e6;
}

.mcq-result.correct {
    background: #d4edda;
    border-left-color: #28a745;
}

.mcq-result.incorrect {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.result-message {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-icon {
    font-size: 1.5rem;
}

.result-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.4;
}

.mcq-result.correct .result-text {
    color: #155724;
}

.mcq-result.incorrect .result-text {
    color: #721c24;
}

/* ============================================
   EXPLANATION SECTION
   ============================================ */

.mcq-explanation-container {
    margin-top: 1rem;
}

.btn-toggle-explanation {
    background: transparent;
    border: 2px solid #6c757d;
    color: #6c757d;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    font-weight: 500;
}

.btn-toggle-explanation:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.mcq-explanation {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.mcq-explanation h4 {
    color: #495057;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.explanation-content {
    color: #333;
    line-height: 1.6;
}

.explanation-content p {
    margin-bottom: 1rem;
}

.explanation-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   PREMIUM CONTENT BLOCK
   ============================================ */

.mcq-premium-block {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    border-radius: 12px;
    border: 2px dashed #f093fb;
}

.premium-message {
    max-width: 400px;
    margin: 0 auto;
}

.premium-message i {
    font-size: 3rem;
    color: #f093fb;
    margin-bottom: 1rem;
    display: block;
}

.premium-message h4 {
    color: #721c24;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.premium-message p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-premium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
    color: white;
    text-decoration: none;
}

/* ============================================
   MCQ ACTIONS
   ============================================ */

.mcq-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #f1f3f4;
}

.btn-view-single,
.btn-bookmark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #6c757d;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-view-single:hover,
.btn-bookmark:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #007bff;
    transform: translateY(-1px);
    text-decoration: none;
}

/* ============================================
   NO RESULTS STATE
   ============================================ */

.no-mcqs-found {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    margin: 2rem 0;
}

.no-results-icon {
    font-size: 4rem;
    color: #adb5bd;
    margin-bottom: 1.5rem;
}

.no-mcqs-found h3 {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-mcqs-found p {
    color: #868e96;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ============================================
   PAGINATION - IMPROVED STYLING
   ============================================ */

.archive-pagination {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-numbers li {
    margin: 0;
}

.page-numbers a,
.page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0.75rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    color: #495057;
    background: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.page-numbers a:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    text-decoration: none;
    transform: translateY(-1px);
}

.page-numbers .current {
    background: #007bff;
    border-color: #007bff;
    color: white;
    font-weight: 700;
}

.page-numbers .dots {
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: default;
}

.page-numbers .prev,
.page-numbers .next {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
}

.nav-text {
    font-size: 0.95rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .archive-title {
        font-size: 2rem;
    }
    
    .archive-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .meta-item {
        padding: 0.6rem 1.2rem;
    }
    
    .archive-filters {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-button,
    .filter-reset {
        width: 100%;
        justify-content: center;
    }
    
    .mcq-list-container {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .mcq-list {
        gap: 1.25rem;
    }
    
    .mcq-list-item {
        padding: 1.25rem;
    }
    
    .mcq-option-label {
        padding: 0.8rem 1rem;
    }
    
    .option-letter {
        width: 32px;
        height: 32px;
        margin-right: 0.75rem;
    }
    
    .option-text {
        font-size: 0.95rem;
    }
    
    .mcq-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-view-single,
    .btn-bookmark {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
    
    .page-numbers {
        gap: 0.25rem;
    }
    
    .page-numbers a,
    .page-numbers span {
        min-width: 44px;
        height: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .nav-text {
        display: none;
    }
    
    .page-numbers .prev,
    .page-numbers .next {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .mcq-archive-header {
        padding: 2rem 0 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .archive-title {
        font-size: 1.8rem;
    }
    
    .archive-filters {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .mcq-list-container {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .mcq-list {
        gap: 1rem;
    }
    
    .mcq-list-item {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .mcq-question h3 {
        font-size: 1.1rem;
    }
    
    .mcq-option-label {
        padding: 0.7rem 0.8rem;
        min-height: 56px;
    }
    
    .option-letter {
        width: 28px;
        height: 28px;
        margin-right: 0.6rem;
        font-size: 0.9rem;
    }
    
    .option-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .page-numbers a,
    .page-numbers span {
        min-width: 40px;
        height: 40px;
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .premium-message i {
        font-size: 2.5rem;
    }
    
    .no-results-icon {
        font-size: 3rem;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

.mcq-option:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.btn-view-single:focus,
.btn-bookmark:focus,
.filter-button:focus,
.filter-reset:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mcq-option-label {
        border-width: 3px;
    }
    
    .mcq-option.correct .mcq-option-label {
        border-width: 3px;
    }
    
    .mcq-option.incorrect .mcq-option-label {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Print styles */
@media print {
    .archive-filters,
    .mcq-actions,
    .archive-pagination,
    .btn-toggle-explanation {
        display: none !important;
    }
    
    .mcq-list-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .mcq-option-label {
        break-inside: avoid;
    }
}