/* ==========================================================================
   GATE CS Syllabus & Topic Tracker - Stylesheet
   VN Labs Dark Theme Aesthetics
   ========================================================================== */

:root {
    --bg-dark: #07090E;
    --card-bg: rgba(18, 22, 34, 0.7);
    --card-bg-hover: rgba(26, 32, 50, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-active: rgba(0, 229, 255, 0.4);
    --cyan-glow: #00E5FF;
    --purple-glow: #B388FF;
    --accent-green: #10B981;
    --accent-amber: #F59E0B;
    --accent-rose: #F43F5E;
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--bg-dark);
    font-family: var(--font-sans);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Navigation Extensions ───────────────────────────────────────────────── */
.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-badge {
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--cyan-glow);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-danger {
    background: rgba(244, 63, 94, 0.12);
    color: #F87171;
    border: 1px solid rgba(244, 63, 94, 0.25);
}
.btn-danger:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #F87171;
}

/* ─── Main Container ──────────────────────────────────────────────────────── */
.syllabus-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px 80px 20px;
}

/* ─── Hero Section ────────────────────────────────────────────────────────── */
.syllabus-hero {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
}

.hero-top-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    background: var(--cyan-glow);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--cyan-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.syllabus-hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0 0 10px 0;
    letter-spacing: -0.03em;
}

.syllabus-hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto 24px auto;
    line-height: 1.5;
}

/* ─── Search Bar ──────────────────────────────────────────────────────────── */
.search-wrap {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 0 18px;
    transition: all 0.25s ease;
}

.search-wrap:focus-within {
    border-color: var(--cyan-glow);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

.search-wrap svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    color: #FFF;
    font-size: 0.98rem;
    font-family: inherit;
    padding: 14px 12px;
    outline: none;
}

.search-wrap input::placeholder {
    color: var(--text-muted);
}

.search-kbd {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 8px;
    border-radius: 6px;
    user-select: none;
}

.clear-search-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.clear-search-btn:hover {
    color: #FFF;
}

/* ─── Overall Progress Card ───────────────────────────────────────────────── */
.progress-hero-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 24px 28px;
    backdrop-filter: blur(16px);
    margin-bottom: 28px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    transition: all 0.3s ease;
}

.progress-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.progress-title-block h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: #FFF;
    letter-spacing: 0.2px;
}

.progress-title-block p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

.progress-percentage {
    font-size: 2.4rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--cyan-glow);
    line-height: 1;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.progress-track {
    width: 100%;
    height: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00E5FF, #B388FF);
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.6);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    font-size: 1.3rem;
}

.stat-val {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #FFF;
}

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.filter-chips-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFF;
}

.filter-chip.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--cyan-glow);
    color: var(--cyan-glow);
}

/* ─── Workspace Split Layout ─────────────────────────────────────────────── */
.workspace-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

/* ─── Left Sidebar: Subjects List ────────────────────────────────────────── */
.subjects-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.subjects-sidebar::-webkit-scrollbar {
    width: 6px;
}
.subjects-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cyan-glow);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.badge-total {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.subject-item-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.subject-item-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #FFF;
}

.subject-item-btn.active {
    background: rgba(0, 229, 255, 0.1);
    border-color: rgba(0, 229, 255, 0.35);
    color: #FFF;
}

.subject-item-btn.active .subject-item-title {
    color: var(--cyan-glow);
    font-weight: 700;
}

.subject-item-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.subject-item-info {
    flex: 1;
    min-width: 0;
}

.subject-item-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subject-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Circular SVG Progress Ring */
.progress-ring-wrap {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.progress-ring-fill {
    stroke: var(--cyan-glow);
    transition: stroke-dashoffset 0.4s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-secondary);
}

.subject-item-btn.active .progress-ring-text {
    color: #FFF;
}

/* ─── Right Panel: Chapters Checklist ─────────────────────────────────────── */
.chapters-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(12px);
    min-height: 480px;
}

.chapters-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.subject-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.subject-icon-large {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chapters-panel-header h2 {
    font-size: 1.45rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: #FFF;
}

.chapters-panel-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

/* ─── Chapters List ───────────────────────────────────────────────────────── */
.chapters-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-tile {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

.chapter-tile:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.chapter-tile.completed {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.25);
}

.chapter-checkbox-wrap {
    margin-right: 14px;
    position: relative;
}

.chapter-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chapter-tile.completed .chapter-checkbox {
    background: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.chapter-checkbox svg {
    color: #FFF;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-tile.completed .chapter-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.chapter-text-wrap {
    flex: 1;
    min-width: 0;
}

.chapter-name {
    font-size: 0.98rem;
    font-weight: 600;
    color: #FFF;
    margin: 0;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.chapter-tile.completed .chapter-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.chapter-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.badge-important {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #FBBF24;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-done {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.chapter-tile.completed .badge-done {
    opacity: 1;
    transform: scale(1);
}

/* ─── Search Results Panel ────────────────────────────────────────────────── */
.search-results-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.search-results-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--cyan-glow);
}

.search-subject-tag {
    font-size: 0.75rem;
    color: var(--cyan-glow);
    font-weight: 600;
    margin-bottom: 2px;
}

/* ─── Modals ──────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-card {
    background: #0E121E;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    width: 100%;
    max-width: 540px;
    padding: 24px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.wide-modal {
    max-width: 860px;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
}

.modal-title-wrap h3 {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFF;
}

.modal-title-wrap p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.modal-close:hover {
    color: #FFF;
}

.modal-sub-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ─── Flutter-style Mode Toggle Bar ────────────────────────────────────────── */
.mode-toggle-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 12px;
}

.mode-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-tab:hover {
    color: #FFF;
}

.mode-tab.active {
    background: #1E293B;
    color: #FFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── Subject Completion Legend ────────────────────────────────────────────── */
.weightage-legend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.legend-pill-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.completion-pill {
    height: 22px;
    width: 72px;
    border-radius: 100px;
    border: 1.5px solid rgba(52, 199, 89, 0.4);
    background: transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.completion-pill.zero {
    border-color: rgba(239, 68, 68, 0.4);
}

.completion-pill-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(52, 199, 89, 0.25);
    border-radius: 100px;
    transition: width 0.3s ease;
}

.completion-pill.zero .completion-pill-fill {
    background: rgba(239, 68, 68, 0.25);
}

.completion-pill-text {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 800;
    color: #34C759;
    font-family: var(--font-mono);
}

.completion-pill.zero .completion-pill-text {
    color: #EF4444;
}

.legend-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ─── Subject Weightage Cards Grid (_SubjectWeightageCard) ─────────────────── */
.weightage-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.subject-weightage-card {
    background: #141A28;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.subject-weightage-card:hover {
    background: #1B2335;
    border-color: rgba(0, 229, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.card-subject-name {
    font-size: 1rem;
    font-weight: 700;
    color: #FFF;
    margin: 0 0 14px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-body-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 12px;
}

.card-body-row.alltime-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.card-stats-col {
    display: flex;
    flex-direction: column;
}

.card-avg-number {
    font-size: 1.85rem;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 4px;
}

.card-avg-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.card-volatility {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ─── Mini Animated Trend Bars (_AnimatedTrendBars) ────────────────────────── */
.mini-trend-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-bottom: 2px;
}

.alltime-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
}

.alltime-scroll-wrapper::-webkit-scrollbar {
    height: 4px;
}

.alltime-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.trend-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.trend-bar-year {
    font-size: 9px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-muted);
}

.trend-bar-track {
    width: 14px;
    height: 52px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.trend-bar-track.skinny {
    width: 8px;
}

.trend-bar-fill {
    width: 100%;
    border-radius: 6px;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-footer-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─── Detailed Graph Popup Modal (_WeightageGraphPopup) ───────────────────── */
.graph-popup-card {
    max-width: 680px;
    padding: 24px 28px;
}

.graph-scroll-container {
    width: 100%;
    overflow-x: auto;
    padding: 20px 8px 12px 8px;
}

.graph-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.graph-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.graph-bars-wrap {
    display: flex;
    align-items: flex-end;
    min-height: 220px;
    gap: 16px;
    padding: 0 10px;
}

.graph-bars-wrap.dense {
    gap: 10px;
}

.popup-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.popup-bar-val {
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 800;
    margin-bottom: 6px;
}

.popup-bar-pillar {
    width: 24px;
    border-radius: 8px 8px 0 0;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.85;
}

.popup-bar-pillar.dense {
    width: 12px;
}

.popup-bar-pillar:hover {
    opacity: 1;
    filter: brightness(1.2);
}

.popup-bar-year {
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 10px;
}


/* Backup Modal Content */
.backup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.custom-file-upload {
    cursor: pointer;
    text-align: center;
}

.backup-tip {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1E293B;
    border: 1px solid var(--cyan-glow);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    color: #FFF;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10000;
    animation: toastSlide 0.3s ease;
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* ─── Responsive Navigation Labels ────────────────────────────────────────── */
.btn-label-short {
    display: none;
}

.stat-info-stack {
    display: flex;
    flex-direction: column;
}

/* ─── Responsive Media Queries ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .syllabus-container {
        padding: 16px 14px 60px 14px;
    }

    .workspace-layout {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    /* Sticky Horizontal Subjects Ribbon on Mobile/Tablet */
    .subjects-sidebar {
        position: sticky;
        top: 60px;
        z-index: 50;
        background: rgba(11, 15, 26, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 16px;
        padding: 8px 10px;
        max-height: none;
        overflow: visible;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }

    .sidebar-header {
        display: none;
    }

    .subjects-nav-list {
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        padding: 2px 2px 4px 2px;
    }

    .subjects-nav-list::-webkit-scrollbar {
        height: 3px;
    }
    .subjects-nav-list::-webkit-scrollbar-thumb {
        background: rgba(0, 229, 255, 0.3);
        border-radius: 3px;
    }

    .subject-item-btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
        min-width: 150px;
        max-width: 200px;
        padding: 8px 12px;
        margin-bottom: 0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .subject-item-btn.active {
        background: rgba(0, 229, 255, 0.12);
        border-color: var(--cyan-glow);
        box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
    }

    .subject-item-title {
        font-size: 0.85rem;
    }

    .subject-item-meta {
        font-size: 0.72rem;
    }

    .chapters-panel {
        padding: 18px 16px;
        border-radius: 18px;
    }

    .chapters-panel-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 14px;
        margin-bottom: 16px;
    }

    .chapters-panel-header h2 {
        font-size: 1.25rem;
    }

    .subject-icon-large {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
        border-radius: 12px;
    }
}

@media (max-width: 640px) {
    /* Nav bar on phones */
    .standard-nav {
        padding: 10px 14px;
    }

    .nav-left {
        gap: 8px;
    }

    .nav-badge {
        font-size: 0.68rem;
        padding: 3px 7px;
    }

    .btn-label-full {
        display: none;
    }
    .btn-label-short {
        display: inline;
    }

    .nav-btn-group {
        gap: 6px;
    }

    .nav-btn-group .btn {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    /* Hero */
    .syllabus-hero {
        margin-bottom: 20px;
    }

    .syllabus-hero h1 {
        font-size: 1.65rem;
        letter-spacing: -0.02em;
    }

    .syllabus-hero p {
        font-size: 0.9rem;
        margin-bottom: 18px;
        padding: 0 4px;
    }

    .search-kbd {
        display: none; /* Mobile virtual keyboards don't have Ctrl K */
    }

    .search-wrap {
        padding: 0 14px;
    }

    .search-wrap input {
        font-size: 0.9rem;
        padding: 12px 8px;
    }

    /* Progress Hero Card */
    .progress-hero-card {
        padding: 18px 14px;
        border-radius: 18px;
        margin-bottom: 18px;
    }

    .progress-title-block h2 {
        font-size: 1.05rem;
    }

    .progress-title-block p {
        font-size: 0.8rem;
    }

    .progress-percentage {
        font-size: 1.9rem;
    }

    .progress-track {
        height: 10px;
        margin-bottom: 14px;
    }

    /* 3-column compact stat pills */
    .stats-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-bottom: 14px;
    }

    .stat-pill {
        padding: 8px 6px;
        border-radius: 10px;
        gap: 6px;
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }

    .stat-icon {
        font-size: 1.15rem;
    }

    .stat-val {
        font-size: 0.95rem;
    }

    .stat-lbl {
        font-size: 0.68rem;
        margin-left: 0;
        white-space: nowrap;
    }

    /* Horizontal scroll filter chips */
    .filter-chips-row {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
    }
    .filter-chips-row::-webkit-scrollbar {
        display: none;
    }

    .filter-chip {
        flex-shrink: 0;
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    /* Chapter Items */
    .chapter-tile {
        padding: 12px 12px;
        border-radius: 12px;
        gap: 8px;
    }

    .chapter-checkbox-wrap {
        margin-right: 8px;
    }

    .chapter-checkbox {
        width: 22px;
        height: 22px;
    }

    .chapter-name {
        font-size: 0.88rem;
        line-height: 1.3;
    }

    .chapter-badges {
        margin-left: 6px;
        gap: 4px;
    }

    .badge-important {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .badge-done {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    /* Modals on Phone */
    .modal-overlay {
        padding: 10px;
    }

    .modal-card {
        padding: 18px 14px;
        border-radius: 18px;
        max-height: 90vh;
    }

    .modal-title-wrap h3 {
        font-size: 1.1rem;
    }

    .mode-tab {
        padding: 7px 6px;
        font-size: 0.78rem;
    }

    .weightage-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .subject-weightage-card {
        padding: 14px 14px;
        border-radius: 16px;
    }

    .card-avg-number {
        font-size: 1.6rem;
    }

    .graph-popup-card {
        padding: 18px 14px;
    }

    .graph-bars-wrap {
        min-height: 190px;
        gap: 12px;
    }

    .popup-bar-pillar {
        width: 18px;
    }
    .popup-bar-pillar.dense {
        width: 10px;
    }

    .popup-bar-val {
        font-size: 11px;
    }

    .popup-bar-year {
        font-size: 10px;
    }
}

@media (max-width: 380px) {
    .nav-badge {
        display: none;
    }

    .syllabus-hero h1 {
        font-size: 1.45rem;
    }

    .progress-percentage {
        font-size: 1.65rem;
    }

    .stats-row {
        gap: 4px;
    }

    .stat-pill {
        padding: 6px 4px;
    }
}

