.mcq-main-container {
    padding: 20px;
    max-width: 950px; /* Slightly wider for better spacing */
    margin: 20px auto;
    background: #ffffff; /* Clean white background */
    border-radius: 16px; /* More rounded corners */
    border: 1px solid #e0e7ef;
    box-shadow: 0 8px 32px rgba(0, 30, 80, 0.1); /* Softer, more pronounced shadow */
}

/* --- New Dashboard Card Styles --- */
#category-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 30, 80, 0.12);
    border-color: #1f2a44;
}

.card-icon {
    font-size: 2rem;
    margin-right: 20px;
    color: #1f2a44;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    background-color: #e9ecef;
    border-radius: 50%;
}

.card-content h4 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2a44;
}

.card-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Color variations for icons */
.dashboard-card:nth-child(1) .card-icon { background-color: #e3f2fd; color: #0d47a1; } /* Blue */
.dashboard-card:nth-child(2) .card-icon { background-color: #e8f5e9; color: #1b5e20; } /* Green */
.dashboard-card:nth-child(3) .card-icon { background-color: #fff3e0; color: #e65100; } /* Orange */
.dashboard-card:nth-child(4) .card-icon { background-color: #f3e5f5; color: #4a148c; } /* Purple */


/* --- New Unified Filter Styles --- */
#new-filter-container {
    display: grid; /* Use grid for horizontal layout */
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
}
.filter-group {
    display: flex;
    flex-direction: column;
}
.filter-group label {
    font-weight: 600;
    color: #1f2a44;
    margin-bottom: 8px;
}
#exam-filter, #subject-filter {
    /* Custom dropdown styles */
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #1f2a44;
    min-width: 250px;
    font-size: 1rem;
    font-weight: 500;
    background-color: #fff;
    cursor: pointer;
    -webkit-appearance: none; /* Removes default browser styling */
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* Responsive layout for filters on smaller screens */
@media (max-width: 767px) {
    #new-filter-container {
        grid-template-columns: 1fr; /* Stack dropdowns vertically */
    }
    .dashboard-card {
        flex-direction: column;
        text-align: center;
    }
}

#score-container {
    display: none; /* Initially hidden */
    grid-template-columns: repeat(4, 1fr); /* Use 4 columns for the live score */
    margin-bottom: 20px;
    padding: 10px;
}
.question-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.question-meta {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid transparent;
}

/* Specific colors for each badge */
.question-meta.exam {
    background-color: #eff6ff; /* Light blue */
    color: #3b82f6;
    border-color: #dbeafe;
}

.question-meta.subject {
    background-color: #f0fdf4; /* Light green */
    color: #22c55e;
    border-color: #dcfce7;
}

.question-meta.topic {
    background-color: #fffbeb; /* Light yellow */
    color: #f59e0b;
    border-color: #fef3c7;
}
.question.already-attempted {
    background-color: #f1f3f5; /* A light grey to indicate it's been seen */
    border-left: 4px solid #6c757d; /* A subtle left border */
    padding-left: 15px;
}
.question { margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.question-text {
    margin-top: 0; /* Remove extra space above the question text */
}
.options { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.option-btn {
    width: 100%; text-align: left; padding: 12px;
    border: 1px solid #ddd; background-color: #f9f9f9;
    cursor: pointer; border-radius: 5px;
}
.option-btn:hover { background-color: #e9e9e9; }
.option-btn.correct { background-color: #d4edda; border-color: #c3e6cb; color: #155724; }
.option-btn.incorrect { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }
.options.answered .option-btn:not(.correct):not(.incorrect) {
    cursor: not-allowed;
    opacity: 0.7;
}
.options.disabled-quiz .option-btn {
    cursor: not-allowed;
    background-color: #e9ecef;
    opacity: 0.6;
}

.question-count-display {
    text-align: center;
    font-weight: 600;
    color: #1f2a44;
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 25px;
}

/* --- Pagination Styles --- */
#pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Allows buttons to wrap on smaller screens */
    gap: 8px;
    margin-top: 30px;
}
.page-btn {
    background-color: #fff;
    border: 2px solid #dee2e6;
    color: #1f2a44;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    min-width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}
.page-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}
.page-btn.active {
    background-color: #1f2a44;
    color: #fff;
    border-color: #1f2a44;
}
/* Progress Section Styles */
#progress-container {
    display: none; /* Hidden by default */
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa; /* Consistent light background */
    border-radius: 12px;
    border: 1px solid #e9ecef;
}
#progress-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1f2a44;
}
#progress-stats {
    margin-bottom: 20px;
    display: flex; /* Use flexbox for better alignment */
    flex-direction: column;
    gap: 20px;
}
.progress-category {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 8px rgba(0, 30, 80, 0.05); /* Subtle shadow */
}
.progress-category h3 {
    background-color: #1f2a44; /* Using the primary dark blue for consistency */
    color: #fff;
    padding: 12px 15px;
    margin: -15px -15px 15px -15px; /* Negative margin to make it span the full width of the padded parent */
    border-radius: 8px 8px 0 0; /* Round the top corners to match the container */
    text-align: center;
}
#progress-stats p {
    padding: 15px;
    border-radius: 8px;
    margin: 0 0 15px 0; /* Remove top/side margin, add bottom margin */
    border: 1px solid #e9ecef;
    background-color: #fff;
}
#progress-stats p strong {
    display: block;
    margin-bottom: 10px;
    background-color: #e9ecef; /* Default background */
    color: #495057; /* Default text color */
    padding: 8px 12px;
    border-radius: 6px;
    margin: -15px -15px 15px -15px; /* Adjusted to match parent padding */
    border-radius: 8px 8px 0 0;
}

/* --- New Pastel Color-coded Subject/Exam Headers --- */
.progress-entry--maths strong { background-color: #A5B4FC; color: #3730a3; }
.progress-entry--science strong { background-color: #6EE7B7; color: #047857; }
.progress-entry--english strong { background-color: #FDE68A; color: #a16207; }
.progress-entry--history strong { background-color: #FCA5A5; color: #991b1b; }
.progress-entry--geography strong { background-color: #BAE6FD; color: #0369a1; }
.progress-entry--computer strong { background-color: #C7D2FE; color: #4338ca; }
.progress-entry--gk strong { background-color: #FBCFE8; color: #9d2449; }
.progress-entry--accountancy strong { background-color: #a7f3d0; color: #065f46; }
.progress-entry--economics strong { background-color: #fef08a; color: #854d0e; }
.progress-entry--reasoning strong { background-color: #d8b4fe; color: #6b21a8; }
.progress-entry--polity strong { background-color: #bae6fd; color: #0c4a6e; }

/* Default for 'All Exams' or uncategorized */
.progress-entry--general strong {
    background-color: #e5e7eb; color: #374151;
}
#progress-stats p small {
    color: #555; /* Make the stats text a slightly lighter color */
}
.stat-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.stat-box {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}
/* --- New Color-coded Stat Boxes --- */
.stat-box--attempted .stat-value { color: #3B82F6; }
.stat-box--correct .stat-value { color: #22C55E; }
.stat-box--incorrect .stat-value { color: #EF4444; }
.stat-box--accuracy .stat-value { color: #10B981; }

/* Specific and corrected background colors for all stat boxes */
.stat-box--attempted { background-color: #e0f2fe; border-color: #bae6fd; } /* Light Sky Blue */
.stat-box--correct { background-color: #dcfce7; border-color: #bbf7d0; } /* Vibrant Green */
.stat-box--incorrect { background-color: #fee2e2; border-color: #fecaca; } /* Vibrant Red */
.stat-box--accuracy { background-color: #ffedd5; border-color: #fed7aa; } /* Vibrant Orange */

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #555;
    margin-bottom: 5px;
}
.stat-value {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: #0056b3;
}
.overall-performance {
    /* This is now a card, so it needs the same styling as .progress-category */
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 8px rgba(0, 30, 80, 0.05);
}

#clear-progress-btn {
    /* New consistent, but distinct, style for the clear button */
    display: block;
    width: fit-content;
    margin: 20px auto 0 auto; /* Center the button and add space on top */
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    
    /* Outline style for a "danger" action */
    background-color: #fff;
    color: #dc3545; /* Red text */
    border: 2px solid #dc3545; /* Red border */
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#clear-progress-btn:hover {
    background-color: #dc3545; /* Red background on hover */
    color: #fff; /* White text on hover */
}

/* --- Mock Test Page Specific Styles --- */
.mock-selection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.mock-type-section { background-color: #f0f7ff; padding: 20px; border-radius: 12px; text-align: center; border: 1px solid #d1e7fd; }
.mock-type-section h3 { color: #1f2a44; margin-top: 0; border-bottom: none; }
.mock-type-section select { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #ccc; margin-bottom: 15px; }
.mock-type-section button { width: 100%; background-color: #1f2a44; color: white; border: none; padding: 12px 20px; border-radius: 8px; cursor: pointer; transition: background-color 0.3s; font-size: 1rem; font-weight: 600; }
.mock-type-section button:hover { background-color: #1a233a; }
.performance-section { background-color: #fff8e1; border-color: #ffecb3; }
.performance-section button { background-color: #ff8f00; }
.performance-section button:hover { background-color: #e65100; }

#timer-container { font-size: 1.2rem; font-weight: bold; text-align: center; background-color: #1f2a44; color: white; padding: 10px; border-radius: 8px; margin-bottom: 20px; }
#mock-navigation { display: flex; justify-content: space-between; margin-top: 20px; }
#mock-navigation button { background-color: #1f2a44; color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; transition: background-color 0.3s; }
#mock-navigation button:hover { background-color: #1a233a; }
#mock-navigation button:disabled { background-color: #ccc; cursor: not-allowed; }

#submit-mock-btn { background-color: #28a745; }
#submit-mock-btn:hover { background-color: #218838; }

.mock-option { display: block; padding: 10px; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 10px; cursor: pointer; }
.mock-option:hover { background-color: #f0f7ff; }
.mock-option input { margin-right: 10px; }

.clear-quiz-attempts-btn {
    display: block;
    width: fit-content;
    margin: 0 auto 25px auto;
    padding: 8px 15px;
    font-size: 0.9rem;
    background-color: #dc3545; /* Red background */
    color: #fff; /* White text for contrast */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold; /* Bold text */
}
.clear-quiz-attempts-btn:hover {
    background-color: #c82333; /* Darker red on hover */
}
#performance-history .history-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-left: 5px solid #1f2a44;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}
#performance-history .history-item strong {
    color: #1f2a44;
    display: block;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

#back-to-selection-btn {
    display: block;
    width: fit-content;
    margin: 30px auto 10px auto; /* Center the button */
    background-color: #1f2a44;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 1rem;
    font-weight: 600;
}

#back-to-selection-btn:hover {
    background-color: #1a233a;
    transform: translateY(-2px);
}

.performance-actions {
    display: flex;
    justify-content: space-between; /* Positions items at opposite ends */
    gap: 15px;
    margin-top: 30px;
    align-items: center; /* Vertically align buttons if they have different heights */
}
#clear-performance-btn {
    background-color: #fff;
    color: #dc3545;
    border: 2px solid #dc3545;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}
#clear-performance-btn:hover {
    background-color: #dc3545;
    color: #fff;
}

#attempt-another-btn {
    background-color: #1f2a44;
    color: white;
    border: 2px solid #1f2a44; /* Added border for consistent sizing */
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}
#attempt-another-btn:hover {
    background-color: #1a233a;
}
.solution-toggle-btn {
    background-color: #ffc107;
    color: #1f2a44;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 0.85rem;
    margin-top: 15px;
    font-weight: 500;
}
.solution-toggle-btn:hover {
    background-color: #e0a800;
}

.solution-wrapper {
    display: none; /* Hidden by default */
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #17a2b8;
    border-radius: 0 8px 8px 0;
}
.correct-answer-text {
    font-weight: bold;
    color: #155724;
}
.explanation {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
    color: #555;
    line-height: 1.5;
}

/* --- Modern Toggle Switch Styles --- */
#pyq-mode-toggle-container {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: -10px; /* Pull it closer to the dropdowns */
    margin-bottom: 20px;
    padding: 10px;
}
.toggle-label {
    font-weight: 600;
    color: #6c757d; /* Softer grey for inactive label */
    transition: color 0.3s ease;
}
.toggle-label.active {
    color: #1f2a44;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #adb5bd; /* A better grey for the 'off' state */
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Add shadow to the knob */
    transition: .4s;
}
input:checked + .slider {
    background-color: #fd7e14; /* Vibrant orange for 'on' state */
}
input:checked + .slider:before {
    transform: translateX(26px);
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}

/* --- Back to Top Button Styles --- */
#back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: rgba(31, 42, 68, 0.7); /* Translucent dark blue */
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
}
#back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
}
#back-to-top-btn:hover {
    background-color: rgba(31, 42, 68, 1); /* Solid on hover */
}