/* =========================================
   CNS COMBINED STYLESHEET
   Contains: Grammar, MCQ Practice, and PTE
   ========================================= */

/* -----------------------------------------
   1. GLOBAL & FONT DEFAULTS
   ----------------------------------------- */

/* Default font for the entire page (From MCQ Styles) */
body,
p, h1, h2, h3, h4, h5, h6, li, label, input, select, button {
    font-family: 'Noto Sans Bengali', sans-serif !important;
}

/* Utility Class: Bold Green Text (Consolidated) */
.bold-green {
    font-weight: bold !important;
    color: #008000 !important; /* Green */
}

/* -----------------------------------------
   2. GRAMMAR SECTION STYLES
   ----------------------------------------- */

/* Base styling for the main container */
.cns-grammar-wrapper {
    font-family: 'Noto Sans Bengali', sans-serif;
    max-width: 720px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.cns-grammar-wrapper h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.cns-grammar-grades {
    margin-bottom: 20px;
    text-align: center;
}

.cns-grammar-grades strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #555;
}

.cns-grammar-grade-btn {
    background-color: #007cba;
    color: white;
    border: none;
    padding: 12px 20px;
    margin: 5px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 15px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.cns-grammar-grade-btn:hover {
    background-color: #005fa3;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

.cns-grammar-grade-btn.active-grade-btn {
    background-color: #004d7a;
    color: white;
    border: 1px solid #004d7a;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

/* Practice Mode Selection */
.cns-practice-mode-selection {
    text-align: center;
    margin: 25px 0;
    padding: 15px;
    background-color: #f7f9fc;
    border-radius: 8px;
}

.cns-practice-mode-selection strong {
    display: block;
    margin-bottom: 12px;
    font-size: 1.1em;
    color: #444;
}

.cns-practice-mode-btn {
    background-color: #6c5ce7;
    color: white;
    border: none;
    padding: 10px 22px;
    margin: 5px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cns-practice-mode-btn:hover {
    background-color: #5848c8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cns-practice-mode-btn.active-mode-btn {
    background-color: #fd79a8;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    transform: scale(1.05);
}

/* Question Type Selection */
.cns-question-type-buttons {
    text-align: center;
    margin-bottom: 20px;
}

.cns-question-type-buttons strong {
     display: block;
    margin-bottom: 12px;
    font-size: 1.1em;
    color: #444;
}

#cns-question-type-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Collapsible Type Selection */
.collapsible-container {
    width: 100%;
}

.collapsible-header {
    background-color: #0073aa;
    color: white;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    transition: background-color 0.4s ease;
    border-radius: 5px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-header:hover, .collapsible-header.active {
    background-color: #005a80;
}

.collapsible-header:after {
    content: '\f078'; /* Font Awesome chevron-down */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    transition: transform 0.3s ease-in-out;
}

.collapsible-header.active:after {
   transform: rotate(180deg); /* chevron-up */
}

.collapsible-content {
    padding: 15px;
    display: none;
    overflow: hidden;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 5px 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Board Questions List */
hr.board-divider {
    width: 100%;
    flex-basis: 100%;
    height: 0;
    margin: 8px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

.cns-grammar-question-type-btn {
    background-color: #1abc9c;
    color: white;
    border: none;
    padding: 10px 18px;
    margin: 5px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s ease-in-out;
}

.cns-grammar-question-type-btn:hover {
    transform: translateY(-2px);
    filter: brightness(90%);
}

.cns-grammar-question-type-btn.active-type-btn {
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0 0 10px rgba(0,0,0,0.25);
    transform: translateY(1px);
    filter: brightness(85%);
}

/* Question, Solution, Explanation Blocks */
.cns-grammar-question-block {
    margin-top: 20px;
    padding: 20px;
    border-left: 6px solid;
    background-color: #fcfcfc;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.cns-grammar-question-block strong {
    display: block;
    margin-bottom: 12px;
    font-size: 1.2em;
    color: #333;
}

.cns-grammar-question-block p {
    margin: 0;
    line-height: 1.6;
    font-size: 1.1em;
    color: #555;
}

.cns-question-block { border-left-color: #3498db; }
.cns-solution-block { border-left-color: #27ae60; }
.cns-explanation-block { border-left-color: #e67e22; }

.cns-grammar-question-block img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Selected grade display */
#selected-grade-display {
    color: #0073aa;
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
}

/* Topic Selection Section */
.cns-question-sl-buttons {
    margin-top: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.07);
    text-align: center;
}

.cns-question-sl-buttons strong {
    display: block;
    margin-bottom: 15px;
    font-size: 1.15em;
    color: #444;
}

#cns-question-sl-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.cns-grammar-question-sl-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #ffffff;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.cns-grammar-question-sl-link:hover {
    background-color: #eaf7fd;
    border-color: #87ceeb;
    color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.cns-grammar-question-sl-link.active {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: bold;
    box-shadow: 0 3px 7px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.cns-grammar-question-sl-link.active .topic-icon {
    color: white !important;
}

.topic-icon {
    margin-right: 8px;
    font-size: 1.2em;
    line-height: 1;
}

/* Range Inputs */
.cns-practice-range {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f1f1f1;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cns-practice-range strong {
    font-size: 1.1em;
    color: #555;
    margin-right: 5px;
}

.cns-range-input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
}

.cns-range-input:disabled {
    background-color: #eee;
    cursor: not-allowed;
}

#cns-start-practice-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

#cns-start-practice-btn:hover:not(:disabled) {
    background-color: #218838;
}

#cns-start-practice-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Grammar Navigation buttons */
.cns-grammar-navigation {
    margin-top: 25px;
    text-align: center;
}

.cns-grammar-navigation button {
    padding: 14px 28px;
    margin: 0 10px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.cns-grammar-navigation button:hover:not(:disabled) {
    background-color: #005a80;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.cns-grammar-navigation button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

.cns-grammar-question-item h3 {
    text-align: center;
    font-size: 1.6em;
    color: #0056b3;
    border-bottom: 2px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 25px;
}

.cns-grammar-question-item h3 .current-question-index,
.cns-grammar-question-item h3 .total-questions-in-sl {
    font-weight: bold;
    color: #d9534f;
}

/* -----------------------------------------
   3. MCQ PRACTICE SECTION STYLES
   ----------------------------------------- */

/* Specific font application for MCQ elements */
.cns-mcq-question-practice p,
.cns-mcq-question-practice li label,
.cns-mcq-practice-main-container,
.cns-selector-container,
.cns-mcq-feedback,
.cns-mcq-timer-display,
.cns-mcq-summary,
.cns-incorrect-answers-list {
    font-family: 'Noto Sans Bengali', sans-serif !important;
}

.cns-mcq-practice-main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.cns-mcq-practice-main-container h2 {
    color: #333;
    margin-top: 0;
    text-align: center;
}

.cns-selector-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* --- NEW CATEGORY FILTER BUTTONS --- */
.cns-category-btn-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
    width: 100%;
}

.cns-cat-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    background: #f0f0f0;
    color: #444;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
}

.cns-cat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.12);
    background: #e8e8e8;
}

.cns-cat-btn.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
    transform: translateY(-1px);
}

/* Specific colors for specific buttons (optional, for variety) */
.cns-cat-btn[data-filter="BCS"].active {
    background: linear-gradient(135deg, #1d976c 0%, #116848 100%); /* Greenish */
}
.cns-cat-btn[data-filter="MEDICAL"].active {
    background: linear-gradient(135deg, #eb3349 0%, #b51c2e 100%); /* Reddish */
}
.cns-cat-btn[data-filter="BUET"].active {
    background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%); /* Purple */
}
.cns-cat-btn[data-filter="VARSITY"].active {
    background: linear-gradient(135deg, #FF8008 0%, #FFC837 100%); /* Orange */
    color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cns-selector-container label {
    font-weight: bold;
    color: #555;
}

.cns-selector-container select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    font-size: 1em;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
    min-width: 200px;
}

.cns-selector-container select:focus {
    border-color: #007bff;
}

.cns-mcq-progress-container {
    width: 90%;
    background-color: #e0e0e0;
    border-radius: 10px;
    margin: 20px auto;
    height: 30px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

#cns-mcq-progress-bar {
    height: 100%;
    background: linear-gradient(to right, #4CAF50, #8bc34a);
    border-radius: 10px;
    text-align: center;
    line-height: 30px;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    transition: width 0.5s ease-in-out;
}

.cns-mcq-timer-display {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.3em;
    color: #333;
    font-weight: bold;
}

.cns-mcq-question-practice {
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    background-color: #fcfcfc;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cns-mcq-question-practice strong {
    color: #0056b3;
    font-size: 1.1em;
    display: block;
    margin-bottom: 15px;
}

/* MCQ Options */
.cns-mcq-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cns-mcq-options li {
    margin-bottom: 10px;
}

.cns-mcq-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: background-color 0.2s, border-color 0.2s;
    background-color: #f9f9f9;
}

.cns-mcq-options input[type="radio"] {
    display: none;
}

/* Circular option (A, B, C, D) */
.cns-option-circle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid #007bff;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: bold;
    color: #007bff;
    background-color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
}

.cns-option-text {
    flex-grow: 1;
    color: #333;
}

/* Checked States */
.cns-mcq-options input[type="radio"]:checked + .cns-option-circle {
    background-color: #007bff;
    color: #fff;
    border-color: #0056b3;
}

.cns-mcq-options label:hover {
    background-color: #e2f0ff;
    border-color: #007bff;
}

.cns-mcq-options input[type="radio"]:checked + .cns-option-circle + .cns-option-text {
    color: #0056b3;
    font-weight: 600;
}

/* Disabled/Result States */
.cns-mcq-options input[type="radio"]:disabled + .cns-option-circle {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #f1f1f1;
    color: #777;
    border-color: #ccc;
}

.cns-mcq-options input[type="radio"]:disabled + .cns-option-circle + .cns-option-text {
    opacity: 0.7;
    cursor: not-allowed;
    color: #777;
}

.cns-mcq-feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid;
    background-color: #e9f5ff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cns-mcq-feedback p {
    margin: 5px 0;
    line-height: 1.5;
}

.cns-mcq-feedback p:last-child {
    margin-bottom: 0;
}

/* Feedback Colors */
.cns-mcq-feedback[style*="border-color: rgb(40, 167, 69)"] { /* Correct (Green) */
    border-color: #28a745 !important;
    background-color: #e6ffee !important;
}

.cns-mcq-feedback[style*="border-color: rgb(220, 53, 69)"] { /* Incorrect (Red) */
    border-color: #dc3545 !important;
    background-color: #ffe6e6 !important;
}

/* Generic Button Styling */
.button {
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-right: 10px;
    transition: background-color 0.2s, border-color 0.2s;
}

.cns-submit-practice-answer,
.cns-next-question-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cns-submit-practice-answer {
    background-color: #28a745;
    color: white;
}

.cns-submit-practice-answer:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.cns-next-question-btn {
    background-color: #007bff;
    color: white;
    margin-left: 10px;
}

.cns-next-question-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* MCQ Summary */
.cns-mcq-summary {
    margin-top: 30px;
    padding: 25px;
    border: 1px solid #b3e0ff;
    border-radius: 10px;
    background-color: #e6f7ff;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.1);
}

.cns-mcq-summary h3 {
    color: #0056b3;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.cns-mcq-summary p {
    margin: 10px 0;
    font-size: 1.1em;
    color: #333;
}

.cns-mcq-summary p strong {
    color: #007bff;
}

.cns-mcq-summary p.correct { color: #28a745; }
.cns-mcq-summary p.incorrect { color: #dc3545; }

/* Incorrect Answers List */
.cns-incorrect-answers-list {
    margin-top: 30px;
    border-top: 1px dashed #ccc;
    padding-top: 20px;
}

.cns-incorrect-answers-list h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #dc3545;
}

.cns-incorrect-item {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid #dc3545;
    border-radius: 8px;
    background-color: #ffebe6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cns-incorrect-item p strong {
    color: #333;
}

.cns-incorrect-feedback p {
    margin-top: 5px;
    margin-bottom: 5px;
    line-height: 1.5;
}

.cns-incorrect-feedback p:last-child {
    margin-bottom: 0;
}

.cns-unanswered-highlight {
    border: 2px solid #dc3545;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #ffeaea;
    border-radius: 5px;
}

/* -----------------------------------------
   4. PTE SECTION STYLES
   ----------------------------------------- */

.cns-pte-wrapper {
    font-family: 'Noto Sans Bengali', sans-serif;
    max-width: 700px;
    margin: 20px auto;
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

.cns-pte-grades button.cns-pte-grade-btn {
    margin: 5px 5px 5px 0;
    padding: 8px 15px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cns-pte-grades button.cns-pte-grade-btn:hover,
.cns-pte-grades button.cns-pte-grade-btn.active {
    background: #005177;
}

#cns-pte-lesson-number {
    width: 70px;
    padding: 5px;
    font-size: 1em;
}

#cns-pte-load-lesson {
    padding: 6px 15px;
    margin-left: 10px;
    cursor: pointer;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 3px;
}

.cns-pte-lesson {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    background: white;
    border-radius: 5px;
}

.cns-pte-play-btn,
.cns-pte-record-btn,
.cns-pte-start-record,
.cns-pte-stop-record {
    padding: 8px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 8px 0;
    transition: background 0.3s ease;
}

.cns-pte-play-btn:hover,
.cns-pte-record-btn:hover,
.cns-pte-start-record:hover,
.cns-pte-stop-record:hover {
    background: #005177;
}

.cns-pte-progress-bar {
    width: 100%;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

/* --- UPDATED PROGRESS BAR FOR MASTERY --- */
.cns-pte-progress-inner {
    height: 100%;
    width: 0%;
    background: #0073aa; /* Default Blue */
    transition: width 0.4s ease, background-color 0.4s ease;
}

/* New class for 100% completion (20 plays) */
.cns-pte-progress-inner.mastered {
    background: #28a745 !important; /* Bright Green */
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5); /* Glow effect */
}

.cns-pte-play-count {
    margin-top: 5px;
    font-weight: 600;
    color: #333;
}

.cns-pte-text-block p {
    background: #f5f5f5;
    padding: 8px;
    border-radius: 4px;
    white-space: pre-line;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.4;
}

.cns-pte-record-container button {
    margin-right: 8px;
}

.cns-pte-recorded-audio {
    margin-top: 10px;
    width: 100%;
}

.cns-pte-navigation {
    text-align: center;
}

.cns-pte-navigation button {
    padding: 6px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    margin: 5px;
    cursor: pointer;
}

.cns-pte-navigation button:hover {
    background: #005177;
}