/* CSS Variables for Theming */
:root {
    /* Light Mode - Opposite of provided dark theme */
    --card: #ffffff;
    --ring: #a1a1a1;
    --input: #e5e5e5;
    --muted: #f5f5f5;
    --accent: #f5f5f5;
    --border: #e5e5e5;
    --radius: 0rem;
    --chart-1: #737373;
    --chart-2: #737373;
    --chart-3: #737373;
    --chart-4: #737373;
    --chart-5: #737373;
    --popover: #ffffff;
    --primary: #737373;
    --sidebar: #fafafa;
    --font-mono: 'Geist Mono', monospace;
    --font-sans: 'Geist Mono', monospace;
    --secondary: #f5f5f5;
    --background: #ffffff;
    --font-serif: 'Geist Mono', monospace;
    --foreground: #0a0a0a;
    --destructive: #e7000b;
    --shadow-blur: 0px;
    --shadow-color: hsl(0 0% 0%);
    --sidebar-ring: #a1a1a1;
    --shadow-spread: 0px;
    --shadow-opacity: 0;
    --sidebar-accent: #f5f5f5;
    --sidebar-border: #e5e5e5;
    --card-foreground: #0a0a0a;
    --shadow-offset-x: 0px;
    --shadow-offset-y: 1px;
    --sidebar-primary: #171717;
    --muted-foreground: #717171;
    --accent-foreground: #171717;
    --popover-foreground: #0a0a0a;
    --primary-foreground: #fafafa;
    --sidebar-foreground: #0a0a0a;
    --secondary-foreground: #171717;
    --destructive-foreground: #f5f5f5;
    --sidebar-accent-foreground: #171717;
    --sidebar-primary-foreground: #fafafa;

    /* Legacy variables mapped to new theme */
    --bg-primary: var(--background);
    --bg-secondary: var(--muted);
    --bg-card: var(--card);
    --text-primary: var(--foreground);
    --text-secondary: var(--muted-foreground);
    --border-color: var(--border);
    --primary-color: #10b981;
    --primary-hover: #059669;
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --secondary-color: #3b82f6;
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --danger-color: var(--destructive);
    --streak-color: #f59e0b;
    --streak-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    /* Dark Mode - Provided theme */
    --card: #191919;
    --ring: #737373;
    --input: #525252;
    --muted: #262626;
    --accent: #404040;
    --border: #383838;
    --chart-1: #737373;
    --chart-2: #737373;
    --chart-3: #737373;
    --chart-4: #737373;
    --chart-5: #737373;
    --popover: #262626;
    --primary: #737373;
    --sidebar: #171717;
    --secondary: #262626;
    --background: #0a0a0a;
    --foreground: #fafafa;
    --destructive: #ff6467;
    --sidebar-ring: #525252;
    --sidebar-accent: #262626;
    --sidebar-border: #ffffff;
    --card-foreground: #fafafa;
    --sidebar-primary: #fafafa;
    --muted-foreground: #a1a1a1;
    --accent-foreground: #fafafa;
    --popover-foreground: #fafafa;
    --primary-foreground: #fafafa;
    --sidebar-foreground: #fafafa;
    --secondary-foreground: #fafafa;
    --destructive-foreground: #262626;
    --sidebar-accent-foreground: #fafafa;
    --sidebar-primary-foreground: #171717;

    /* Legacy variables mapped to new theme */
    --bg-primary: var(--background);
    --bg-secondary: var(--muted);
    --bg-card: var(--card);
    --text-primary: var(--foreground);
    --text-secondary: var(--muted-foreground);
    --border-color: var(--border);
    --primary-color: #22c55e;
    --primary-hover: #16a34a;
    --primary-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --secondary-color: #3b82f6;
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --danger-color: var(--destructive);
    --streak-color: #fbbf24;
    --streak-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease;
    color: var(--text-primary);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.nav-logo span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

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

.stat-card.primary {
    border: none;
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-lg);
}

.stat-card.primary::before {
    display: none;
}

.stat-card.primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.3), 0 10px 10px -5px rgba(16, 185, 129, 0.2);
}

.stat-card.streak {
    border-color: var(--streak-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
}

[data-theme="dark"] .stat-card.streak {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-card.primary .stat-label {
    color: rgba(255, 255, 255, 0.95);
}

.stat-card.primary .stat-label::before {
    color: rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.primary .stat-value {
    color: white;
    -webkit-text-fill-color: white;
    background: none;
}

.stat-subtext {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-progress {
    margin-top: 0.6rem;
    width: 100%;
    height: 8px;
    border-radius: 9999px;
    background-color: var(--bg-secondary);
    overflow: hidden;
}

.stat-progress-inner {
    height: 100%;
    width: 0;
    border-radius: 9999px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.dashboard-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.dashboard-section:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.dashboard-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-section h2::before {
    content: '✨';
    font-size: 1.25rem;
}

.insight-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 12px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.insight-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.insight-card p {
    margin: 0.5rem 0;
    line-height: 1.8;
}

.insight-card strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Topic Progress */
.topic-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.topic-progress-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.2fr) 3fr minmax(80px, 0.9fr);
    align-items: center;
    gap: 0.75rem;
}

.topic-progress-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.topic-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 9999px;
    background-color: var(--bg-secondary);
    overflow: hidden;
}

.topic-progress-bar-inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 9999px;
    background: var(--secondary-gradient);
    transition: width 0.3s ease;
}

.topic-progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

/* Learning Path */
.learning-path {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.learning-path-step {
    min-width: 160px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: relative;
    transition: all 0.25s ease;
}

.learning-path-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -0.5rem;
    width: 0.75rem;
    height: 1px;
    background: var(--border-color);
    opacity: 0.5;
}

.learning-path-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.learning-path-bar {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 9999px;
    background-color: var(--bg-secondary);
    overflow: hidden;
}

.learning-path-bar-inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 9999px;
    background: var(--secondary-gradient);
    transition: width 0.3s ease;
}

.learning-path-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.learning-path-completed {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.06) 0%, rgba(16, 185, 129, 0.12) 100%);
}

.learning-path-current {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.learning-path-upcoming {
    opacity: 0.95;
}

.learning-path-empty {
    opacity: 0.5;
}

/* Recommended Problems */
.recommended-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommended-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
}

.recommended-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.recommended-topic-summary {
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.recommended-topic-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.recommended-topic-progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.recommended-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.recommended-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    min-width: 160px;
}

.recommended-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.recommended-tag-sheet {
    background: var(--secondary-gradient);
    color: #fff;
}

.recommended-tag-topic {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.recommended-btn {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Revision Queue */
.revision-queue {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.revision-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.revision-group-header {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.revision-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.revision-item {
    border-left: 4px solid transparent;
}

.revision-level-tag {
    padding: 0.15rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.revision-level-now {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.revision-level-soon {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.revision-item .revision-level-now ~ .revision-level-tag {
    border-left-color: #ef4444;
}

.action-section {
    text-align: center;
    margin-top: 2rem;
}

.achievements-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    font-size: 0.85rem;
}

.achievement-icon {
    font-size: 1rem;
}

.achievement-label {
    font-weight: 500;
}

.achievement-unlocked {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(16, 185, 129, 0.16) 100%);
}

.achievement-locked {
    opacity: 0.6;
}

.install-icon-button {
    border: none;
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.7rem;
    border-radius: 9999px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.install-icon-button:hover {
    background-color: var(--bg-card);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.install-icon-button svg {
    display: block;
}

/* Mini Heatmap */
.mini-heatmap {
    display: grid;
    grid-template-columns: repeat(30, 1fr);
    gap: 3px;
    margin-top: 1rem;
}

.mini-heatmap-square {
    aspect-ratio: 1;
    border-radius: 3px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: transform 0.1s ease;
}

.mini-heatmap-square:hover {
    transform: scale(1.2);
    z-index: 10;
    position: relative;
}

/* Sheet Selection Screen */
.sheet-selection-screen {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    animation: fade-in-scale 0.6s ease-out;
}

.sheet-selection-content {
    max-width: 1000px;
    width: 100%;
}

.selection-header {
    text-align: center;
    margin-bottom: 3rem;
}

.selection-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.selection-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.arrow-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    animation: float 2s ease-in-out infinite;
    margin-top: 1rem;
}

.sheets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.sheet-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fade-in-scale 0.6s ease-out both;
}

.sheet-card:nth-child(1) { animation-delay: 0.1s; }
.sheet-card:nth-child(2) { animation-delay: 0.2s; }
.sheet-card:nth-child(3) { animation-delay: 0.3s; }

.sheet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.sheet-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.2),
                0 0 30px rgba(16, 185, 129, 0.1);
    border-color: var(--primary-color);
}

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

.sheet-card-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.4s ease;
}

.sheet-card:hover .sheet-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.sheet-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.sheet-card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.sheet-card-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.sheet-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sheet-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.sheet-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.back-to-selection-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.back-to-selection-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    transform: translateX(-4px);
}

.tracker-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Tracker Page */
.tracker-page {
    position: relative;
    animation: fade-in-scale 0.5s ease-out;
}

.tracker-search {
    margin-bottom: 1.5rem;
}

.search-group {
    width: 100%;
}

.sticky-panel {
    position: sticky;
    top: 80px;
    background: var(--bg-card);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.today-stats {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    flex-wrap: wrap;
}

.today-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.today-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.today-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.select-input,
.form-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.select-input:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.problems-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.problem-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.problem-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
    border-radius: 12px 0 0 12px;
}

.problem-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(8px);
    border-color: var(--primary-color);
}

.problem-item:hover::before {
    transform: scaleY(1);
}

.problem-item.solved {
    opacity: 0.7;
}

.problem-item.highlighted {
    box-shadow: 0 0 0 2px var(--secondary-color), var(--shadow-lg);
    transform: translateX(4px);
}

.problem-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.problem-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.problem-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.problem-tag {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tag-sheet {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.tag-sheet:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.tag-topic {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.tag-topic:hover {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
}

.problem-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.problem-link-button:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.problem-link-button svg {
    display: block;
}

/* Difficulty badges */
.difficulty-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.difficulty-easy {
    color: #22c55e;
    background-color: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
}

.difficulty-medium {
    color: #f97316;
    background-color: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.35);
}

.difficulty-hard {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-card);
    box-shadow: var(--shadow);
}

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

.btn-danger:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: var(--bg-secondary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Heatmap Page */
.heatmap-page {
    padding-bottom: 2rem;
}

.heatmap-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.heatmap-stat {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.heatmap-stat::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.heatmap-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.heatmap-stat:hover::before {
    opacity: 1;
}

.heatmap-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.heatmap-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.legend-squares {
    display: flex;
    gap: 3px;
}

.legend-square {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

.heatmap-container {
    overflow-x: auto;
    padding: 1rem 0;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(53, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    min-width: max-content;
}

.heatmap-square {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.1s ease;
    position: relative;
}

.heatmap-square:hover {
    transform: scale(1.3);
    z-index: 10;
}

.heatmap-tooltip {
    position: absolute;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.heatmap-tooltip.visible {
    opacity: 1;
}

/* Stats Page */
.stats-page {
    padding-bottom: 2rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.insight-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 16px 0 0 16px;
}

.insight-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.insight-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.insight-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.chart-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.chart-section:hover {
    box-shadow: var(--shadow-hover);
}

.chart-section h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.chart-container {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

.chart-container canvas {
    max-width: 100%;
    height: 100% !important;
}

/* Settings Page */
.settings-page {
    max-width: 800px;
}

.settings-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.settings-section:hover {
    box-shadow: var(--shadow-hover);
}

.settings-section.danger {
    border-color: var(--danger-color);
}

.settings-section h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-item label {
    color: var(--text-primary);
    font-weight: 500;
}

.theme-toggle {
    display: flex;
    gap: 0.5rem;
}

.theme-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.theme-btn:hover {
    background-color: var(--bg-card);
}

.danger-text {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stat-card {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }
.stat-card:nth-child(6) { animation-delay: 0.6s; }
.stat-card:nth-child(7) { animation-delay: 0.7s; }

.dashboard-section {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.problem-item {
    animation: slideIn 0.4s ease-out;
    animation-fill-mode: both;
}

.problem-item:nth-child(odd) {
    animation-delay: 0.05s;
}

.problem-item:nth-child(even) {
    animation-delay: 0.1s;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        width: 100%;
        justify-content: space-around;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .heatmap-grid {
        grid-template-columns: repeat(26, 1fr);
    }

    .mini-heatmap {
        grid-template-columns: repeat(15, 1fr);
    }

    .today-stats {
        justify-content: space-between;
    }

    .controls {
        flex-direction: column;
    }

    .control-group {
        width: 100%;
    }

    .select-input,
    .form-input {
        width: 100%;
    }
}

/* Heatmap Color Levels */
.heatmap-level-0 {
    background-color: var(--bg-secondary);
}

.heatmap-level-1 {
    background-color: #9be9a8;
}

.heatmap-level-2 {
    background-color: #40c463;
}

.heatmap-level-3 {
    background-color: #30a14e;
}

.heatmap-level-4 {
    background-color: #216e39;
}

[data-theme="dark"] .heatmap-level-1 {
    background-color: #0e4429;
}

[data-theme="dark"] .heatmap-level-2 {
    background-color: #006d32;
}

[data-theme="dark"] .heatmap-level-3 {
    background-color: #26a641;
}

[data-theme="dark"] .heatmap-level-4 {
    background-color: #39d353;
}

