/* ==========================================================================
   PGT & TGT Mathematics Master Notes & Solved Examples Plugin (v1.0.0)
   100% Isolated Namespace (.ptm-notes-*) - Zero Conflict with Quiz Plugins
   ========================================================================== */

.ptm-notes-app,
.ptm-notes-app *,
.ptm-notes-app *::before,
.ptm-notes-app *::after {
    box-sizing: border-box;
    overflow-anchor: none;
}

.ptm-notes-app {
    --ptm-primary: #1e40af;
    --ptm-primary-dark: #1e3a8a;
    --ptm-primary-light: #eff6ff;
    --ptm-tgt-accent: #0f766e;
    --ptm-tgt-light: #f0fdfa;
    --ptm-amber: #b45309;
    --ptm-amber-bg: #fffbeb;
    --ptm-emerald: #047857;
    --ptm-emerald-bg: #ecfdf5;
    --ptm-purple: #6d28d9;
    --ptm-purple-bg: #f5f3ff;
    --ptm-text: #0f172a;
    --ptm-muted: #475569;
    --ptm-border: #cbd5e1;
    --ptm-card-bg: #ffffff;
    --ptm-bg: #f8fafc;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Devanagari', sans-serif;
    color: var(--ptm-text);
    background: var(--ptm-bg);
    border: 1px solid var(--ptm-border);
    border-radius: 18px;
    padding: 24px;
    margin: 24px auto;
    max-width: 1240px;
    line-height: 1.7;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.08);
    font-variant-numeric: tabular-nums;
}

/* Header Banner */
.ptm-notes-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #0f766e 100%);
    color: #ffffff;
    border-radius: 14px;
    padding: 28px 28px 24px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
}

.ptm-notes-header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ptm-notes-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #f8fafc;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 13px;
    border-radius: 999px;
    text-transform: uppercase;
}

.ptm-notes-stats-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ptm-notes-stat-pill {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 8px;
}

.ptm-notes-title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    color: #ffffff !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.3;
}

.ptm-notes-subtitle {
    font-size: 14.5px;
    color: #e2e8f0;
    margin: 0;
    max-width: 980px;
}

/* Course Switcher Tabs (PGT vs TGT) */
.ptm-notes-course-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.ptm-notes-course-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 13px;
    border: 2px solid var(--ptm-border);
    background: #ffffff;
    color: var(--ptm-text);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.ptm-notes-course-btn:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.ptm-notes-course-btn.is-active[data-course="pgt"] {
    border-color: #1d4ed8;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 6px 18px -4px rgba(29, 78, 216, 0.22);
}

.ptm-notes-course-btn.is-active[data-course="tgt"] {
    border-color: #0f766e;
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    box-shadow: 0 6px 18px -4px rgba(15, 118, 110, 0.22);
}

.ptm-notes-course-btn-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ptm-notes-course-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    background: #1e3a8a;
    color: #ffffff;
    flex-shrink: 0;
}

.ptm-notes-course-btn[data-course="tgt"] .ptm-notes-course-icon {
    background: #0f766e;
}

.ptm-notes-course-name {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    display: block;
    line-height: 1.25;
}

.ptm-notes-course-meta {
    font-size: 12.5px;
    color: #475569;
    font-weight: 600;
    display: block;
    margin-top: 3px;
}

.ptm-notes-course-tag {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #1e293b;
    white-space: nowrap;
}

.ptm-notes-course-btn.is-active .ptm-notes-course-tag {
    background: #1e3a8a;
    color: #ffffff;
}

.ptm-notes-course-btn.is-active[data-course="tgt"] .ptm-notes-course-tag {
    background: #0f766e;
    color: #ffffff;
}

/* Search & Quick Controls Bar */
.ptm-notes-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--ptm-border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.ptm-notes-search-wrap {
    flex: 1 1 320px;
    position: relative;
    display: flex;
    align-items: center;
}

.ptm-notes-search-input {
    width: 100%;
    padding: 10px 38px 10px 14px;
    font-size: 14.5px;
    border: 1px solid #94a3b8;
    border-radius: 9px;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
}

.ptm-notes-search-input:focus {
    border-color: #1d4ed8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.ptm-notes-search-clear {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 17px;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    display: none;
}

.ptm-notes-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ptm-notes-action-btn {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 9px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ptm-notes-action-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.ptm-notes-action-btn.is-primary {
    background: #1e40af;
    color: #ffffff;
    border-color: #1e40af;
}

.ptm-notes-action-btn.is-primary:hover {
    background: #1e3a8a;
}

/* Subject Cards Grid */
.ptm-notes-section-label {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #334155;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ptm-notes-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.ptm-notes-subject-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 13px;
    padding: 16px;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.ptm-notes-subject-card:hover {
    border-color: #60a5fa;
    box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.08);
}

.ptm-notes-subject-card.is-active {
    border-color: #1d4ed8;
    background: #eff6ff;
    box-shadow: 0 8px 20px -6px rgba(29, 78, 216, 0.22);
}

.ptm-notes-app[data-active-course="tgt"] .ptm-notes-subject-card.is-active {
    border-color: #0f766e;
    background: #f0fdfa;
    box-shadow: 0 8px 20px -6px rgba(15, 118, 110, 0.22);
}

.ptm-notes-subj-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ptm-notes-subj-code {
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 6px;
    background: #dbeafe;
    color: #1e3a8a;
}

.ptm-notes-app[data-active-course="tgt"] .ptm-notes-subj-code {
    background: #ccfbf1;
    color: #115e59;
}

.ptm-notes-subj-icon {
    font-size: 20px;
}

.ptm-notes-subj-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
    margin: 2px 0;
}

.ptm-notes-subj-summary {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.45;
    margin: 0;
}

.ptm-notes-subj-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: #1d4ed8;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
}

.ptm-notes-app[data-active-course="tgt"] .ptm-notes-subj-footer {
    color: #0f766e;
}

/* Topic Selector Pills Bar */
.ptm-notes-topics-nav {
    background: #ffffff;
    border: 1px solid var(--ptm-border);
    border-radius: 13px;
    padding: 16px;
    margin-bottom: 22px;
}

.ptm-notes-topics-nav-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.ptm-notes-topics-nav-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.ptm-notes-topic-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ptm-notes-topic-pill {
    padding: 8px 13px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 9px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.ptm-notes-topic-pill:hover {
    border-color: #60a5fa;
    background: #eff6ff;
}

.ptm-notes-topic-pill.is-active {
    background: #1e40af;
    color: #ffffff;
    border-color: #1e40af;
}

.ptm-notes-app[data-active-course="tgt"] .ptm-notes-topic-pill.is-active {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
}

/* Detailed Topic Study Card */
.ptm-notes-topic-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.05);
}

.ptm-notes-topic-card-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ptm-notes-topic-card-title {
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 800;
    color: #0f172a !important;
    margin: 0 !important;
    line-height: 1.35;
}

.ptm-notes-level-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 11px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    white-space: nowrap;
}

/* Content Blocks Inside Each Topic */
.ptm-notes-block {
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
}

.ptm-notes-block-title {
    font-size: 15.5px;
    font-weight: 800;
    margin: 0 0 10px 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ptm-notes-block-concept {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #1d4ed8;
}

.ptm-notes-block-concept .ptm-notes-block-title {
    color: #1e3a8a;
}

.ptm-notes-block-concept p {
    margin: 0 0 10px 0;
}

.ptm-notes-block-concept p:last-child {
    margin-bottom: 0;
}

.ptm-notes-block-concept ul {
    margin: 8px 0;
    padding-left: 20px;
}

.ptm-notes-block-concept li {
    margin-bottom: 6px;
}

.ptm-notes-block-formulas {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 5px solid #2563eb;
}

.ptm-notes-block-formulas .ptm-notes-block-title {
    color: #1d4ed8;
}

.ptm-notes-formula-list {
    margin: 0;
    padding-left: 20px;
}

.ptm-notes-formula-list li {
    margin-bottom: 8px;
    font-weight: 500;
}

.ptm-notes-block-tricks {
    background: var(--ptm-amber-bg);
    border: 1px solid #fde68a;
    border-left: 5px solid #d97706;
    color: #78350f;
}

.ptm-notes-block-tricks .ptm-notes-block-title {
    color: #b45309;
}

/* Solved Examples Grid */
.ptm-notes-examples-wrap {
    margin-bottom: 18px;
}

.ptm-notes-example-card {
    background: var(--ptm-emerald-bg);
    border: 1px solid #a7f3d0;
    border-left: 5px solid #059669;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
}

.ptm-notes-example-head {
    font-size: 14px;
    font-weight: 800;
    color: #065f46;
    margin-bottom: 6px;
}

.ptm-notes-example-prob {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #6ee7b7;
}

.ptm-notes-example-sol {
    font-size: 14px;
    color: #1e293b;
}

/* Interactive Self-Check Practice Box */
.ptm-notes-practice-card {
    background: var(--ptm-purple-bg);
    border: 1px solid #ddd6fe;
    border-left: 5px solid #7c3aed;
    border-radius: 12px;
    padding: 16px 18px;
}

.ptm-notes-practice-q {
    font-size: 14.5px;
    font-weight: 700;
    color: #2e1065;
    margin-bottom: 10px;
}

.ptm-notes-practice-toggle {
    background: #6d28d9;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.ptm-notes-practice-toggle:hover {
    background: #5b21b6;
}

.ptm-notes-practice-ans {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #c4b5fd;
    font-size: 14px;
    color: #1e1b4b;
}

.ptm-notes-practice-ans.is-open {
    display: block;
}

/* Bottom Topic Navigation Footer */
.ptm-notes-nav-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.ptm-notes-b64-chunk {
    display: none !important;
}

@media (max-width: 768px) {
    .ptm-notes-app {
        padding: 14px;
        border-radius: 12px;
    }
    .ptm-notes-header {
        padding: 20px 16px;
    }
    .ptm-notes-topic-card {
        padding: 16px;
    }
}
