/**
 * Past Papers & MCQs Frontend Styles
 * Fully conflict-free and isolated under .codosmno-* and .etpp-* classes
 */

/* ==========================================================================
   1. Interactive MCQ Cards (Feed & Single View)
   ========================================================================== */
.codosmno-mcq-feed-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 20px 0;
    box-sizing: border-box;
}

.codosmno-mcq-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.codosmno-mcq-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Meta Bar: Q. Number, Category, Source */
.codosmno-mcq-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.codosmno-q-number {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0369a1;
    background: #e0f2fe;
    padding: 3px 10px;
    border-radius: 6px;
}

.codosmno-pill-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 9999px;
    line-height: 1.4;
}

.codosmno-pill-cat {
    background: #f1f5f9;
    color: #475569;
}

.codosmno-pill-source {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Question Title */
.codosmno-mcq-question-title {
    margin: 0 0 16px;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
    color: #0f172a;
}

.codosmno-mcq-question-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.codosmno-mcq-question-title a:hover {
    color: #0284c7;
}

/* Options Grid */
.codosmno-mcq-options-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .codosmno-mcq-options-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Option Button */
.codosmno-mcq-opt-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

.codosmno-mcq-opt-btn:hover:not(.is-correct):not(.is-wrong) {
    background: #f0f9ff;
    border-color: #38bdf8;
    color: #0284c7;
    transform: translateY(-1px);
}

.codosmno-opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.15s;
}

.codosmno-opt-text {
    flex: 1;
    line-height: 1.35;
}

/* Correct Answer Animation & Colors */
.codosmno-mcq-opt-btn.is-correct {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
    box-shadow: 0 0 0 1px #10b981;
}

.codosmno-mcq-opt-btn.is-correct .codosmno-opt-letter {
    background: #10b981;
    color: #ffffff;
}

.codosmno-mcq-opt-btn.is-correct .codosmno-opt-icon::after {
    content: "✔";
    color: #10b981;
    font-weight: bold;
    font-size: 16px;
    margin-left: 6px;
}

/* Wrong Answer Animation & Colors */
.codosmno-mcq-opt-btn.is-wrong {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
    box-shadow: 0 0 0 1px #ef4444;
}

.codosmno-mcq-opt-btn.is-wrong .codosmno-opt-letter {
    background: #ef4444;
    color: #ffffff;
}

.codosmno-mcq-opt-btn.is-wrong .codosmno-opt-icon::after {
    content: "✖";
    color: #ef4444;
    font-weight: bold;
    font-size: 16px;
    margin-left: 6px;
}

/* Footer & Feedback */
.codosmno-mcq-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.codosmno-fb-correct {
    font-weight: 600;
    color: #10b981;
    font-size: 0.9rem;
}

.codosmno-fb-wrong {
    font-weight: 600;
    color: #ef4444;
    font-size: 0.9rem;
}

.codosmno-btn-toggle-expl {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.codosmno-btn-toggle-expl:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Explanation Box */
.codosmno-mcq-explanation-box {
    margin-top: 14px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #0284c7;
    border-radius: 6px;
    padding: 14px 18px;
}

.codosmno-expl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #0f172a;
}

.codosmno-correct-badge {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
}

.codosmno-expl-content {
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.6;
}

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

/* ==========================================================================
   2. Grouped Past Papers Grid List View ([past_papers])
   ========================================================================== */
.codosmno-container,
.etpp-container {
    width: 100%;
    margin: 20px 0;
    box-sizing: border-box;
    font-family: inherit;
}

.codosmno-container *,
.codosmno-container *::before,
.codosmno-container *::after,
.etpp-container *,
.etpp-container *::before,
.etpp-container *::after {
    box-sizing: border-box;
}

.codosmno-category-section,
.etpp-category-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 26px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.codosmno-category-section:hover,
.etpp-category-section:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.codosmno-category-header,
.etpp-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 2px solid #0284c7;
}

.codosmno-header-left,
.etpp-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.codosmno-cat-icon,
.etpp-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0284c7;
}

.codosmno-category-title,
.etpp-category-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.codosmno-count-badge,
.etpp-count-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    letter-spacing: 0.3px;
}

.codosmno-papers-grid,
.etpp-papers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: #f1f5f9;
}

.etpp-cols-2 .codosmno-papers-grid,
.etpp-cols-2 .etpp-papers-grid {
    grid-template-columns: repeat(2, 1fr);
}

.etpp-cols-3 .codosmno-papers-grid,
.etpp-cols-3 .etpp-papers-grid {
    grid-template-columns: repeat(3, 1fr);
}

.codosmno-paper-item,
.etpp-paper-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 12px 18px;
    text-decoration: none !important;
    color: #1e293b !important;
    transition: all 0.2s ease;
    gap: 12px;
}

.codosmno-paper-item:hover,
.etpp-paper-item:hover {
    background: #f0f9ff;
    color: #0284c7 !important;
    padding-left: 22px;
}

.codosmno-paper-content,
.etpp-paper-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.codosmno-paper-bullet,
.etpp-paper-bullet {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.codosmno-paper-item:hover .codosmno-paper-bullet,
.etpp-paper-item:hover .etpp-paper-bullet {
    color: #0284c7;
    transform: translateX(3px);
}

.codosmno-paper-title,
.etpp-paper-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

.codosmno-tag-source {
    font-size: 0.72rem;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    border: 1px solid #fde68a;
    font-weight: 600;
}

.codosmno-paper-date,
.etpp-paper-date {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
    background: #f8fafc;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.codosmno-empty-notice,
.etpp-empty-notice {
    padding: 24px;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.95rem;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .etpp-cols-2 .codosmno-papers-grid,
    .etpp-cols-2 .etpp-papers-grid,
    .etpp-cols-3 .codosmno-papers-grid,
    .etpp-cols-3 .etpp-papers-grid {
        grid-template-columns: 1fr;
    }
    .codosmno-category-header,
    .etpp-category-header {
        padding: 12px 16px;
    }
    .codosmno-paper-item,
    .etpp-paper-item {
        padding: 10px 14px;
    }
    .codosmno-paper-item:hover,
    .etpp-paper-item:hover {
        padding-left: 18px;
    }
    .codosmno-category-title,
    .etpp-category-title {
        font-size: 1.05rem;
    }
}


/* ==========================================================================
   3. TestPoint-Style 3-Tier Past Papers Portal & Directory
   ========================================================================== */
.codosmno-tp-portal-wrap {
    width: 100%;
    margin: 20px 0;
    font-family: inherit;
    box-sizing: border-box;
}

/* Breadcrumb Navigation Bar */
.codosmno-tp-breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 8px 14px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 13px;
}

.codosmno-tp-back-btn {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #0284c7 !important;
    text-decoration: none !important;
    transition: color 0.15s;
}

.codosmno-tp-back-btn:hover {
    color: #0369a1 !important;
    text-decoration: underline !important;
}

.codosmno-tp-current-crumb {
    color: #64748b;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Tier 1: Main Past Papers Directory (Image 1 Style)
   -------------------------------------------------------------------------- */
.codosmno-tier1-wrap .codosmno-tp-banner-header {
    background: #14532d; /* Dark Forest Green Banner */
    color: #ffffff;
    text-align: center;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    border-radius: 8px 8px 0 0;
}

.codosmno-tier1-wrap .codosmno-tp-body-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 24px 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.codosmno-tp-main-title {
    text-align: center;
    margin: 0 0 12px;
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
}

.codosmno-tp-title-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 12px 0 20px;
}

.codosmno-tp-bullet-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.codosmno-tp-bullet-item {
    position: relative;
    padding-left: 20px;
    margin: 0 !important;
    font-size: 1.05rem;
    line-height: 1.45;
}

.codosmno-tp-bullet-item::before {
    content: "•";
    position: absolute;
    left: 0;
    top: -1px;
    color: #0f172a;
    font-size: 1.4rem;
    line-height: 1;
}

.codosmno-tp-bullet-link {
    color: #0f5132 !important; /* Dark Green like TestPoint */
    text-decoration: none !important;
    font-weight: 600;
    transition: color 0.15s ease;
}

.codosmno-tp-bullet-link:hover {
    color: #0284c7 !important;
    text-decoration: underline !important;
}

/* --------------------------------------------------------------------------
   Tier 2: Numbered Table of Categories (Image 2 Style)
   -------------------------------------------------------------------------- */
.codosmno-tp-red-toggle-bar {
    background: #dc2626; /* Bright Red Banner */
    color: #ffffff;
    text-align: center;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    user-select: none;
    transition: background 0.15s;
}

.codosmno-tp-red-toggle-bar:hover {
    background: #b91c1c;
}

.codosmno-tp-table-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow-x: auto;
}

.codosmno-tp-numbered-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.codosmno-tp-numbered-table tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.15s;
}

.codosmno-tp-numbered-table tr:last-child {
    border-bottom: none;
}

.codosmno-tp-numbered-table tr:hover {
    background: #f8fafc;
}

.codosmno-tp-td-index {
    width: 50px;
    text-align: center;
    font-weight: 600;
    color: #64748b;
    padding: 14px 12px;
    font-size: 1rem;
    border-right: 1px solid #f1f5f9;
}

.codosmno-tp-td-title {
    padding: 14px 18px;
    font-size: 1.05rem;
}

.codosmno-tp-paper-link {
    color: #006655 !important; /* Deep Teal / Green */
    font-weight: 700;
    text-decoration: none !important;
    transition: color 0.15s;
}

.codosmno-tp-paper-link:hover {
    color: #0284c7 !important;
    text-decoration: underline !important;
}

/* --------------------------------------------------------------------------
   Tier 3: MCQs View (Image 3 Style)
   -------------------------------------------------------------------------- */
.codosmno-tp-paper-header h2 {
    margin: 0 0 10px;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
}

.codosmno-tp-q-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.codosmno-tp-q-en {
    color: #14532d; /* Dark Green Title */
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    flex: 1;
}

.codosmno-tp-q-ur {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', Arial, sans-serif;
    font-size: 1.15rem;
    color: #0f172a;
    line-height: 1.8;
    text-align: right;
    max-width: 48%;
    flex-shrink: 0;
}

.codosmno-tp-reveal-link {
    background: transparent !important;
    border: none !important;
    color: #166534 !important; /* Green */
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    padding: 0 !important;
    text-decoration: underline !important;
    transition: color 0.15s;
}

.codosmno-tp-reveal-link:hover {
    color: #0284c7 !important;
}

@media (max-width: 640px) {
    .codosmno-tp-q-header {
        flex-direction: column;
        gap: 8px;
    }
    .codosmno-tp-q-ur {
        max-width: 100%;
        text-align: right;
        width: 100%;
    }
}
