:root {
    --navy-950: #07111e;
    --navy-900: #0b172a;
    --navy-800: #132a4a;
    --royal-600: #1d4ed8;
    --royal-700: #1e40af;
    --saffron-600: #dc5a12;
    --saffron-700: #c2410c;
    --emerald-600: #15803d;
    --slate-50: #f9fafb;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-900: #0b192c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--slate-50);
    color: var(--slate-900);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* Page Navigation & Buffering Loader */
.igc-top-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10000;
    background: transparent;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.igc-top-loader.active {
    opacity: 1;
}

.igc-top-loader-fill {
    width: 42%;
    height: 100%;
    background: linear-gradient(90deg, var(--royal-600), #38bdf8, #fbbf24);
    border-radius: 99px;
    animation: igcTopBarSlide 1.05s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes igcTopBarSlide {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(260%); }
}

.igc-page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(11, 23, 42, 0.36);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.igc-page-loader.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.igc-loader-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 20px 45px rgba(7, 17, 30, 0.22);
    max-width: 340px;
    width: 100%;
}

.igc-spinner-ring {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid var(--slate-200);
    border-top-color: var(--royal-600);
    border-right-color: var(--royal-600);
    animation: igcSpin 0.72s linear infinite;
    flex-shrink: 0;
}

@keyframes igcSpin {
    to { transform: rotate(360deg); }
}

.igc-loader-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.igc-loader-copy strong {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: var(--navy-900);
    line-height: 1.2;
}

.igc-loader-copy strong span {
    color: var(--royal-600);
}

.igc-loader-copy > span {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-500);
}

h1, h2, h3, h4 {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    letter-spacing: -0.02em;
    color: var(--navy-900);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.m-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--slate-200);
}

.m-header-inner {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.m-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.m-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.m-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.m-brand-name {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 800;
    font-size: 1.08rem;
    color: var(--navy-900);
}

.m-brand-name span {
    color: var(--saffron-600);
}

.m-brand-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--slate-500);
}

.m-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.m-nav-link {
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--slate-600);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.m-nav-link:hover,
.m-nav-link.active {
    background: #eff6ff;
    color: var(--royal-600);
}

.m-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--navy-900);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.m-back-btn:hover {
    background: var(--royal-600);
}

/* Hero Banner */
.m-hero {
    background-color: var(--navy-900);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 38px 38px;
    color: #ffffff;
    padding: 44px 0 48px;
    border-bottom: 3px solid var(--saffron-600);
}

.m-kicker {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fbbf24;
    margin-bottom: 8px;
}

.m-hero h1 {
    color: #ffffff;
    font-size: clamp(1.7rem, 3.2vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 10px;
}

.m-hero p {
    color: #cbd5e1;
    font-size: 0.98rem;
    max-width: 680px;
    margin-bottom: 22px;
}

.m-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 640px;
    background: #ffffff;
    border-radius: 12px;
    padding: 6px 8px 6px 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.m-search-box svg {
    color: var(--slate-500);
    flex-shrink: 0;
}

.m-search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-family: inherit;
    font-size: 0.94rem;
    color: var(--navy-900);
    background: transparent;
    padding: 8px 4px;
}

.m-search-clear {
    border: none;
    background: var(--slate-100);
    color: var(--slate-600);
    padding: 7px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.m-search-clear.hidden {
    display: none;
}

/* Main Content Area */
.m-section {
    padding: 36px 0;
}

.m-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.m-section-head h2 {
    font-size: 1.45rem;
    margin-bottom: 4px;
}

.m-section-head p {
    font-size: 0.9rem;
    color: var(--slate-600);
}

/* Branch Selector Grid */
.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.branch-card-btn {
    text-align: left;
    background: #ffffff;
    border: 1.5px solid var(--slate-200);
    border-radius: 11px;
    padding: 13px 14px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.14s ease;
}

.branch-card-btn:hover {
    border-color: var(--royal-600);
    transform: translateY(-1px);
}

.branch-card-btn.active {
    background: var(--navy-900);
    border-color: var(--navy-900);
    color: #ffffff;
}

.branch-code-pill {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--royal-600);
}

.branch-card-btn.active .branch-code-pill {
    color: #fbbf24;
}

.branch-full-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate-600);
    line-height: 1.3;
}

.branch-card-btn.active .branch-full-name {
    color: #cbd5e1;
}

/* Semester Filter Strip */
.sem-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.sem-tab {
    padding: 8px 15px;
    border-radius: 9px;
    border: 1px solid var(--slate-300);
    background: #ffffff;
    color: var(--slate-700);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sem-tab:hover {
    border-color: var(--royal-600);
    color: var(--royal-600);
}

.sem-tab.active {
    background: var(--royal-600);
    border-color: var(--royal-600);
    color: #ffffff;
}

/* Subjects Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.subject-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.14s ease;
}

.subject-card:hover {
    border-color: var(--royal-600);
    box-shadow: 0 8px 20px rgba(11, 23, 42, 0.07);
    transform: translateY(-2px);
}

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

.subj-code {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.subj-status {
    font-size: 0.73rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
}

.subj-status.ready {
    background: #dcfce7;
    color: #166534;
}

.subj-status.soon {
    background: #f1f5f9;
    color: #64748b;
}

.subject-card h3 {
    font-size: 1.02rem;
    line-height: 1.35;
}

.subj-meta {
    font-size: 0.8rem;
    color: var(--slate-500);
}

.subj-cta {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--royal-600);
}

/* Featured Solved Practicals Strip */
.featured-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.featured-prac-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transition: border-color 0.16s ease, transform 0.14s ease;
}

.featured-prac-card:hover {
    border-color: var(--royal-600);
    transform: translateY(-1px);
}

.fp-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.fp-badge {
    font-size: 0.73rem;
    font-weight: 800;
    color: var(--saffron-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fp-info strong {
    font-size: 0.94rem;
    color: var(--navy-900);
    line-height: 1.35;
}

.fp-info span {
    font-size: 0.8rem;
    color: var(--slate-500);
}

.fp-go {
    padding: 7px 12px;
    border-radius: 8px;
    background: #eff6ff;
    color: var(--royal-600);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Breadcrumb & Article Layout (Subject / Practical / Legal Pages) */
.m-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--slate-500);
    padding: 18px 0 8px;
}

.m-breadcrumb a:hover {
    color: var(--royal-600);
    text-decoration: underline;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 28px;
    align-items: start;
    padding: 16px 0 48px;
}

.article-main {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    padding: 30px 32px;
    min-width: 0;
}

.article-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.article-main h1 {
    font-size: clamp(1.45rem, 2.5vw, 1.95rem);
    line-height: 1.25;
    margin-bottom: 14px;
}

.article-section {
    margin-top: 26px;
}

.article-section h2 {
    font-size: 1.16rem;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--slate-200);
}

.article-section p {
    font-size: 0.95rem;
    color: var(--slate-700);
    margin-bottom: 10px;
}

.article-section ol,
.article-section ul {
    padding-left: 20px;
    color: var(--slate-700);
    font-size: 0.94rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Code Block with Copy Button */
.code-window {
    background: #0d1526;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #1e293b;
    margin: 12px 0;
}

.code-window-bar {
    background: #162238;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-lang {
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    color: #93c5fd;
    text-transform: uppercase;
}

.copy-code-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    padding: 5px 11px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.copy-code-btn:hover {
    background: var(--royal-600);
    border-color: var(--royal-600);
}

.code-window pre {
    padding: 16px;
    overflow-x: auto;
    font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e2e8f0;
    margin: 0;
}

.output-box {
    background: #f8fafc;
    border: 1px solid var(--slate-200);
    border-left: 4px solid var(--emerald-600);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 0.84rem;
    color: var(--navy-900);
    white-space: pre-wrap;
    overflow-x: auto;
}

/* PRQ Q&A Cards */
.prq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prq-card {
    background: #f8fafc;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    padding: 14px 16px;
}

.prq-q {
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--navy-900);
    margin-bottom: 6px;
}

.prq-a {
    font-size: 0.9rem;
    color: var(--slate-700);
    margin: 0;
}

/* Practical List Table on Subject Page */
.practical-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.prac-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border: 1px solid var(--slate-200);
    border-radius: 11px;
    background: #ffffff;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.prac-row:hover {
    border-color: var(--royal-600);
    background: #f8fafc;
}

.prac-num {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: #eff6ff;
    color: var(--royal-600);
    font-weight: 800;
    font-size: 0.86rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.prac-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.prac-row-title {
    font-weight: 700;
    font-size: 0.96rem;
    color: var(--navy-900);
}

.prac-row-aim {
    font-size: 0.82rem;
    color: var(--slate-600);
    margin-top: 2px;
}

.prac-nav-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.m-btn-primary {
    background: var(--royal-600);
    color: #ffffff;
}

.m-btn-primary:hover {
    background: var(--royal-700);
}

.m-btn-outline {
    background: #ffffff;
    border-color: var(--slate-300);
    color: var(--navy-900);
}

.m-btn-outline:hover {
    border-color: var(--royal-600);
    color: var(--royal-600);
}

.m-btn-wa {
    background: #15803d;
    color: #ffffff;
}

.m-btn-wa:hover {
    background: #166534;
}

/* Sidebar */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 86px;
}

.side-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 18px 20px;
}

.side-card-navy {
    background: var(--navy-900);
    color: #ffffff;
    border-color: var(--navy-800);
}

.side-card-navy h3 {
    color: #ffffff;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.side-card-navy p {
    font-size: 0.84rem;
    color: #cbd5e1;
    margin-bottom: 14px;
}

.side-card h4 {
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.side-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-links a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--slate-700);
    display: block;
    padding: 6px 8px;
    border-radius: 7px;
}

.side-links a:hover,
.side-links a.active {
    background: #eff6ff;
    color: var(--royal-600);
}

/* AdSense Container (Hidden until ads-config.js ENABLED = true) */
.ig-ad-slot {
    display: none;
    margin: 22px 0;
    padding: 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--slate-200);
    text-align: center;
    min-height: 90px;
}

.ad-disclosure-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
    margin-bottom: 6px;
}

/* Footer */
.m-footer {
    background: var(--navy-950);
    color: #94a3b8;
    padding: 36px 0 24px;
    margin-top: 28px;
}

.m-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.m-footer h4 {
    color: #ffffff;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.m-footer p {
    font-size: 0.84rem;
    line-height: 1.6;
}

.m-footer ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 0.84rem;
}

.m-footer ul a:hover {
    color: #fbbf24;
}

.m-footer-bottom {
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

/* Empty State */
.empty-card {
    background: #ffffff;
    border: 1px dashed var(--slate-300);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    grid-column: 1 / -1;
}

.empty-card h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.empty-card p {
    font-size: 0.88rem;
    color: var(--slate-600);
    margin-bottom: 14px;
}

/* Responsive */
@media (max-width: 960px) {
    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .article-layout {
        grid-template-columns: 1fr;
    }
    .article-sidebar {
        position: static;
    }
    .m-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .container {
        padding: 0 15px;
    }
    .m-header-inner {
        flex-wrap: wrap;
    }
    .m-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    .m-nav-link {
        white-space: nowrap;
        flex-shrink: 0;
    }
    .m-hero {
        padding: 30px 0 34px;
    }
    .branch-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sem-strip {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .sem-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .subjects-grid,
    .featured-list,
    .m-footer-grid {
        grid-template-columns: 1fr;
    }
    .article-main {
        padding: 20px 16px;
    }
    .prac-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .featured-prac-card {
        flex-direction: column;
        align-items: flex-start;
    }
}
