/* SPA Views */
.view-section {
    display: block;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.view-section.hidden {
    display: none;
}

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

:root {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --primary: #ef4444;
    --primary-hover: #dc2626;
    --primary-light: #f87171;
    --secondary: #1e293b;
    --danger: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --text-muted: #94a3b8;
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-bg-hover: rgba(255, 255, 255, 0.07);
    --item-bg: rgba(255, 255, 255, 0.02);
    --body-gradient: linear-gradient(135deg, #020617 0%, #0f172a 50%, #172554 100%);
    --body-grad-size: 200% 200%;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-primary: 0 0 25px rgba(14, 165, 233, 0.3);
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --primary: #ef4444;
    --primary-hover: #dc2626;
    --primary-light: #f87171;
    --secondary: #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.05);
    
    --input-bg: rgba(0, 0, 0, 0.03);
    --input-bg-hover: rgba(0, 0, 0, 0.06);
    --item-bg: rgba(0, 0, 0, 0.02);
    --body-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 0 20px rgba(14, 165, 233, 0.2);
}

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

@keyframes auroraGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--body-gradient);
    background-size: var(--body-grad-size, 400% 400%);
    animation: auroraGradient 15s ease infinite;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: linear-gradient(90deg, #fca5a5, #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    margin: 0 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-light);
    text-shadow: 0 0 10px rgba(12, 166, 166, 0.3);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    background: rgba(12, 166, 166, 0.15);
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(12, 166, 166, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.4rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transition: left 0.3s ease;
    z-index: -1;
}

button:hover::before {
    left: 100%;
}

@keyframes buttonPulse {
    0% { box-shadow: var(--shadow-md), 0 0 0 0 rgba(12, 166, 166, 0.4); }
    70% { box-shadow: var(--shadow-md), 0 0 0 12px rgba(12, 166, 166, 0); }
    100% { box-shadow: var(--shadow-md), 0 0 0 0 rgba(12, 166, 166, 0); }
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    animation: buttonPulse 1.5s infinite;
}

button:active {
    transform: translateY(-1px);
}

button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button.secondary-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

button.secondary-btn:hover {
    background: rgba(12, 166, 166, 0.2);
    animation: none;
}

.color-picker-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    padding: 0;
    transition: transform 0.3s;
}
.color-picker-btn:hover {
    transform: scale(1.1);
}
.color-picker-btn::-webkit-color-swatch-wrapper {
    padding: 0;
}
.color-picker-btn::-webkit-color-swatch {
    border: 1px solid var(--glass-border);
    border-radius: 50%;
}
.color-picker-btn::-moz-color-swatch {
    border: 1px solid var(--glass-border);
    border-radius: 50%;
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl), inset 0 0 15px rgba(255,255,255,0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex: 1;
    min-width: 300px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.glass-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-xl), 0 30px 60px rgba(14, 165, 233, 0.25);
    border-color: rgba(14, 165, 233, 0.4);
}

.full-width {
    width: 100%;
    flex: 100%;
}

/* Pomodoro styles */
.pomodoro-section {
    position: relative;
    text-align: center;
    transition: all 0.4s ease;
    padding: 3rem;
}

.pomodoro-section h2 {
    margin-bottom: 2rem;
    color: var(--text-color);
    transition: font-size 0.4s ease;
}

/* Focus Mode */
.pomodoro-section.focus-mode {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 2000;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: none;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-color);
    overflow-y: auto;
    padding: 2rem;
}

.pomodoro-section.focus-mode .pomodoro-title,
.pomodoro-section.focus-mode h2,
.pomodoro-section.focus-mode .pomodoro-settings-row label,
.pomodoro-section.focus-mode #timer-status,
.pomodoro-section.focus-mode .timer-display {
    color: white !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.pomodoro-section.focus-mode .pomodoro-title {
    font-size: 2rem;
    color: rgba(255,255,255,0.8) !important;
    text-shadow: 0 2px 15px rgba(0,0,0,0.6);
}

.pomodoro-section.focus-mode .timer-display {
    font-size: 18rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 80px rgba(14, 165, 233, 0.9), 0 0 140px rgba(0,0,0,0.8);
}

.pomodoro-section.focus-mode #exit-focus-btn {
    display: flex !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    font-size: 1.2rem;
}

/* ── Plan Page Specific ─────────────────────────────── */
.plan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    align-items: flex-start;
}
@media (max-width: 860px) { .plan-grid { grid-template-columns: 1fr; } }

.plan-panel { display: flex; flex-direction: column; gap: 0; }

/* ── Planner (Left) Styles ───── */
.plan-add-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}
.plan-add-form input[type="text"] {
    grid-column: 1 / -1;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    transition: border-color .2s;
}
.plan-add-form input[type="text"]:focus { border-color: var(--primary); }
.plan-add-form input[type="date"],
.plan-add-form select.pf-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    color: var(--text-color);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
}
.plan-add-form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.5);
    cursor: pointer;
}
.plan-add-btn {
    grid-column: 1 / -1;
    padding: 0.65rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ── Task List (shared) ── */
.plan-task-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.plan-task-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    transition: background .2s;
}
.plan-task-item:hover { background: rgba(255,255,255,0.08); }
.plan-task-item.done { opacity: 0.5; }
.plan-task-item.done .pti-text { text-decoration: line-through; }
.pti-check {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--primary);
    background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.pti-check.checked { background: var(--primary); }
.pti-check.checked::after { content: '✓'; font-size: 11px; color: white; }
.pti-text { flex: 1; font-size: 0.92rem; color: var(--text-color); }
.pti-date-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    white-space: nowrap;
}
.pti-date-badge.today { color: #34d399; border-color: #34d399; }
.pti-date-badge.overdue { color: #f87171; }
.pti-delete {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); opacity: 0.6;
    padding: 0.15rem 0.3rem; border-radius: 5px;
    transition: opacity .2s, color .2s;
}
.pti-delete:hover { opacity: 1; color: #f87171; }

/* ── Section headers ── */
.plan-section-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
}

/* ── Tabs (Right panel) ── */
.pf-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 0.3rem;
}
.pf-tab {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 9px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: background .2s, color .2s;
}
.pf-tab.active { background: var(--primary); color: #fff; }

/* ── Done item completed-at ── */
.pti-done-at {
    font-size: 0.72rem;
    color: #34d399;
    white-space: nowrap;
}

/* ── Empty state ── */
.plan-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.plan-empty i { font-size: 2rem; margin-bottom: 0.5rem; display: block; opacity: 0.4; }


.pomodoro-section.focus-mode .pomodoro-settings-row {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pomodoro-section.focus-mode .pset-item input[type="number"],
.pomodoro-section.focus-mode .pset-select {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
    border-color: rgba(255,255,255,0.2) !important;
}

.pomodoro-section.focus-mode .pomodoro-footer-row {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
}


/* Timer ring wrapper */
.timer-ring-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 2rem;
    width: fit-content;
}

.timer-ring-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.timer-ring-bg {
    fill: none;
    stroke: rgba(14, 165, 233, 0.08);
    stroke-width: 4;
}

.timer-ring-progress {
    fill: none;
    stroke: url(#timerGrad);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
    transform-origin: center;
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 8px rgba(14,165,233,0.6));
}

.timer-display {
    font-size: 8rem;
    font-weight: 200;
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 60px rgba(14, 165, 233, 0.6), 0 2px 20px rgba(0,0,0,0.4);
    letter-spacing: -4px;
    line-height: 1;
    display: block;
    text-align: center;
}

.pomodoro-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Pomodoro Settings Row */
.pomodoro-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    justify-content: center;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    margin-top: 1.5rem;
    backdrop-filter: blur(10px);
}

.pset-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 90px;
}

.pset-item.pset-grow {
    flex: 1;
    min-width: 150px;
}

.pset-item label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    white-space: nowrap;
}

.pset-item input[type="number"] {
    width: 100%;
    padding: 0.55rem 0.6rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.pset-item input[type="number"]:focus {
    border-color: var(--primary);
    background: rgba(14,165,233,0.1);
}

.pset-select {
    width: 100%;
    padding: 0.55rem 0.6rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pset-select:focus {
    border-color: var(--primary);
    background: rgba(14,165,233,0.1);
}

.pset-select option {
    background: var(--bg-color);
    color: var(--text-color);
}

.pset-sound-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pset-sound-row .pset-select {
    flex: 1;
}

.pset-mute-btn {
    background: transparent !important;
    border: none !important;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    flex-shrink: 0;
    border-radius: 6px !important;
    color: var(--text-muted);
    box-shadow: none !important;
}

.pset-mute-btn:hover {
    color: var(--primary) !important;
    background: rgba(255,255,255,0.05) !important;
    transform: none !important;
    animation: none !important;
}

.pset-volume {
    width: 65px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

/* Pomodoro Footer Row */
.pomodoro-footer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pomodoro-footer-row #timer-status {
    margin-top: 0;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.timer-controls button {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 12px;
    min-width: 120px;
}

.timer-settings {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    background: rgba(0,0,0,0.25);
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    align-items: flex-end;
    flex-wrap: wrap;
    backdrop-filter: blur(8px);
}

.timer-settings label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: center;
}

.timer-settings input[type="number"], .timer-settings input[type="text"] {
    background: var(--secondary);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    width: 70px;
    text-align: center;
}

.timer-settings input[type="range"] {
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

#timer-status {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(12, 166, 166, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    white-space: nowrap;
}

.plan-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Stats & Leaderboard */
.stats-grid {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--glass-border);
    padding: 1.8rem;
    border-radius: 14px;
    flex: 1;
    text-align: center;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), var(--shadow-primary);
}

.stat-card .stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.stat-card h3 {
    font-size: 2.4rem;
    color: var(--primary-light);
    font-weight: 800;
    letter-spacing: -1px;
}

.leaderboard-list {
    list-style: none;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}
.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.leaderboard-rank {
    font-weight: bold;
    color: var(--text-muted);
    width: 35px;
}
.rank-1 .leaderboard-rank { color: gold; font-size: 1.2rem; }
.rank-2 .leaderboard-rank { color: silver; font-size: 1.1rem; }
.rank-3 .leaderboard-rank { color: #cd7f32; font-size: 1.1rem; }
.leaderboard-name {
    flex: 1;
    font-weight: 500;
}
.leaderboard-score {
    color: var(--primary);
    font-weight: bold;
}

#todo-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.todo-select {
    background: rgba(255,255,255,0.06);
    border: 1.5px solid var(--glass-border);
    padding: 0.85rem;
    border-radius: 10px;
    color: white;
    outline: none;
    min-width: 120px;
    transition: all 0.3s ease;
    font-weight: 600;
    cursor: pointer;
}

.todo-select:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(12, 166, 166, 0.15);
}

.todo-select option {
    background: var(--bg-color);
    color: white;
    padding: 0.5rem;
}

#todo-form input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid var(--glass-border);
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    color: white;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

#todo-form input::placeholder {
    color: rgba(255,255,255,0.4);
}

#todo-form input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(12, 166, 166, 0.1);
}

#todo-list {
    max-height: 400px;
    overflow-y: auto;
}

.lesson-group {
    margin-bottom: 1.5rem;
}

.lesson-group h3 {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    color: var(--primary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.3rem;
}

.todo-ul {
    list-style: none;
}

.todo-ul li {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    margin-bottom: 0.8rem;
    padding: 1.1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.todo-ul li:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.4);
    transform: translateX(8px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

.todo-ul li.completed {
    opacity: 0.6;
    background: rgba(255,255,255,0.02);
}

.todo-ul li.completed span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-actions {
    display: flex;
    gap: 0.5rem;
}

.todo-actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.btn-complete { background: var(--success); }
.btn-complete:hover { background: #059669; }

.btn-delete { background: var(--danger); }
.btn-delete:hover { background: #dc2626; }

/* Premium Timer Settings */
.premium-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.2rem;
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    text-align: left;
    backdrop-filter: blur(10px);
}

.premium-settings div {
    min-width: 100px;
}

.premium-settings label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.premium-settings input[type="number"], 
.premium-settings input[type="text"],
.premium-settings select {
    width: 100%;
    padding: 0.7rem 0.9rem !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 12px !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    outline: none !important;
    transition: all 0.3s !important;
    text-align: center;
}

.premium-settings input[type="number"]:focus, 
.premium-settings input[type="text"]:focus,
.premium-settings select:focus {
    border-color: var(--primary) !important;
    background: rgba(14, 165, 233, 0.1) !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15) !important;
}

/* Strict Mode Badge */
.strict-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(244, 63, 94, 0.05);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 1px dashed rgba(244, 63, 94, 0.35);
    transition: all 0.3s;
}

.strict-badge:hover {
    background: rgba(244, 63, 94, 0.1);
    border-style: solid;
}

.strict-badge label {
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.strict-badge input[type="checkbox"] {
    accent-color: var(--danger);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.lofi-btn {
    background: rgba(139, 92, 246, 0.1) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    color: #a78bfa !important;
}

.lofi-btn:hover {
    background: rgba(139, 92, 246, 0.2) !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* Leaderboard Refinement (Image 1 Style) */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.leader-item {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    transition: all 0.3s;
}

.leader-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(5px);
}

.leader-rank {
    width: 35px;
    font-weight: 900;
    font-size: 1.2rem;
    margin-right: 1rem;
}

.rank-1 { color: #fbbf24; text-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #b45309; }

.leader-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.leader-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.leader-time {
    font-weight: 700;
    color: var(--primary);
}

/* Login overlay */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-card {
    text-align: center;
    max-width: 450px;
    width: 90%;
    margin: 20px;
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.auth-tab {
    flex: 1;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    box-shadow: none;
}

.auth-tab:hover {
    transform: none;
    background: rgba(255,255,255,0.05);
}

.auth-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    border-radius: 0;
}

.auth-box {
    display: block;
}

.auth-box.hidden {
    display: none;
}

.login-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: var(--text-color);
}

.login-card input[type="text"], .login-card input[type="password"] {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid var(--glass-border);
    padding: 1rem 1.2rem;
    border-radius: 10px;
    color: white;
    margin-bottom: 1.2rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.login-card input[type="text"]::placeholder, 
.login-card input[type="password"]::placeholder {
    color: rgba(255,255,255,0.4);
}

.login-card input[type="text"]:focus, 
.login-card input[type="password"]:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(12, 166, 166, 0.15);
}

.level-select {
    text-align: left;
    margin-bottom: 1.5rem;
}

.level-select label {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1rem;
}

.login-card button:not(.auth-tab) {
    width: 100%;
    justify-content: center;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.8rem;
    min-height: 20px;
}

/* Lessons View */
.lessons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.lesson-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.lesson-card.active-lesson {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), var(--shadow-primary);
    transform: translateY(-12px) scale(1.02);
}

.lesson-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: rgba(12, 166, 166, 0.4);
}

/* Plan Tasks UI Styles */
.plan-task-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.plan-task-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.plan-task-item.done {
    opacity: 0.6;
}

.pti-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    background: transparent;
}

.pti-check.checked {
    background: var(--success, #10b981);
    border-color: var(--success, #10b981);
    position: relative;
}

.pti-check.checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pti-text {
    flex: 1;
    font-size: 0.95rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
}

.plan-task-item.done .pti-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.pti-date-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    flex-shrink: 0;
}

.pti-date-badge.today {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.pti-date-badge.overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.pti-done-at {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    flex-shrink: 0;
}

.pti-delete {
    background: none;
    border: none;
    color: rgba(239, 68, 68, 0.7);
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pti-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.lesson-img {
    height: 160px;
    width: 100%;
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

.lesson-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lesson-info h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.lesson-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-remove-lesson {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.btn-remove-lesson:hover {
    background: var(--danger);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Light Mode Overrides */
[data-theme="light"] .nav-links a { color: var(--text-muted); }
[data-theme="light"] .pomodoro-section h2, [data-theme="light"] .plan-section h2, [data-theme="light"] .lessons-header h2 { color: var(--text-color); }
[data-theme="light"] .timer-settings { background: rgba(0,0,0,0.05); }
[data-theme="light"] .timer-settings label, [data-theme="light"] .level-select label { color: var(--text-muted); }
[data-theme="light"] .timer-settings input[type="number"], [data-theme="light"] .timer-settings input[type="text"], [data-theme="light"] #todo-form input, [data-theme="light"] .login-card input[type="text"], [data-theme="light"] .login-card input[type="password"] {
    background: var(--input-bg);
    color: var(--text-color);
    border-color: var(--glass-border);
}

[data-theme="light"] .timer-settings input[type="range"] {
    background: transparent;
    border: none;
}
[data-theme="light"] .todo-select {
    color: var(--text-color);
    background: var(--input-bg);
}
[data-theme="light"] .todo-select option {
    background: #f8fafc;
    color: #0f172a;
}
[data-theme="light"] .radio-group label, [data-theme="light"] .login-card h2, [data-theme="light"] .lesson-info h3 { color: var(--text-color); }
[data-theme="light"] .todo-ul li, [data-theme="light"] .lesson-card { background: var(--item-bg); }
[data-theme="light"] .stat-card, [data-theme="light"] .leaderboard-item { background: var(--item-bg); }
[data-theme="light"] .todo-ul li:hover, [data-theme="light"] .auth-tab:hover { background: var(--input-bg-hover); }
[data-theme="light"] .auth-tab { color: var(--text-muted); }
[data-theme="light"] .auth-tab.active { color: var(--primary); }
[data-theme="light"] .theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}
[data-theme="light"] .theme-toggle-btn:hover {
    background: var(--input-bg-hover);
}
[data-theme="light"] .login-card {
    background: var(--glass-bg);
}

/* AI Chatbot Styles */
.chatbot-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(12, 166, 166, 0.5);
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
    border: none;
}

.chatbot-fab:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

.chatbot-widget {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 350px;
    height: 500px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-widget.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

.chatbot-header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
}

.close-btn:hover {
    background: transparent;
    color: #cbd5e1;
    transform: none;
}

.chatbot-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.chat-message {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 0.95rem;
}

.ai-message {
    background: rgba(12, 166, 166, 0.2);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: var(--text-color);
}

.user-message {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chatbot-input {
    display: flex;
    padding: 1rem;
    gap: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.chatbot-input input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.8rem;
    border-radius: 8px;
    color: var(--text-color);
    outline: none;
}

.chatbot-input input:focus {
    border-color: var(--primary);
}

.chatbot-input button {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
}

/* ========== ACCESSIBILITY IMPROVEMENTS ========== */

/* Keyboard navigation focus states */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Better contrast for links and buttons */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline-width: 3px;
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== MOBILE RESPONSIVENESS ========== */

/* Tablets and above */
@media (max-width: 1024px) {
    .container {
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .glass-card {
        padding: 1.8rem;
    }
    
    header {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1.5rem;
        margin: 0;
    }
    
    .user-info {
        gap: 0.5rem;
    }
}

/* Smaller tablets and phones */
@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.8rem;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .nav-links {
        font-size: 0.85rem;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .user-info {
        flex-wrap: wrap;
        gap: 0.3rem;
        width: 100%;
        justify-content: center;
    }
    
    .container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .glass-card {
        padding: 1.5rem;
        min-width: auto;
    }
    
    .full-width {
        width: 100%;
    }
    
    .timer-display {
        font-size: 3.5rem;
        margin-bottom: 1.5rem;
    }
    
    .timer-settings {
        gap: 1rem;
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }
    
    .timer-settings > div {
        display: flex;
        flex-direction: column;
    }
    
    .timer-controls {
        gap: 0.8rem;
    }
    
    .timer-controls button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .stats-grid {
        flex-direction: column;
    }
    
    .stat-card {
        padding: 1.2rem;
    }
    
    .leaderboard-list {
        max-height: 250px;
    }
    
    .todo-select,
    #todo-form input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.1rem;
    }
    
    .nav-links {
        font-size: 0.75rem;
        gap: 0.8rem;
    }
    
    .nav-links a {
        gap: 0.3rem;
    }
    
    .container {
        padding: 0.8rem;
        gap: 0.8rem;
    }
    
    .glass-card {
        padding: 1.2rem;
        border-radius: 16px;
    }
    
    .timer-display {
        font-size: 2.8rem;
    }
    
    .timer-settings {
        gap: 0.8rem;
    }
    
    .timer-controls button {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .grid-layout {
        grid-template-columns: 1fr;
    }
    
    #todo-form {
        flex-direction: column;
    }
    
    .todo-select {
        width: 100%;
    }
    
    button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .chatbot-widget {
        width: 100%;
        height: 70vh;
        bottom: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
    }
    
    .chatbot-fab {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .pomodoro-section.focus-mode .timer-display {
        font-size: 8rem;
    }
    
    #theme-bubbles-container {
        gap: 0.2rem !important;
    }
    
    .theme-bubble {
        width: 24px !important;
        height: 24px !important;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    header h1 {
        font-size: 1rem;
    }
    
    .nav-links {
        font-size: 0.7rem;
    }
    
    .timer-display {
        font-size: 2.2rem;
    }
    
    button {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* ========== LOADING & TRANSITION IMPROVEMENTS ========== */

/* Skeleton loading effect */
@keyframes skeleton-loading {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 1000px 100%;
    animation: skeleton-loading 2s infinite;
}

/* Fade-in animation for content */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.glass-card,
.lesson-card,
.todo-ul li {
    animation: slideUp 0.4s ease-out forwards;
}

/* Stagger animation delays */
.glass-card:nth-child(2) { animation-delay: 0.1s; }
.glass-card:nth-child(3) { animation-delay: 0.2s; }
.glass-card:nth-child(4) { animation-delay: 0.3s; }

/* ========== IMPROVED HOVER STATES ========== */

.leaderboard-item {
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

/* ========== FORM IMPROVEMENTS ========== */

/* Better placeholder styling */
input::placeholder,
textarea::placeholder {
    color: rgba(255,255,255,0.35);
    opacity: 1;
}

/* Better checkbox styling */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
    cursor: pointer;
}

/* Better select dropdown */
select {
    text-transform: capitalize;
}

/* ========== DARK MODE IMPROVEMENTS ========== */

@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
    }
}

@media (prefers-color-scheme: light) {
    body {
        color-scheme: light;
    }
}

/* ========== PRINT STYLES ========== */

@media print {
    header,
    .chatbot-fab,
    button {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

[data-theme="light"] .ai-message {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.chatbot-typing {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    align-self: flex-start;
    margin-left: 0.5rem;
}

/* --- PREMIUM UI ADDITIONS --- */
.theme-bubble {
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border 0.2s;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}
.theme-bubble:hover {
    transform: scale(1.1);
}

.strict-warning-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.strict-warning-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.strict-warning-overlay h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.strict-warning-overlay p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}
.strict-warning-overlay .countdown {
    font-size: 6rem;
    font-weight: bold;
}

.mixer-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}
.mixer-item i {
    width: 20px;
    text-align: center;
    color: var(--primary);
}
.mixer-item input[type="range"] {
    flex: 1;
}

.daily-todo-list {
    list-style: none;
    margin-top: 1rem;
    max-height: 250px;
    overflow-y: auto;
}
.daily-todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.8rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    margin-bottom: 0.4rem;
    transition: all 0.2s;
}
.daily-todo-item:hover {
    background: rgba(255,255,255,0.08);
}
.daily-todo-item.done span {
    text-decoration: line-through;
    opacity: 0.5;
}
.todo-checkbox {
    accent-color: var(--primary);
    width: 16px; height: 16px;
    cursor: pointer;
}

.quote-container {
    text-align: center;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 1rem 0 2rem 0;
    min-height: 30px;
    transition: opacity 0.5s ease;
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#bg-gallery-modal {
    background: transparent;
    backdrop-filter: none;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 200px;
    padding-right: 20px;
}

.popover-modal-content {
    width: 340px !important;
    max-width: 95vw !important;
    padding: 1.5rem !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-xl), 0 10px 40px rgba(0,0,0,0.6) !important;
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(20px) !important;
}

#bg-gallery-grid img {
    border-radius: 8px;
    width: 100%;
    height: 70px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s, border 0.2s;
    border: 2px solid transparent;
}
#bg-gallery-grid img:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

/* ========== LISTS VIEW PREMIUM UI ENHANCEMENTS ========== */

/* Sidebar */
.lists-sidebar {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(20px) !important;
    border-right: 1px solid rgba(255,255,255,0.06) !important;
}

.lists-sidebar h2 {
    color: white !important;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}

.sidebar-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    margin: 0.3rem 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    background: transparent;
    border: 1px solid transparent;
}

.sidebar-list-item:hover {
    background: rgba(255,255,255,0.06);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sidebar-list-item.active {
    background: rgba(12, 166, 166, 0.15) !important;
    border-color: rgba(12, 166, 166, 0.3) !important;
    color: white;
}

.sidebar-list-item .badge {
    background: rgba(255,255,255,0.1) !important;
    backdrop-filter: blur(5px);
    padding: 0.2rem 0.6rem !important;
    border-radius: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.sidebar-list-item.active .badge {
    background: var(--primary) !important;
    color: white;
    box-shadow: 0 0 12px rgba(12, 166, 166, 0.4);
}

/* Sidebar Button */
#open-add-lesson-btn {
    transition: all 0.3s ease;
    border-radius: 12px !important;
    padding: 0.8rem !important;
    font-weight: 600;
    border: 1px dashed rgba(255,255,255,0.3) !important;
}
#open-add-lesson-btn:hover {
    background: rgba(12, 166, 166, 0.1) !important;
    border-color: var(--primary) !important;
    border-style: solid !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(12, 166, 166, 0.2);
}

/* Main Area Inner Shadow/Gradient Offset */
#lists-main-overlay {
    background: linear-gradient(135deg, rgba(15,23,42,0.9) 0%, rgba(15,23,42,0.3) 100%) !important;
}

/* Header Text */
#active-list-title {
    text-transform: capitalize;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8) !important;
    letter-spacing: 0.5px;
    padding-bottom: 0.2rem;
}
#active-list-title:focus {
    border-bottom: 2px solid var(--primary) !important;
    background: rgba(15,23,42,0.6);
    border-radius: 8px;
    padding: 0.2rem 0.5rem;
}

/* Action Buttons (Top Right) */
#active-list-options {
    gap: 0.8rem !important;
}
#active-list-options button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px !important;
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.15) !important;
    cursor: pointer;
}
#active-list-options button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    background: rgba(255,255,255,0.15) !important;
}
#btn-delete-list:hover {
    background: rgba(239, 68, 68, 0.9) !important;
    border-color: rgba(239, 68, 68, 1) !important;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* Input Area Floating Glass Block */
#active-list-form > div {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    border-radius: 12px !important;
    padding: 0.8rem 1rem !important;
}
#active-list-form > div:focus-within {
    border-color: var(--primary) !important;
    background: rgba(15, 23, 42, 0.85) !important;
    box-shadow: 0 12px 40px rgba(12, 166, 166, 0.25);
    transform: translateY(-2px);
}
#active-list-input::placeholder {
    color: rgba(255,255,255,0.5);
}

/* Todo List Hover Magic */
#active-list-todos .todo-item {
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}
#active-list-todos .todo-item:hover {
    background: rgba(15, 23, 42, 0.7) !important;
    border-color: rgba(255,255,255,0.15) !important;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
#active-list-todos .todo-item.done {
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: transparent !important;
}
