:root {
    /* --- GLOBAL VARIABLES (Light Mode / Default) --- */
    --primary-color: #2563eb;
    --primary-hover: #175bed;
    --primary-shadow: rgba(37, 99, 235, 0.4);
    --page-title: #1e293b;
    --logo-title: #F8FAFC;
    --card-title: #2c3037;
    --progress-info: #2c3037;
    --time: #1e293b;
    --timer-label: #1e293b;

    /* Backgrounds */
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #0F172A;
    --bg-input: #FFFFFF;
    --bg-stat-box: #dfeefb;
    /* For the timer stats */

    /* Text Colors */
    --text-main: #1E293B;
    --text-secondary: #475569;
    --text-muted: #7b8faa;
    --text-white: #FFFFFF;

    /* Borders & Lines */
    --border-color: #F1F5F9;
    --border-strong: #cbd5e1;

    /* Shadows */
    --shadow-card: 5px 5px 10px 2px rgba(0, 0, 0, 0.08);
}

/* --- DARK MODE OVERRIDES --- */
[data-theme="dark"] {
    /* Backgrounds */
    --bg-body: #0f172a;
    /* Dark Blue/Slate */
    --bg-card: #1e293b;
    /* Lighter Slate for cards */
    --bg-sidebar: #020617;
    /* Very Dark for sidebar */
    --bg-stat-box: #bac1ca;

    /* Text Colors */
    --page-title: #F8FAFC;
    /* --text-secondary: #F8FAFC; */
    --text-muted: #94a3b8;
    --progress-info: #e0edfa;
    --time: #F8FAFC;
    --timer-label: #F8FAFC;

    /* Borders */
    --border-color: #334155;
    --border-strong: #475569;

    /* Shadows - made darker and more subtle */
    --shadow-card: 5px 5px 10px 2px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

main.content section {
    display: none;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.app {
    display: flex;
    min-height: 100vh;
}

.stat-card,
.subject-card,
.task-card,
.note-card,
.progress-card,
.popup-card,
.settings-popup-card,
.add-note-popup-card,
.shortcuts-card,
.summary-card,
.timer-stats-card,
.theme-card,
.appearance-card,
.data-management-card,
.subject-wise-progress-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    color: var(--text-main);
}

input,
select,
textarea {
    background-color: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-strong);
}

.page-title,
.greeting,
.stat-value,
.subject-name {
    color: var(--page-title);
}

.stat-label,
.progress-title,
.stat-label,
.total-tasks {
    color: var(--text-secondary);
}

.progress-info {
    color: var(--progress-info);
}

.card-title {
    color: var(--card-title);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
}

.date,
.x-axis {
    color: var(--text-muted);
}

.sidebar {
    background-color: var(--bg-sidebar);
    /* Sidebar text is usually light even in light mode, so we keep it or use text-white */
}

.border {
    border-top: 1px solid var(--border-color);
    /* Note: Sidebar might need specific border color if it stays dark */
}

/* [data-theme="dark"] .content img {
    filter: brightness(0) invert(1); /* Turns black icons to white */


/* SideBar */
.sidebar {
    width: 240px;
    background-color: var(--bg-sidebar);
    color: rgb(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 20px;
    flex-shrink: 0;
}

.sidebar-header span {
    font-size: 22px;
    font-weight: 600;
    color: var(--logo-title);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* gap: 10px; */
    /* overflow-y: auto; */
}

.nav-menu {
    /* margin-bottom: 10px; */
    list-style: none;
    padding: 10px;
}

.nav-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 500;
    color: #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px var(--primary-shadow);
}

.border {
    border-top: 1px solid #1f2937;
    margin: 0px 16px;
}

.border.db {
    margin: 20px 0px;
    border-top: 2px solid var(--border-strong);
}

.sidebar-footer {
    margin-top: 8px;
    padding: 2px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    /* Circle */
    border: 2px solid var(--primary-color, #3b82f6);
    /* Blue border */
    object-fit: cover;
}

.user-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

#user-name {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    max-width: 80px;
    /* Limits width */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Adds '...' if name is too long */
}

.edit-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    transition: color 0.2s;
}

.edit-btn:hover {
    color: white;
}

.theme-toggle img {
    width: 30px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.theme-toggle img:hover {
    opacity: 1;
}

/* Initial State (Light Mode) */
.toggle {
    /* ... your existing styles ... */
    transition: transform 0.3s ease;
    left: 3px;
    transform: translateY(4%);
    /* Keep vertical alignment */
}

/* Active State (Dark Mode) - We will add the class 'active' via JS */
.backside.active .toggle {
    transform: translateX(26px) translateY(4%);
    /* Move circle to right */
    background-color: var(--primary-color);
    /* Optional: Make knob blue when active */
}

.backside.active {
    background-color: #334155;
    /* Darker track */
}

.nav-icon img {
    width: 20px;
}


/* DASHBOARD */
#dashboard {
    width: 75vw;
    margin: 30px 30px;
}

/* #dashboard.active {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
} */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: auto 1fr;
    gap: 14px;
}

.dashboard-header {
    grid-column: 1 / -1;
}

.area1 {
    display: flex;
    flex-direction: column;
    gap: 24px;
    grid-column: 1;
    grid-row: 2;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--page-title);
}

.greeting {
    font-size: 32px;
    font-weight: 700;
    color: var(--page-title);
    letter-spacing: -0.5px;
}

.date {
    font-size: 18px;
    color: var(--text-muted);
    margin-top: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
}

.stat-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-top: 8px;
    color: #0F172A;
}

.shortcuts-card {
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.shortcuts-grid {
    display: flex;
    gap: 20px;
}

.shortcuts-grid button {
    padding: 10px 26px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    color: white;
    background-color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    transition: transform 0.1s;
}

.shortcuts-grid button:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

button.secondary {
    border: 1px solid var(--primary-color);
    background-color: white;
    color: var(--primary-color);
}

button.secondary:hover {
    background-color: #F1F5F9;
}

/* Right Sidebar */
.area2 {
    grid-column: 2;
    grid-row: 2;
}

.right-sidebar {
    height: 100%;
    position: sticky;
    top: 24px;
}

.summary-card {
    padding: 20px;
    border-radius: 12px;
    background-color: white;
    box-shadow: var(--shadow-card);
}

.task-item {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
}

.task-title {
    font-size: 14px;
    font-weight: 600;
}

.task-subject {
    font-size: 12px;
    color: gray;
}

.chart-flex-container {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.y-axis-labels {
    position: relative;
    height: 130px;
    width: 30px;
}

.y-axis-labels span {
    position: absolute;
    width: 100%;
    text-align: right;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1;
    padding-right: 5px;
}

.y-axis-labels span:nth-child(1) {
    top: 0;
    transform: translateY(-50%);
}

.y-axis-labels span:nth-child(2) {
    top: 45%;
    transform: translateY(-50%);
}

.y-axis-labels span:nth-child(3) {
    bottom: 10%;
    transform: translateY(60%);
}

.right-chart {
    flex-grow: 1;
    width: 0;
}

.chart-widget {
    margin-top: 25px;
}

.chart-header {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.graph-area {
    position: relative;
    height: 120px;
    /* Fixed height is crucial here */
    width: 100%;
    margin-bottom: 10px;
}

.grid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #dbe8f6;
    z-index: 0;
}

.grid-line.top {
    top: 0;
}

.grid-line.mid {
    top: 50%;
}

.grid-line.bottom {
    bottom: 0;
}

svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: visible;
}

.x-axis {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 0 5px;
}

/* Chart Tooltip */
#chart-tooltip {
    position: absolute;
    background: #1e293b;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    /* Let mouse pass through */
    opacity: 0;
    transition: opacity 0.2s;
    transform: translate(-50%, -150%);
    /* Center above cursor */
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* The dots on the line */
.chart-dot {
    fill: var(--primary-color);
    stroke: white;
    stroke-width: 2px;
    r: 4;
    /* Radius */
    cursor: pointer;
    transition: r 0.2s;
}

.chart-dot:hover {
    r: 6;
    /* Grow on hover */
}

/* Subjects */
#subjects {
    width: 75vw;
    margin: 30px 30px;
}

.subjects-header {
    display: flex;
    justify-content: space-between;
}

.add-subject-btn {
    padding: 15px 26px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 500;
    border: none;
    color: white;
    background-color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px var(--primary-shadow);
    transition: transform 0.1s;
}

.add-subject-btn:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.card-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 50px;
    gap: 20px;
}

.subject-card {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
    position: relative;
}

.color-strip {
    width: 8px;
    height: 120px;
    background: var(--bg);
    border-radius: 50px 50px;
}

/* 2. Map the colors (Copying your existing gradients to work on the strip) */
.color-strip.blue {
    --bg: linear-gradient(135deg, #60A5FA, #2563EB);
}

.color-strip.red {
    --bg: linear-gradient(135deg, #F87171, #DC2626);
}

.color-strip.green {
    --bg: linear-gradient(135deg, #4ADE80, #16A34A);
}

.color-strip.orange {
    --bg: linear-gradient(135deg, #FB923C, #EA580C);
}

.color-strip.purple {
    --bg: linear-gradient(135deg, #A78BFA, #7C3AED);
}

.color-strip.yellow {
    --bg: linear-gradient(135deg, #FACC15, #CA8A04);
}

.color-strip.sky {
    --bg: linear-gradient(135deg, #38BDF8, #0284C7);
}

.subject-card .content {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    margin-top: 30px;
}

.subject-name {
    font-size: 24px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
}

.time-studied {
    font-size: 18px;
    font-weight: 600;
    margin-top: 8px;
    color: var(--text-secondary);
}

.action-area {
    display: flex;
    gap: 10px;
    position: absolute;
    top: 20px;
    right: 20px;
}

.action-area img {
    height: 25px;
    width: 25px;
    cursor: pointer;
}

.popup-card {
    display: none;
    position: absolute;
    top: 100px;
    right: 70px;
    /* display: flex; */
    flex-direction: column;
    width: 300px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
}

.popup-card-header {
    font-size: 14px;
}

.subject-name-title h3 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 10px;
}

.subject-name-title input {
    border-radius: 12px;
    border: none;
    border: 1px solid var(--text-muted);
    padding: 8px 10px;
    width: 100%;
}

.colors {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 270px;
    padding: 4px;
}

.popup-card h4 {
    font-size: 14px;
    font-weight: 600;
}

.color {
    height: 40px;
    width: 40px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    background: var(--bg);
}

.color:hover {
    transform: translateY(-2px);
}

.color.selected {
    box-shadow: 0 0 0 3px white, 0 0 0 6px var(--shadow);
}

.blue {
    --bg: linear-gradient(135deg, #60A5FA, #2563EB);
    --shadow: #2563EB;
}

.red {
    --bg: linear-gradient(135deg, #F87171, #DC2626);
    --shadow: #DC2626;
}

.green {
    --bg: linear-gradient(135deg, #4ADE80, #16A34A);
    --shadow: #16A34A;
}

.orange {
    --bg: linear-gradient(135deg, #FB923C, #EA580C);
    --shadow: #EA580C;
}

.purple {
    --bg: linear-gradient(135deg, #A78BFA, #7C3AED);
    --shadow: #7C3AED;
}

.yellow {
    --bg: linear-gradient(135deg, #FACC15, #CA8A04);
    --shadow: #CA8A04;
}

.sky {
    --bg: linear-gradient(135deg, #56cbfd, #1da1e3);
    --shadow: #0284C7;
}

.popup-card .buttons {
    display: flex;
    justify-content: space-between;
}

.popup-card button {
    padding: 8px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 500;
    width: 120px;
    border: none;
    color: white;
    background-color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    transition: transform 0.1s;
}

.buttons .cancel-btn {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.popup-card button:hover {
    transform: translateY(-1px);
    filter: brightness(0.9);
}

.buttons .cancel-btn:hover {
    background-color: #F1F5F9;
}

/* Tasks */
#tasks {
    width: 75vw;
    margin: 30px 30px;
}

.task-buttons {
    margin: 30px 0;
    display: flex;
    justify-content: space-between;
}

.add-task-btn {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 500;
    border: none;
    color: white;
    background-color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px var(--primary-shadow);
    transition: transform 0.1s;
}

.add-task-btn:hover {
    transform: translateY(-1px);
    filter: brightness(0.9);
}

.dropdowns {
    display: flex;
    gap: 12px;
}

.dropdowns select {
    appearance: none;

    background-image: url(svgIcons/down-arrow.svg);
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 22px;

    width: 180px;
    padding: 0 40px 0 12px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 400;
    border: 1px solid var(--border-color);
    color: black;
    background-color: white;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    transition: transform 0.1s;
}

.progress-info {
    font-size: 16px;
    font-weight: 500;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.progress-parent {
    width: 100%;
    height: 23px;
    border-radius: 50px 50px;
    background-color: #bfd2fb;
}

.progress-child {
    width: 50%;
    height: 23px;
    border-radius: 50px 50px;
    background-color: var(--primary-color);
}

.tasks-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.task-card {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
}

.first-row {
    display: flex;
    justify-content: space-between;
}

.left {
    display: flex;
    gap: 10px;
}

.task-name {
    font-size: 20px;
}

.delete-btn img {
    width: 25px;
    cursor: pointer;
}

.delete-btn img:hover {
    transform: translateY(-1px);
}

.subject-badge {
    display: inline-block;
    background: var(--bg, #2563eb);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: white;
}

.second-row,
.third-row {
    margin-left: 35px;
}

.third-row {
    font-size: 14px;
    font-weight: 500;
}

.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 25px;
    height: 25px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    background-color: white;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

.custom-checkbox:hover {
    background-color: #f0f7ff;
}

.custom-checkbox:checked {
    background-color: var(--primary-color);

    background-image: url("svgIcons/tick.svg");
    background-size: 16px;
    background-repeat: no-repeat;
    background-position: center;
}

.add-task-popup {
    left: 350px;
    top: 150px;
}

.add-task-popup h3 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 10px;
}

.task-input input,
.subject-input select,
.due-date-info input {
    border-radius: 12px;
    border: none;
    border: 1px solid var(--text-muted);
    padding: 8px 10px;
    width: 100%;
}

.subject-input select {
    appearance: none;
    background-image: url(svgIcons/down-arrow.svg);
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 22px;
}

.buttons button {
    margin-top: 20px;
}

/* Timer */
#timer {
    width: 75vw;
    margin: 30px 28px;
}

.timer-area {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    max-width: 550px;
}

.timer-display {
    display: flex;
    justify-content: center;
    position: relative;
}

.circular-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    width: 250px;
    border-radius: 50%;
    border: 15px solid #60A5FA;

    box-sizing: border-box;
}

.circular-progress .time {
    color: var(--time);
}

.actual-progress {
    position: absolute;
    height: 250px;
    width: 250px;
    border-radius: 50%;
    z-index: 1;

    background: conic-gradient(var(--primary-color) 270deg, transparent 0deg);
    mask: radial-gradient(closest-side, transparent 88%, black 89%);
    -webkit-mask: radial-gradient(closest-side, transparent 88%, black 89%);
    transform: rotate(0deg);
}

.time {
    font-size: 46px;
    font-weight: 700;
}

.subject-select-wrapper label {
    color: var(--timer-label);
    font-size: 16px;
    font-weight: 500;
}

.controls-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.control-row1 {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.subject-select-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mode-buttons {
    display: flex;
    gap: 8px;
}

.control-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.timer-stats-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.timer-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two equal columns */
    gap: 20px;
    margin-top: 15px;
}

.stat-box {
    background-color: var(--bg-stat-box);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: black;
    font-size: 14px;
    font-weight: 500;
}

.stat-time {
    font-size: 18px;
    font-weight: 600;
}

.subject-select-wrapper select {
    border-radius: 12px;
    border: none;
    border: 1px solid var(--text-muted);
    padding: 8px 10px;
    width: 100%;
    appearance: none;
    background-image: url(svgIcons/down-arrow.svg);
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 22px;
}

.mode-buttons button {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    color: white;
    background-color: gray;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px var(--primary-shadow);
    transition: transform 0.1s;
}

.mode-buttons span {
    display: block;
}

.mode-buttons .active {
    background-color: var(--primary-color);
}

.mode-btn:hover {
    transform: translateY(-1px);
}

.action-btn {
    padding: 12px 26px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    color: white;
    background-color: gray;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px var(--primary-shadow);
    transition: transform 0.1s;
}

.action-btn.start {
    background-color: var(--primary-color);
    color: white;
}

.action-btn:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

/* Notes */
#notes {
    width: 75vw;
    margin: 30px 30px;
}

.search-notes-wrapper {
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.search-notes-wrapper input {
    flex: 1;
    border-radius: 12px;
    border: none;
    border: 1px solid var(--text-muted);
    padding: 10px 10px 10px 40px;
    width: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    /* 12px from the left */
    background-size: 20px;
}

.search-notes-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-notes-wrapper button {
    padding: 12px 26px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    color: white;
    background-color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px var(--primary-shadow);
    transition: transform 0.1s;
}

.notes-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.note-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
    position: relative;
}

.note-card .first-row {
    display: flex;
    justify-content: space-between;
}

.first-row h3 {
    font-size: 20px;
}

.first-row img {
    width: 25px;
}

.first-row .right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.add-note-popup-card {
    display: none;
    width: 400px;
    position: absolute;
    top: 100px;
    right: 70px;
    /* display: flex; */
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
}

.add-note-popup-card h3 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 10px;
}

.add-note-popup-card input,
.add-note-popup-card textarea {
    border-radius: 12px;
    border: none;
    border: 1px solid var(--text-muted);
    padding: 8px 10px;
    width: 100%;
}

.popup-action-btn {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.popup-action-btn button {
    width: 100px;
    padding: 10px 0;

    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    color: white;
    background-color: var(--primary-color);
    /* Blue background */
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    transition: transform 0.1s;
}

.popup-action-btn button:hover {
    transform: translateY(-1px);
    filter: brightness(0.9);
}

.popup-action-btn .note-cancel-btn {
    background-color: white;
    color: #334155;
    /* Slate color */
    border: 1px solid var(--border-strong);
}

.popup-action-btn .note-cancel-btn:hover {
    background-color: #fdf4f4;
}

.edit-btn:hover {
    cursor: pointer;
    transform: translateY(-1px);
}

/* 1. Truncate text on the small card (So it doesn't look messy) */
.note-third-row p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Show only 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

/* 2. View Note Overlay (Dark Background) */
.view-note-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Dimmed background */
    z-index: 100;
    justify-content: center;
    align-items: center;
}

/* 3. The Actual Reading Card */
.view-note-card {
    background-color: var(--bg-card);
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    /* Allow scrolling if note is HUGE */
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    /* Scroll inside if needed */
}

/* 4. Internal Styling */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-header h2 {
    font-size: 24px;
    color: var(--text-main);
}

.close-view-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.close-view-btn:hover {
    color: var(--primary-color);
}

.view-meta-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.view-body p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
    /* Preserves paragraphs/line breaks */
}

/* Progress */
#progress {
    width: 75vw;
    margin: 30px 28px;
}

.progress-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 130px 1fr 250px;
    margin-top: 30px;
}

.progress-stat-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    grid-row: 1/2;
    grid-column: 1/-1;
    justify-content: space-between;
}

.progress-card {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px 100px 20px 20px;
    /* justify-content: flex-start; */
    gap: 20px;
    height: 110px;
}

.progress-card-icon img {
    width: 40px;
}

.progress-card-content {
    display: flex;
    flex-direction: column;
}

.progress-header {
    display: flex;
    justify-content:
        space-between;
    align-items:
        center;
    margin-bottom: 20px;
}

.progress-header button {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.progress-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
}

.progress-value {
    font-size: 24px;
    font-weight: 700;
}

.total-tasks {
    font-weight: 500;
    color: gray;
}

.subject-wise-progress-card {
    grid-row: 2/3;
    grid-column: 1/-1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
    margin-bottom: 20px;
}

.each-progress {
    display: flex;
    flex-direction: column;
}

.top-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.top-info span {
    font-weight: 500;
}

.under-bar {
    width: 100%;
    height: 10px;
    border-radius: 50px 50px;
    background-color: #bfd2fb;
}

.top-bar {
    width: 50%;
    height: 10px;
    border-radius: 50px 50px;
    background: var(--bg);
}

/* Progress Bar Chart Styling */
.chart-card {
    grid-column: 1/-1;
    grid-row: 3/-1;
    background: white;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    /* margin-bottom: 20px; */
    height: 250px;
}

.bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
    width: 40px;
}

.bar {
    width: 12px;
    background-color: var(--primary-color);
    border-radius: 50px;
    transition: height 0.5s ease;
    opacity: 0.7;
}

.bar:hover {
    opacity: 1;
    transform: scaleX(1.2);
}

.bar-day {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.bar-tooltip {
    font-size: 10px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 4px;
}


/* Settings */

#settings {
    width: 75vw;
    margin: 30px 28px;
}

#settings h4 {
    font-size: 16px;
    font-weight: 600;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 130px 1fr 1fr;
    gap: 15px;
    margin-top: 40px;
}

.appearance-card {
    grid-column: 1/2;
    grid-row: 1/2;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
    height: 130px;
}

.dark-mode-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.darkmode-button {
    cursor: pointer;
}

.backside {
    position: relative;
    width: 60px;
    height: 34px;
    border: none;
    border-radius: 50px;
    background-color: lightgray;
    box-shadow: 5px 5px 10px 2px rgba(80, 80, 80, 0.08);
}

.backside img.moon {
    position: absolute;
    right: 6px;
    bottom: 8px;
    width: 18px;
}

.backside img.sun {
    position: absolute;
    left: 6px;
    bottom: 8px;
    width: 18px;
    /* z-index: -1; */
}

.toggle {
    position: absolute;
    top: 2px;
    left: 3px;
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background-color: white;
    box-shadow: var(--shadow-card);
    transform: translateX(10%);
    transform: translateY(4%);
}

.theme-card {
    grid-column: 1/2;
    grid-row: 2/3;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
    /* height: 130px; */
}

.theme-colors {
    display: flex;
    gap: 20px;
}

.theme-color {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.data-management-card {
    grid-column: 1/2;
    grid-row: 3/4;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
}

.data-management-card button {
    padding: 10px 26px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    color: white;
    background: linear-gradient(135deg, #F87171, #DC2626);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    transition: transform 0.1s;
}

.data-management-card button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #f96565, #ee1818);
}

.settings-popup-card {
    display: none;
    position: absolute;
    bottom: 100px;
    left: 400px;
    /* display: flex; */
    flex-direction: column;
    width: 300px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-card);
    padding: 20px;
    gap: 20px;
}

.action-btns {
    display: flex;
    /* justify-content: space-between; */
    gap: 10px;
}

.action-btns button {
    padding: 12px 10px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    color: white;
    background: linear-gradient(135deg, #F87171, #DC2626);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    transition: transform 0.1s;
    width: 50%;
}

.action-btns button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #f96565, #ee1818);
}

.disclaimer {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-btns .cancel-btn {
    background: white;
    color: #334155;
    /* Slate color */
    border: 1px solid var(--border-strong);
}

.action-btns .cancel-btn:hover {
    background: rgb(254, 245, 245);
}

.mobile-bottom-nav, 
.hamburger-btn, 
#sidebar-overlay {
    display: none;
}

/* =========================================
   MEDIA QUERIES (RESPONSIVENESS)
   Add this to the very bottom of style.css
   ========================================= */

/* --- Tablet & Smaller Laptops (Max Width: 1024px) --- */
@media screen and (max-width: 1024px) {

    /* Adjust Main Content Width */
    #dashboard,
    #subjects,
    #tasks,
    #timer,
    #notes,
    #progress,
    #settings {
        width: 90%;
        margin: 20px auto;
    }

    /* Dashboard: Stack Right Sidebar below content */
    .dashboard-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .area2 {
        grid-column: 1;
        grid-row: auto;
        margin-top: 20px;
    }

    .right-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* Side by side summary and chart */
        gap: 20px;
    }

    /* Cards: 2 Columns instead of 3 */
    .stats-grid,
    .card-container,
    .notes-container,
    .progress-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Mobile Devices (Max Width: 768px) --- */
@media screen and (max-width: 768px) {

    /* 1. LAYOUT & SIDEBAR TRANSFORMATION */
    .app {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        /* Hidden state */
        top: 0;
        width: 250px;
        height: 100vh;
        flex-direction: column !important;
        /* Force vertical column for hybrid menu */
        z-index: 2000;
        transition: transform 0.3s ease-in-out;
        background-color: var(--bg-sidebar);
        display: flex;
        /* Ensure it's a flex container */
    }

    .sidebar.active {
        transform: translateX(250px);
        /* Slide in */
    }

    /* Reset internal sidebar nav to be a vertical column */
    .sidebar nav {
        flex-direction: column !important;
        width: 100%;
        align-items: center;
        justify-content: center;
    }

    /* Ensure items inside the sliding sidebar stay in a neat column */
    .sidebar nav ul.nav-menu {
        flex-direction: column !important;
        align-items: center;
        padding: 20px;
        display: flex;
        gap: 10px;
        margin-top: 100px;
    }

    /* Overlay logic */
    .sidebar-overlay {
        position: fixed;
        display: none;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Hamburger Button Styling */
    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 3000;
        /* Force it to stay ABOVE the sidebar (z-index 2000) */
        transition: left 0.3s ease-in-out;
    }

    .hamburger-btn span {
        width: 100%;
        height: 3px;
        background: var(--primary-color);
        border-radius: 10px;
    }

    /* Move the hamburger with the sidebar so it's always visible to close it */
    .sidebar.active~.hamburger-btn {
        left: 215px;
        /* Pushes the button just outside the 200px sidebar */
    }

    /* Change hamburger color when sidebar is active for better visibility */
    .sidebar.active~.hamburger-btn span {
        background: var(--text-white);
    }

    /* 2. BOTTOM NAVIGATION (Core 4: Dashboard, Tasks, Timer, Notes) */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 75px;
        background-color: var(--bg-sidebar);
        justify-content: space-around;
        align-items: center;
        z-index: 5000;
        /* High z-index to stay on top */
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.4);
        border-top: 1px solid var(--border-color);
    }


    /* Ensure Nav Items inside Bottom Bar look like icons */
    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: #cbd5e1;
        font-size: 10px;
        flex: 1;
        /* Equal spacing */
    }

    .mobile-bottom-nav .nav-icon img {
        width: 26px;
        height: 26px;
    }

    /* 3. CLEANUP: Hiding/Visibility Logic */

    /* Hide items that moved to the bottom bar */
    .sidebar [data-page="dashboard"],
    .sidebar [data-page="subjects"],
    .sidebar [data-page="tasks"],
    .sidebar [data-page="settings"] {
        display: none !important;
    }

    /* Explicitly show management items in sidebar */
    .sidebar [data-page="timer"],
    .sidebar [data-page="notes"],
    .sidebar [data-page="progress"] {
        display: flex !important;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 15px !important;
        font-size: 14px;
    }

    /* Hide redundant desktop UI elements on mobile */
    .sidebar-header,
    .sidebar-footer,
    .border {
        display: none;
    }

    /* Adjust Navigation Menu for Horizontal Layout */
    .sidebar nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        padding: 0;
    }

    .nav-menu {
        display: flex;
        width: 100%;
        justify-content: space-around;
        padding: 0;
        margin: 0;
    }

    .settings {
        display: none;
        /* Hide settings icon on mobile nav */
    }

    .nav-item {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px;
        margin: 0;
        font-size: 10px;
        border-radius: 0;
    }

    .nav-icon img {
        width: 24px;
        height: 24px;
    }

    /* 2. MAIN CONTENT SPACING FIX */
    .content {
        padding-top: 40px !important;
        /* Fix: Adds space from top of phone screen */
        padding-bottom: 100px;
        /* Fix: Adds space for bottom nav */
        width: 100%;
        margin-top: 50px;
    }

    .page {
        width: 100% !important;
        margin: 0 !important;
        padding: 15px;
    }

    /* Force pages to take full width */
    #dashboard,
    #subjects,
    #tasks,
    #timer,
    #notes,
    #progress,
    #settings {
        width: 100%;
        margin: 0;
        padding: 0 15px;
    }



    /* 3. DASHBOARD FIXES */
    .greeting {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        /* 1 Column */
    }

    .shortcuts-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* 2 buttons per row */
        gap: 10px;
    }

    .right-sidebar {
        grid-template-columns: 1fr;
        /* Stack vertically */
    }

    /* 4. SUBJECTS PAGE FIXES (REVISED) */
    .subjects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }

    .add-subject-btn {
        width: 100%;
        padding: 12px;
        margin-top: 10px;
    }

    .card-container {
        grid-template-columns: 1fr;
        /* Single column list */
        margin-top: 20px;
        gap: 15px;
    }

    /* Card Layout: Horizontal Row (Strip | Content) */
    .subject-card {
        display: flex;
        flex-direction: row !important;
        /* Force side-by-side layout */
        align-items: center;
        justify-content: center;
        padding: 15px;
        max-height: 150px;
        /* Compact height */
        position: relative;
    }

    .subject-card .content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* ALIGN MIDDLE vertically */
        align-items: center;
        padding-top: 100px !important;
    }

    /* Color Strip: Vertical Line on Left */
    .color-strip {
        width: 6px !important;
        /* Thin vertical line */
        height: auto !important;
        /* Auto height */
        align-self: stretch;
        /* Stretch to match card height */
        margin-bottom: 0 !important;
        /* Remove bottom margin */
        margin-right: 15px;
        /* Space between strip and text */
        border-radius: 4px;
    }

    /* Content Adjustment */
    .subject-card .content {
        margin-top: 0 !important;
        /* Remove top margin */
        align-items: flex-start;
        justify-content: center;
        text-align: left;
    }

    .subject-name {
        font-size: 18px;
        /* Slightly smaller text for mobile */
        max-width: 180px;
        /* Prevent text hitting icons */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .time-studied {
        font-size: 14px;
        margin-top: 4px;
    }

    /* Icon Positioning */
    .action-area {
        position: absolute;
        top: 50%;
        /* Center vertically */
        right: 15px;
        /* 15px from right edge */
        transform: translateY(-50%);
        /* Perfect vertical center */
        display: flex;
        gap: 10px;
    }

    .action-area img {
        width: 20px;
        /* Smaller icons for mobile */
        height: 20px;
    }

    /* 5. TASKS PAGE FIXES */
    .task-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .dropdowns {
        flex-direction: column;
        width: 100%;
    }

    .dropdowns select {
        width: 100%;
    }

    .tasks-container {
        grid-template-columns: 1fr;
    }

    .add-task-btn {
        width: 100%;
    }

    .dropdowns select {
        height: 40px;
        width: 100%;
        /* Makes each dropdown full width of its container */
        max-width: 100%;
        margin-bottom: 10px;
        /* Adds space between the two dropdowns */
        border-radius: 20px;
    }

    /* Ensure the container allows them to stack and grow */
    .dropdowns {
        flex-direction: column;
        width: 100%;
    }

    /* 6. TIMER PAGE FIXES */
    #timer .page-title {
        text-align: center;
        margin-bottom: 20px;
    }

    .timer-area {
        width: 100%;
    }

    .control-row2 {
        grid-template-columns: 1fr;
        /* Stack buttons vertically */
    }

    .circular-progress,
    .actual-progress {
        width: 220px;
        height: 220px;
    }

    .timer-stats-grid {
        grid-template-columns: 1fr;
    }

    .subject-select-wrapper select {
        background-image: none !important;
        /* Removes the SVG icon */
        padding-right: 12px !important;
        /* Adjusts padding since arrow is gone */
    }

    /* 7. NOTES PAGE FIXES */
    .notes-container {
        grid-template-columns: 1fr;
    }

    .search-notes-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .add-note-btn {
        width: 100%;
        padding: 12px;
    }

    /* 8. PROGRESS PAGE FIXES */
    .progress-header {
        flex-direction: column;
        /* Stack Title and Button */
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }

    #download-report-btn {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .progress-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .progress-stat-cards {
        flex-direction: column;
    }

    .progress-card {
        width: 100%;
        padding-right: 20px;
    }

    .settings {
        display: flex !important;
        /* Forces the settings icon to show on mobile */
    }

    .nav-menu {
        display: flex;
        width: 100%;
        justify-content: space-around;
        padding: 0;
    }

    /* 9. SETTINGS PAGE FIXES */
    .settings-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .action-btns button {
        width: 100%;
    }

    /* 10. CRITICAL POPUP FIXES (Centering) */
    .popup-card,
    .add-task-popup,
    .add-note-popup-card,
    .settings-popup-card {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        /* Centers element exactly */
        width: 90%;
        max-width: 350px;
        z-index: 2000;
        max-height: 90vh;
        overflow-y: auto;
        /* Scroll if content is too long */
    }

    .view-note-card {
        width: 90%;
        max-height: 80vh;
    }

    .mobile-bottom-nav {
        display: flex !important;
        /* Force visibility */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background-color: var(--bg-sidebar);
        /* Dark background for visibility */
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }

    /* Ensure the icons and text inside the bottom bar are visible */
    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        color: #cbd5e1;
        font-size: 10px;
    }
}