@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,600;0,700;0,800;1,400&family=DM+Mono:ital,wght@0,400;0,500;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

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

/* ─── Light theme (default) ──────────────────────────── */
:root {
    --bg-sidebar:       #0d1117;
    --bg-main:          #faf8f4;
    --bg-card:          #ffffff;
    --bg-block-header:  #fdfcf9;
    --bg-reflection:    #fdfcfa;
    --bg-hover-subtle:  rgba(0,0,0,0.04);
    --bg-mastery-hover: #f5f3ee;
    --bg-phase-goal:    rgba(0, 232, 143, 0.04);

    --text-dark:           #1a1814;
    --text-mid:            #4a4540;
    --text-muted:          #8a857d;
    --text-sidebar:        #cdd9e5;
    --text-sidebar-muted:  #768390;

    --accent:       #00e88f;
    --accent-light: #00b870;

    --clr-learning:       #5a5aff;
    --clr-learning-bg:    #f0f0ff;
    --clr-leetcode:       #db2777;
    --clr-leetcode-bg:    #fdf2f8;
    --clr-hackerrank:     #047857;
    --clr-hackerrank-bg:  #ecfdf5;
    --clr-review:         #b45309;
    --clr-review-bg:      #fffbeb;

    --border:         #e8e3db;
    --border-sidebar: #1e2630;
    --card-hover-border: #cfc9c0;

    --diff-easy-bg:   #d1fae5; --diff-easy-text:   #065f46;
    --diff-medium-bg: #fef3c7; --diff-medium-text:  #92400e;
    --diff-hard-bg:   #fee2e2; --diff-hard-text:    #991b1b;

    --font-display: 'JetBrains Mono', 'Fira Code', monospace;
    --font-mono:    'DM Mono', 'Courier New', monospace;
    --font-body:    'DM Sans', system-ui, sans-serif;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.05);
}

/* ─── Dark theme ─────────────────────────────────────── */
[data-theme="dark"] {
    --bg-main:          #0d1117;
    --bg-card:          #161b22;
    --bg-block-header:  #1c2128;
    --bg-reflection:    #1c2128;
    --bg-hover-subtle:  rgba(255,255,255,0.05);
    --bg-mastery-hover: rgba(255,255,255,0.05);
    --bg-phase-goal:    rgba(0, 232, 143, 0.08);

    --text-dark:  #e6edf3;
    --text-mid:   #b1bac4;
    --text-muted: #6e7681;

    --clr-learning:       #7c7cff;
    --clr-learning-bg:    rgba(90, 90, 255, 0.12);
    --clr-leetcode:       #f472b6;
    --clr-leetcode-bg:    rgba(236, 72, 153, 0.12);
    --clr-hackerrank:     #34d399;
    --clr-hackerrank-bg:  rgba(52, 211, 153, 0.12);
    --clr-review:         #fbbf24;
    --clr-review-bg:      rgba(251, 191, 36, 0.12);

    --border:            #30363d;
    --card-hover-border: #444c56;

    --diff-easy-bg:   rgba(52,211,153,0.14);  --diff-easy-text:   #34d399;
    --diff-medium-bg: rgba(251,191,36,0.14);  --diff-medium-text: #fbbf24;
    --diff-hard-bg:   rgba(248,113,113,0.14); --diff-hard-text:   #f87171;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4),  0 1px 2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.4);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ─── Shared Navbar (adamcoding.com) ────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid #1e1e2e;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e2e2ea;
    text-decoration: none;
}

.logo-bracket { color: #5a5a6e; }
.logo-accent { color: #00e88f; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    color: #9898a8;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    color: #00e88f;
    background: rgba(0, 232, 143, 0.15);
}

.dark-mode-btn {
    background: none;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.dark-mode-btn:hover {
    border-color: #00e88f;
    background: rgba(0, 232, 143, 0.15);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-hamburger span {
    width: 24px;
    height: 2px;
    background: #9898a8;
    transition: all 0.2s ease;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 16px 24px;
    background: #12121a;
    border-bottom: 1px solid #2a2a3a;
}

.mobile-menu .nav-link { padding: 10px 0; }

.mobile-menu.open { display: flex; }

.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #16161e;
    border: 1px solid #00e88f;
    color: #00e88f;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    padding: 14px 28px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 232, 143, 0.15);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Header ─────────────────────────────────────────── */
header {
    background-color: var(--bg-sidebar);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-sidebar);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-content h1 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    font-style: normal;
    color: #00e88f;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.progress-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 420px;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background-color: #21262d;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-light);
    white-space: nowrap;
    font-weight: 500;
    flex-shrink: 0;
}

/* ─── Timeline Info ──────────────────────────────────── */
.timeline-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.timeline-dates {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-sidebar-muted);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.timeline-projected {
    color: var(--text-sidebar);
    font-weight: 500;
}

.timeline-delay {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.15em 0.5em;
    border-radius: 3px;
    white-space: nowrap;
}

.timeline-delay.delay-none {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
}

.timeline-delay.delay-yellow {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.18);
}

.timeline-delay.delay-red {
    color: #f87171;
    background: rgba(248, 113, 113, 0.18);
}

.timeline-on-track {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.15em 0.5em;
    border-radius: 3px;
    white-space: nowrap;
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
}

/* ─── Theme Toggle ───────────────────────────────────── */
.theme-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
    user-select: none;
}

.theme-switch-icons {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
}

.theme-icon {
    color: var(--text-sidebar-muted);
    line-height: 1;
    transition: color 0.2s;
}

.theme-switch input[type="checkbox"] {
    display: none;
}

.theme-switch-track {
    width: 36px;
    height: 20px;
    background-color: #21262d;
    border-radius: 10px;
    border: 1px solid #30363d;
    position: relative;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background-color: var(--text-sidebar-muted);
    border-radius: 50%;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.theme-switch input:checked + .theme-switch-track {
    background-color: rgba(0, 232, 143, 0.25);
    border-color: rgba(0, 232, 143, 0.4);
}

.theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
    transform: translateX(16px);
    background-color: var(--accent-light);
}

/* ─── Search Form (header) ───────────────────────────── */
.search-form {
    display: flex;
    align-items: center;
    background-color: #161b22;
    border: 1px solid var(--border-sidebar);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s ease;
    flex-shrink: 0;
}

.search-form:focus-within {
    border-color: rgba(0, 232, 143, 0.5);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    padding: 0.45rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-sidebar);
    width: 200px;
    transition: width 0.2s ease;
}

.search-input::placeholder { color: var(--text-sidebar-muted); }
.search-input:focus { width: 260px; }
.search-input::-webkit-search-cancel-button { display: none; }

.search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.45rem 0.625rem;
    color: var(--text-sidebar-muted);
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.search-btn:hover { color: var(--accent-light); }

/* ─── Layout ─────────────────────────────────────────── */
.layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────── */
.sidebar {
    width: 258px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-sidebar);
    overflow-y: auto;
    padding: 1.25rem 0.875rem;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #21262d; border-radius: 2px; }

.phase-nav { display: flex; flex-direction: column; gap: 0.125rem; }
.phase-group { margin-bottom: 0.375rem; }

.phase-btn {
    width: 100%;
    padding: 0.55rem 0.875rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-sidebar-muted);
    transition: all 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.phase-btn:hover {
    background-color: #161b22;
    color: var(--text-sidebar);
    border-color: var(--border-sidebar);
}

.phase-btn.active {
    background-color: rgba(232, 89, 12, 0.14);
    color: var(--accent-light);
    border-color: rgba(232, 89, 12, 0.28);
}

.toggle { transition: transform 0.2s ease; font-size: 0.6em; opacity: 0.5; }
.phase-group.active .toggle { transform: rotate(180deg); }

.weeks-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0.5rem;
    margin-top: 0.2rem;
}
.weeks-list.show { max-height: 800px; }

.week-link {
    display: block;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.1rem;
    color: var(--text-sidebar-muted);
    text-decoration: none;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    line-height: 1.4;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}

.week-link:hover {
    background-color: #161b22;
    color: var(--text-sidebar);
    border-left-color: #30363d;
}

.week-link.active {
    background-color: rgba(232, 89, 12, 0.1);
    color: var(--accent-light);
    border-left-color: var(--accent);
    font-weight: 500;
}

/* ─── Main Content ───────────────────────────────────── */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem 3rem;
    background-color: var(--bg-main);
    transition: background-color 0.25s ease;
}

.main-content::-webkit-scrollbar { width: 5px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Phase View ─────────────────────────────────────── */
.phase-view { max-width: 960px; margin: 0 auto; }

.phase-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.phase-header h2 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.phase-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.phase-goal {
    font-size: 1rem;
    color: var(--text-mid);
    border-left: 3px solid var(--accent);
    padding: 0.625rem 1rem;
    border-radius: 0 4px 4px 0;
    font-style: italic;
    background-color: var(--bg-phase-goal);
}

/* ─── Weeks Grid ─────────────────────────────────────── */
.weeks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.week-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.week-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.week-card:hover {
    border-color: var(--card-hover-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.week-card:hover::before { transform: scaleX(1); }

.week-card-link { display: block; padding: 1.375rem; text-decoration: none; color: inherit; }

.week-card h3 {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.week-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.week-date {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ─── Mastery Section ────────────────────────────────── */
.mastery-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.25s ease;
}

.mastery-section h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.mastery-list { display: flex; flex-direction: column; gap: 0.25rem; }

.mastery-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.625rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background-color 0.12s ease;
}

.mastery-item:hover { background-color: var(--bg-mastery-hover); }

.mastery-item input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ─── Week View ──────────────────────────────────────── */
.week-view { max-width: 860px; margin: 0 auto; }

.week-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.week-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--text-dark);
    margin-bottom: 0.625rem;
}

.week-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* ─── Day Blocks ─────────────────────────────────────── */
.day-blocks { display: flex; flex-direction: column; gap: 1.75rem; }

.day-block {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: blockIn 0.35s ease both;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

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

.day-block:nth-child(1) { animation-delay: 0.04s; }
.day-block:nth-child(2) { animation-delay: 0.09s; }
.day-block:nth-child(3) { animation-delay: 0.14s; }
.day-block:nth-child(4) { animation-delay: 0.19s; }
.day-block:nth-child(5) { animation-delay: 0.24s; }

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.125rem 1.5rem;
    background-color: var(--bg-block-header);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.25s ease;
}

.block-header h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-dark);
}

.block-time {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    flex-shrink: 0;
    transition: background-color 0.25s ease;
}

/* ─── Items by Type ──────────────────────────────────── */
.items-by-type {
    padding: 1.125rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.items-section {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid;
    transition: background-color 0.25s ease;
}

.items-section h4 {
    font-family: var(--font-mono);
    font-size: 0.63rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.45rem 0.875rem;
    border-bottom: 1px solid;
}

.items-section .checklist { padding: 0.5rem 0.5rem 0.625rem; }

.learning-section   { border-color: rgba(90,90,255,0.18); background-color: var(--clr-learning-bg); }
.learning-section h4 { color: var(--clr-learning); background-color: rgba(90,90,255,0.06); border-bottom-color: rgba(90,90,255,0.12); }
[data-theme="dark"] .learning-section h4 { background-color: rgba(90,90,255,0.08); }

.leetcode-section   { border-color: rgba(219,39,119,0.18); background-color: var(--clr-leetcode-bg); }
.leetcode-section h4 { color: var(--clr-leetcode); background-color: rgba(219,39,119,0.06); border-bottom-color: rgba(219,39,119,0.12); }
[data-theme="dark"] .leetcode-section h4 { background-color: rgba(236,72,153,0.08); }

.hackerrank-section { border-color: rgba(4,120,87,0.18); background-color: var(--clr-hackerrank-bg); }
.hackerrank-section h4 { color: var(--clr-hackerrank); background-color: rgba(4,120,87,0.06); border-bottom-color: rgba(4,120,87,0.12); }
[data-theme="dark"] .hackerrank-section h4 { background-color: rgba(52,211,153,0.08); }

.review-section     { border-color: rgba(180,83,9,0.18); background-color: var(--clr-review-bg); }
.review-section h4  { color: var(--clr-review); background-color: rgba(180,83,9,0.06); border-bottom-color: rgba(180,83,9,0.12); }
[data-theme="dark"] .review-section h4 { background-color: rgba(251,191,36,0.08); }

/* ─── Checklist ──────────────────────────────────────── */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 0.1rem; }

.checklist-item { display: flex; align-items: flex-start; }

.checklist-item label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    flex: 1;
    padding: 0.375rem;
    border-radius: 4px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-dark);
    transition: background-color 0.12s ease;
}

.checklist-item:hover label { background-color: var(--bg-hover-subtle); }

.checklist-item input[type="checkbox"] {
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 3px;
    width: 14px;
    height: 14px;
}

.learning-section   .checklist-item input[type="checkbox"] { accent-color: var(--clr-learning); }
.leetcode-section   .checklist-item input[type="checkbox"] { accent-color: var(--clr-leetcode); }
.hackerrank-section .checklist-item input[type="checkbox"] { accent-color: var(--clr-hackerrank); }
.review-section     .checklist-item input[type="checkbox"] { accent-color: var(--clr-review); }

.checklist-item a {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.2s ease;
}
.checklist-item a:hover { background-size: 100% 1px; }

.checklist-item input[type="checkbox"]:checked ~ span,
.checklist-item input[type="checkbox"]:checked ~ a {
    text-decoration: line-through;
    opacity: 0.4;
}

/* ─── Difficulty Badges ──────────────────────────────── */
.difficulty {
    display: inline-block;
    padding: 0.12em 0.5em;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-left: 0.375rem;
    align-self: center;
}

.difficulty.easy   { background-color: var(--diff-easy-bg);   color: var(--diff-easy-text); }
.difficulty.medium { background-color: var(--diff-medium-bg); color: var(--diff-medium-text); }
.difficulty.hard   { background-color: var(--diff-hard-bg);   color: var(--diff-hard-text); }

/* ─── Reflection Section ─────────────────────────────── */
.reflection-section {
    padding: 1.125rem 1.5rem 1.375rem;
    border-top: 1px solid var(--border);
    background-color: var(--bg-reflection);
    transition: background-color 0.25s ease;
}

.reflection-section > label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.63rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.625rem;
}

.reflection-textarea {
    width: 100%;
    min-height: 96px;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-dark);
    background-color: var(--bg-card);
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.25s ease;
    line-height: 1.6;
}

.reflection-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 232, 143, 0.12);
}

.reflection-textarea::placeholder { color: var(--text-muted); font-style: italic; }

.save-status {
    display: block;
    margin-top: 0.375rem;
    font-family: var(--font-mono);
    font-size: 0.67rem;
    letter-spacing: 0.07em;
    color: transparent;
    height: 1em;
    transition: color 0.2s;
}
.save-status.saving { color: #d97706; }
.save-status.saved  { color: #059669; }

/* ─── Search Results Page ────────────────────────────── */
.search-view { max-width: 760px; margin: 0 auto; }

.search-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.search-header h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-dark);
}

.search-header h2 em { color: var(--accent); font-style: italic; }

.search-hint  { margin-top: 0.5rem; color: var(--text-muted); font-size: 0.9rem; }
.search-empty { color: var(--text-muted); font-size: 0.95rem; }
.search-empty em { color: var(--text-mid); font-style: italic; }

.search-results { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.15s ease;
    overflow: hidden;
}

.search-result-item:hover {
    border-color: var(--card-hover-border);
    box-shadow: var(--shadow-lg);
    transform: translateX(3px);
}

.result-link {
    flex: 1;
    padding: 0.875rem 1.125rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.result-main { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.result-label { font-size: 0.92rem; font-weight: 500; color: var(--text-dark); }

.result-meta { display: flex; align-items: center; gap: 0.625rem; }

.result-type {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.15em 0.5em;
    border-radius: 3px;
    font-weight: 500;
}

.result-type.learning   { background: var(--clr-learning-bg);   color: var(--clr-learning); }
.result-type.leetcode   { background: var(--clr-leetcode-bg);   color: var(--clr-leetcode); }
.result-type.hackerrank { background: var(--clr-hackerrank-bg); color: var(--clr-hackerrank); }
.result-type.review     { background: var(--clr-review-bg);     color: var(--clr-review); }

.result-breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.result-checked {
    color: #059669;
    font-size: 0.85rem;
    font-weight: 700;
    padding-right: 1.125rem;
    flex-shrink: 0;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar { width: 220px; }
    .main-content { padding: 1.5rem; }
    .week-header h2, .phase-header h2 { font-size: 1.8rem; }
}

@media (max-width: 640px) {
    .sidebar { display: none; }
    .main-content { padding: 1.25rem; }
    .search-input { width: 140px; }
    .search-input:focus { width: 160px; }
    .timeline-info { display: none; }
}
