.nm-topic-wrap {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.nm-topic-stats-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    margin: 0 0 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
}

.nm-topic-stats-header h1 {
    margin: 0 0 10px;
    font-size: 1.5em;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.nm-topic-description {
    font-size: 0.95em;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 15px;
    line-height: 1.5;
}

.nm-stats-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.nm-stat-box {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    min-width: 90px;
}

.nm-stat-number {
    font-size: 1.6em;
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
}

.nm-stat-label {
    font-size: 0.8em;
    opacity: 0.9;
}

.nm-topic-stats-header p {
    margin: 12px 0 0;
    font-size: 0.85em;
    opacity: 0.9;
}

.nm-topic-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.nm-filter-select {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 180px;
    flex: 1;
    line-height: 1.5;
    height: auto;
}

.nm-filter-select option {
    padding: 8px;
    line-height: 1.6;
}

.nm-filter-select:hover,
.nm-filter-select:focus {
    border-color: #667eea;
    background: #f8f9ff;
    outline: none;
}

.nm-quiz-section {
    margin-bottom: 30px;
}

.nm-quiz-intro {
    background: #f8f9fa;
    padding: 20px;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    margin-bottom: 25px;
}

.nm-quiz-intro h3 {
    margin: 0 0 8px;
    color: #2c3e50;
    font-size: 1.2em;
}

.nm-quiz-intro p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.6;
}

.nm-mcq-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 2px solid #f0f0f0;
    transition: all 0.3s;
}

.nm-mcq-card:hover {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.12);
}

.nm-mcq-card.answered-correct {
    border-color: #4caf50;
    background: linear-gradient(135deg, #f1f8f4 0%, #ffffff 100%);
}

.nm-mcq-card.answered-wrong {
    border-color: #f44336;
    background: linear-gradient(135deg, #fef5f5 0%, #ffffff 100%);
}

.nm-mcq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 8px;
}

.nm-meta-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
    display: inline-block;
}

.nm-meta-badge.number {
    background: #667eea;
    color: white;
}

.nm-meta-badge.topic {
    background: #e3f2fd;
    color: #1976d2;
}

/* ✅ MODIFIED v7.3.9: E-A-T Meta Compact Display with improved spacing and visual distinction */
.nm-eat-meta-compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 20px 0;
    /* Increased bottom margin for distinction */
    padding: 10px 12px;
    /* Added padding */
    background: #f8f9fa;
    /* Light background for distinction */
    border-left: 3px solid #667eea;
    /* Accent border */
    border-radius: 4px;
    font-size: 0.85em;
    color: #666;
}

.nm-eat-author {
    font-weight: 600;
    color: #2c3e50;
}

.nm-eat-separator {
    color: #ccc;
}

.nm-eat-difficulty {
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
}

.nm-eat-difficulty-easy {
    background: #e8f5e9;
    color: #2e7d32;
}

.nm-eat-difficulty-medium {
    background: #fff3e0;
    color: #e65100;
}

.nm-eat-difficulty-hard {
    background: #ffebee;
    color: #c62828;
}

.nm-eat-verified {
    color: #2e7d32;
    font-weight: 600;
}

.nm-mcq-question {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.6;
}

.nm-mcq-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.nm-option-btn {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nm-option-btn:hover:not(.disabled) {
    border-color: #667eea;
    background: #e8eaf6;
    color: #1a237e;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.nm-option-btn.correct {
    border-color: #4caf50;
    background: #4caf50;
    color: white;
}

.nm-option-btn.wrong {
    border-color: #f44336;
    background: #f44336;
    color: white;
}

.nm-option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.nm-option-label {
    font-weight: 700;
    font-size: 1.05em;
    min-width: 30px;
    flex-shrink: 0;
}

.nm-result-message {
    padding: 14px 18px;
    border-radius: 8px;
    margin-top: 12px;
    font-weight: 600;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nm-result-message.correct {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    color: #2e7d32;
}

.nm-result-message.wrong {
    background: #ffebee;
    border: 2px solid #f44336;
    color: #c62828;
}

.nm-result-message.visible {
    display: block;
}

.nm-explanation {
    margin-top: 12px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    font-size: 0.95em;
    line-height: 1.6;
}

.nm-view-link {
    display: inline-block;
    margin-top: 10px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
}

.nm-view-link:hover {
    text-decoration: underline;
}

/* FIXED: Score Tracker Position */
.nm-score-tracker {
    position: fixed;
    bottom: 80px;
    /* Above back-to-top button */
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 998;
    /* Below back-to-top (usually 999) */
    min-width: 140px;
    display: none;
    border: 2px solid #667eea;
}

.nm-score-tracker.visible {
    display: block;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nm-score-title {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 6px;
}

.nm-score-number {
    font-size: 1.8em;
    font-weight: 700;
    color: #667eea;
}

.nm-score-label {
    font-size: 0.8em;
    color: #999;
}

/* Load More Button */
.nm-load-more-wrap {
    text-align: center;
    margin: 30px 0;
}

.nm-load-more-btn {
    padding: 14px 35px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nm-load-more-btn:hover:not(:disabled) {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.nm-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

/* Content sections (keeping existing styles) */
.nm-content-section {
    background: white;
    padding: 30px 25px;
    border-radius: 10px;
    margin: 30px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nm-content-section h2 {
    margin: 0 0 15px;
    color: #2c3e50;
    font-size: 1.5em;
}

.nm-content-section ul {
    line-height: 1.8;
}

.nm-content-section li {
    margin-bottom: 8px;
}

.nm-related-topics {
    margin: 30px 0;
    padding: 30px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nm-related-topics h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 1.5em;
}

.nm-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.nm-topic-card {
    display: block;
    padding: 20px 18px;
    background: white;
    border-radius: 10px;
    text-decoration: none;
    border: 2px solid #e0e0e0;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nm-topic-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.2);
}

.nm-topic-card-title {
    font-size: 1em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.nm-topic-card-count {
    font-size: 0.9em;
    color: #667eea;
    font-weight: 600;
}

/* Mobile Responsive */
@media (min-width: 768px) {
    .nm-topic-stats-header {
        padding: 35px 25px;
    }

    .nm-topic-stats-header h1 {
        font-size: 1.9em;
    }

    .nm-topic-description {
        font-size: 1.05em;
    }

    .nm-stat-number {
        font-size: 2em;
    }

    .nm-mcq-card {
        padding: 28px;
    }

    .nm-mcq-question {
        font-size: 1.15em;
    }

    .nm-option-btn {
        font-size: 1em;
        padding: 15px 20px;
    }
}

@media (max-width: 767px) {
    .nm-topic-wrap {
        padding: 0 15px;
    }

    .nm-topic-stats-header {
        padding: 20px 18px;
        margin: 0 0 20px;
    }

    .nm-topic-stats-header h1 {
        font-size: 1.3em;
    }

    .nm-topic-description {
        font-size: 0.9em;
    }

    .nm-stats-grid {
        gap: 12px;
    }

    .nm-stat-box {
        padding: 10px 16px;
        min-width: 80px;
    }

    .nm-stat-number {
        font-size: 1.4em;
    }

    .nm-stat-label {
        font-size: 0.75em;
    }

    .nm-mcq-card {
        padding: 18px;
        margin-bottom: 18px;
    }

    .nm-mcq-question {
        font-size: 1.05em;
    }

    .nm-option-btn {
        padding: 12px 14px;
        font-size: 0.9em;
        gap: 10px;
    }

    .nm-option-label {
        min-width: 25px;
    }

    /* Score tracker position on mobile */
    .nm-score-tracker {
        bottom: 70px;
        right: 15px;
        padding: 12px 16px;
        min-width: 120px;
        font-size: 0.9em;
    }

    .nm-score-title {
        font-size: 0.75em;
        margin-bottom: 4px;
    }

    .nm-score-number {
        font-size: 1.5em;
    }

    .nm-score-label {
        font-size: 0.7em;
    }

    .nm-content-section {
        padding: 20px 18px;
    }

    .nm-content-section h2 {
        font-size: 1.3em;
    }

    .nm-related-topics {
        padding: 20px 18px;
    }

    .nm-topics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Custom Breadcrumb Styling */
.nm-custom-breadcrumb {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 20px;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 1200px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.nm-custom-breadcrumb a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nm-custom-breadcrumb a:hover {
    color: #764ba2;
}

.nm-custom-breadcrumb .separator {
    color: #999;
    font-weight: 300;
    margin: 0 5px;
}

.nm-custom-breadcrumb .current {
    color: #2c3e50;
    font-weight: 600;
}

@media (max-width: 767px) {
    .nm-custom-breadcrumb {
        padding: 10px 15px;
        font-size: 0.85em;
    }
}

/* Improved Contrast for Accessibility */
.nm-custom-breadcrumb a {
    color: #5056d6;
    /* Darker blue for better contrast */
}

.nm-custom-breadcrumb a:hover {
    color: #3d42a8;
    /* Even darker on hover */
}

.nm-topic-tab {
    color: #2c3e50;
    /* Dark text */
}

.nm-answer-btn,
.nm-load-more-btn {
    background: #5056d6;
    /* WCAG AAA compliant */
}

.nm-answer-btn:hover,
.nm-load-more-btn:hover {
    background: #3d42a8;
}

/* Ensure links are visually distinct */
a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    text-decoration-thickness: 2px;
}

/*
==================================================================
  ✅ START: Styles moved from inline PHP
==================================================================
*/

/* Premium Topic Navigation Styles */
.nm-topic-nav-premium {
    margin-bottom: 30px;
}

/* Breadcrumb Style */
.nm-topic-breadcrumb {
    margin-bottom: 24px;
}

.nm-parent-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.nm-parent-link:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    color: white;
}

.nm-parent-link svg {
    transition: transform 0.3s ease;
}

.nm-parent-link:hover svg {
    transform: translateX(-3px);
}

/* Section Titles */
.nm-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 700;
}

/* Related Topics Pills */
.nm-related-topics-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.nm-topics-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nm-topic-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.nm-topic-pill:hover {
    border-color: #667eea;
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.nm-pill-count {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 700;
    color: #667eea;
}

.nm-topic-pill:hover .nm-pill-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Subtopics Cards Grid */
.nm-subtopics-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.nm-subtopics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.nm-subtopic-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nm-subtopic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nm-subtopic-card:hover::before {
    transform: scaleY(1);
}

.nm-subtopic-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.nm-card-icon {
    font-size: 2em;
    min-width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nm-subtopic-card:hover .nm-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.nm-card-content {
    flex: 1;
}

.nm-card-title {
    margin: 0 0 4px 0;
    color: #2c3e50;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.3;
}

.nm-card-meta {
    margin: 0;
    color: #667eea;
    font-size: 0.85em;
    font-weight: 600;
}

.nm-card-arrow {
    font-size: 1.2em;
    color: #667eea;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.nm-subtopic-card:hover .nm-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .nm-subtopics-grid {
        grid-template-columns: 1fr;
    }

    .nm-parent-link {
        font-size: 0.9em;
        padding: 10px 16px;
    }

    .nm-topic-pill {
        font-size: 0.85em;
        padding: 8px 14px;
    }

    .nm-subtopic-card {
        padding: 14px;
    }

    .nm-card-icon {
        font-size: 1.5em;
        min-width: 40px;
        height: 40px;
    }
}

/* ==================================================================
  ✅ END: Styles moved from inline PHP
==================================================================
*/


/*
==================================================================
  ✅ START: Styles for new filters
==================================================================
*/

.nm-filter-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 15px 0;
    gap: 10px;
}

.nm-filter-controls label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

#nm-month-filter {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
}

.nm-mcq-list .nm-spinner {
    /* Spinner for loading */
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: nm-spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes nm-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/*
==================================================================
  ✅ END: Styles for new filters
==================================================================
*/
/* ✅ MODIFIED v7.3.9: Dark Mode Support for E-A-T Meta */
html.dark-mode .nm-eat-meta-compact {
    color: #aaa;
    background: #1a1a1a;
    /* Dark background */
    border-left-color: #667eea;
}

html.dark-mode .nm-eat-author {
    color: #e0e0e0;
}

html.dark-mode .nm-eat-separator {
    color: #555;
}

html.dark-mode .nm-eat-difficulty-easy {
    background: #1b4332;
    color: #b7e4c7;
}

html.dark-mode .nm-eat-difficulty-medium {
    background: #5a3e21;
    color: #ffd6a5;
}

html.dark-mode .nm-eat-difficulty-hard {
    background: #5c1010;
    color: #ffb3b3;
}

html.dark-mode .nm-eat-verified {
    color: #a5d6a7;
}

/* ============================================================================
   ✅ NEW v7.3.10: Elegant E-A-T Box for Homepage (Matches Topic Pages)
   ============================================================================ */
.nm-eat-box-compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0 25px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    border-radius: 6px;
    font-size: 0.9em;
}

.nm-eat-item-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nm-eat-icon {
    font-size: 1.1em;
}

.nm-eat-separator {
    color: #ccc;
    font-weight: bold;
    margin: 0 4px;
}

.nm-eat-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
}

.nm-eat-badge.difficulty-easy {
    background: #d1f4e0;
    color: #0d7044;
}

.nm-eat-badge.difficulty-medium {
    background: #fff4e6;
    color: #e67700;
}

.nm-eat-badge.difficulty-hard {
    background: #ffe0e0;
    color: #c92a2a;
}

/* Dark mode for homepage E-A-T box */
html.dark-mode .nm-eat-box-compact {
    background: #1a1a1a;
    border-left-color: #667eea;
    color: #e0e0e0;
}

html.dark-mode .nm-eat-item-inline {
    color: #e0e0e0;
}

html.dark-mode .nm-eat-label {
    color: #aaa;
}

html.dark-mode .nm-eat-value {
    color: #fff;
}

html.dark-mode .nm-eat-separator {
    color: #666;
}

html.dark-mode .nm-eat-badge.difficulty-easy {
    background: #1b4332;
    color: #b7e4c7;
}

html.dark-mode .nm-eat-badge.difficulty-medium {
    background: #5a3e21;
    color: #ffd6a5;
}

html.dark-mode .nm-eat-badge.difficulty-hard {
    background: #5c1010;
    color: #ffb3b3;
}