:root {
  /* Material Design 3 Green Color System */
  --md-sys-color-primary: #2e7d32;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #a8f5a3;
  --md-sys-color-on-primary-container: #002204;
  
  --md-sys-color-secondary: #52634f;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #d4e8cf;
  --md-sys-color-on-secondary-container: #101f10;
  
  --md-sys-color-tertiary: #38656a;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #bcebf1;
  --md-sys-color-on-tertiary-container: #002023;
  
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;
  
  --md-sys-color-success: #2e7d32;
  --md-sys-color-warning: #f57c00;
  --md-sys-color-info: #1976d2;
  
  --md-sys-color-background: #fdfdf5;
  --md-sys-color-on-background: #1a1c18;
  --md-sys-color-surface: #fdfdf5;
  --md-sys-color-on-surface: #1a1c18;
  --md-sys-color-surface-variant: #dee5d8;
  --md-sys-color-on-surface-variant: #424940;
  --md-sys-color-outline: #737970;
  --md-sys-color-outline-variant: #c2c9bd;
  
  /* Surface Containers */
  --md-sys-color-surface-dim: #ddddd6;
  --md-sys-color-surface-bright: #fdfdf5;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f7f7ef;
  --md-sys-color-surface-container: #f1f1ea;
  --md-sys-color-surface-container-high: #ebebe4;
  --md-sys-color-surface-container-highest: #e6e6de;
  
  /* Legacy mappings for compatibility */
  --primary-color: var(--md-sys-color-primary);
  --primary-dark: #1b5e20;
  --primary-light: #66bb6a;
  --secondary-color: var(--md-sys-color-surface-container-low);
  --accent-color: var(--md-sys-color-tertiary);
  --accent-light: #4db6ac;
  --danger-color: var(--md-sys-color-error);
  --danger-light: #ff6b6b;
  --warning-color: var(--md-sys-color-warning);
  --warning-light: #ffb74d;
  --success-color: var(--md-sys-color-success);
  --info-color: var(--md-sys-color-info);
  --text-primary: var(--md-sys-color-on-background);
  --text-secondary: var(--md-sys-color-on-surface-variant);
  --text-muted: var(--md-sys-color-outline);
  --bg-primary: var(--md-sys-color-background);
  --bg-secondary: var(--md-sys-color-surface-container-low);
  --bg-tertiary: var(--md-sys-color-surface-container);
  --border-color: var(--md-sys-color-outline-variant);
  --border-light: var(--md-sys-color-surface-container-high);
  
  /* Material Design 3 Elevations */
  --md-sys-elevation-level0: none;
  --md-sys-elevation-level1: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-level2: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-level3: 0px 1px 3px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-level4: 0px 2px 3px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-level5: 0px 4px 4px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15);
  
  --shadow-sm: var(--md-sys-elevation-level1);
  --shadow: var(--md-sys-elevation-level2);
  --shadow-lg: var(--md-sys-elevation-level3);
  --shadow-xl: var(--md-sys-elevation-level4);
  
  /* Material Design 3 Shape System */
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  
  --border-radius-sm: var(--md-sys-shape-corner-small);
  --border-radius: var(--md-sys-shape-corner-medium);
  --border-radius-lg: var(--md-sys-shape-corner-large);
  --border-radius-xl: var(--md-sys-shape-corner-extra-large);
  
  /* Material Motion */
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-duration-short1: 50ms;
  --md-sys-motion-duration-short2: 100ms;
  --md-sys-motion-duration-short3: 150ms;
  --md-sys-motion-duration-short4: 200ms;
  --md-sys-motion-duration-medium1: 250ms;
  --md-sys-motion-duration-medium2: 300ms;
  --md-sys-motion-duration-medium3: 350ms;
  --md-sys-motion-duration-medium4: 400ms;
  
  --transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  --transition-slow: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
  
  /* Glass effects with Green MD3 colors */
  --glass-bg: rgba(253, 253, 245, 0.7);
  --glass-border: rgba(115, 121, 112, 0.2);
  --glass-backdrop-blur: blur(20px);
  --glass-backdrop-saturate: saturate(180%);
}

[data-theme="dark"] {
  /* Material Design 3 Dark Green Color Scheme */
  --md-sys-color-primary: #7ee687;
  --md-sys-color-on-primary: #00390a;
  --md-sys-color-primary-container: #005313;
  --md-sys-color-on-primary-container: #a8f5a3;
  
  --md-sys-color-secondary: #b8ccb3;
  --md-sys-color-on-secondary: #243425;
  --md-sys-color-secondary-container: #3a4b3a;
  --md-sys-color-on-secondary-container: #d4e8cf;
  
  --md-sys-color-tertiary: #a0cfd4;
  --md-sys-color-on-tertiary: #003739;
  --md-sys-color-tertiary-container: #1e4e53;
  --md-sys-color-on-tertiary-container: #bcebf1;
  
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  
  --md-sys-color-background: #0f140e;
  --md-sys-color-on-background: #e2e3dc;
  --md-sys-color-surface: #0f140e;
  --md-sys-color-on-surface: #e2e3dc;
  --md-sys-color-surface-variant: #424940;
  --md-sys-color-on-surface-variant: #c2c9bd;
  --md-sys-color-outline: #8c938a;
  --md-sys-color-outline-variant: #424940;
  
  /* Dark Surface Containers */
  --md-sys-color-surface-dim: #0f140e;
  --md-sys-color-surface-bright: #353b33;
  --md-sys-color-surface-container-lowest: #0a0f09;
  --md-sys-color-surface-container-low: #181d16;
  --md-sys-color-surface-container: #1c211a;
  --md-sys-color-surface-container-high: #262b24;
  --md-sys-color-surface-container-highest: #31362e;
  
  /* Update legacy mappings for dark theme */
  --primary-color: var(--md-sys-color-primary);
  --primary-dark: #4caf50;
  --primary-light: var(--md-sys-color-primary-container);
  --secondary-color: var(--md-sys-color-surface-container-low);
  --accent-color: var(--md-sys-color-tertiary);
  --accent-light: var(--md-sys-color-tertiary-container);
  --danger-color: var(--md-sys-color-error);
  --danger-light: var(--md-sys-color-error-container);
  --warning-color: #ffb74d;
  --warning-light: #ff8f00;
  --success-color: #81c784;
  --info-color: #64b5f6;
  --text-primary: var(--md-sys-color-on-background);
  --text-secondary: var(--md-sys-color-on-surface-variant);
  --text-muted: var(--md-sys-color-outline);
  --bg-primary: var(--md-sys-color-background);
  --bg-secondary: var(--md-sys-color-surface-container-low);
  --bg-tertiary: var(--md-sys-color-surface-container);
  --border-color: var(--md-sys-color-outline-variant);
  --border-light: var(--md-sys-color-surface-container-high);
  --glass-bg: rgba(24, 29, 22, 0.7);
  --glass-border: rgba(140, 147, 138, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(
    135deg,
    var(--md-sys-color-background) 0%,
    var(--md-sys-color-surface-container-low) 50%,
    var(--md-sys-color-surface-container) 100%
  );
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  transition: var(--transition);
  min-height: 100vh;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  font-weight: 400;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at top left,
    rgba(46, 125, 50, 0.1) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at bottom right,
    rgba(56, 101, 106, 0.08) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: -1;
}

/* Material Design 3 Typography Scale */
.md-display-large {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: clamp(36px, 4vw, 57px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.25px;
}

.md-display-medium {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: clamp(28px, 3.5vw, 45px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: 0px;
}

.md-display-small {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: 0px;
}

.md-headline-large {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0px;
}

.md-headline-medium {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 500;
  line-height: 1.29;
  letter-spacing: 0px;
}

.md-headline-small {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 500;
  line-height: 1.33;
  letter-spacing: 0px;
}

.md-title-large {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 500;
  line-height: 1.27;
  letter-spacing: 0px;
}

.md-title-medium {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.15px;
}

.md-title-small {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.43;
  letter-spacing: 0.1px;
}

.md-body-large {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

.md-body-medium {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  letter-spacing: 0.25px;
}

.md-body-small {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.33;
  letter-spacing: 0.4px;
}

.md-label-large {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.43;
  letter-spacing: 0.1px;
}

.md-label-medium {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.33;
  letter-spacing: 0.5px;
}

.md-label-small {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.5px;
}

/* Glass Navigation Bar */
.navbar {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop-blur);
  -webkit-backdrop-filter: var(--glass-backdrop-blur);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-left: none;
  border-right: none;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(46, 125, 50, 0.05) 0%,
    rgba(56, 101, 106, 0.03) 50%,
    rgba(46, 125, 50, 0.05) 100%
  );
  pointer-events: none;
  border-radius: inherit;
}

.nav-brand h1 {
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.nav-brand .material-icons {
  font-size: 32px;
  color: var(--md-sys-color-primary);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.nav-menu {
  display: flex;
  gap: 4px;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.nav-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  pointer-events: none;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 10px 16px;
  border-radius: var(--md-sys-shape-corner-large);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  color: var(--md-sys-color-on-surface-variant);
  font-family: 'Roboto', system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  position: relative;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  overflow: hidden;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: currentColor;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.nav-btn:hover::before {
  opacity: 0.08;
}

.nav-btn:hover {
  color: var(--md-sys-color-on-surface);
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
  background: linear-gradient(135deg, 
    rgba(46, 125, 50, 0.8), 
    rgba(46, 125, 50, 0.6)
  );
  color: var(--md-sys-color-on-primary);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 
    0 4px 12px rgba(46, 125, 50, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-btn.active::before {
  opacity: 0;
}

.nav-btn .material-icons {
  font-size: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.theme-toggle {
  margin-left: 8px;
  width: 40px;
  height: 40px;
  border-radius: var(--md-sys-shape-corner-large);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: var(--md-sys-color-on-surface-variant);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-lg);
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - 88px);
}

.main-content {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 88px);
  background: var(--md-sys-color-background);
}

.tab-content {
  display: none;
  animation: slideInUp var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.tab-content.active {
  display: block;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Dashboard */
.dashboard-header {
  text-align: center;
  margin-bottom: 48px;
}

.dashboard-header h2 {
  color: var(--md-sys-color-on-surface);
  margin-bottom: 12px;
}

.dashboard-header p {
  color: var(--md-sys-color-on-surface-variant);
}

.dashboard-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 24px 20px;
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
}

.dashboard-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(46, 125, 50, 0.3);
}

.dashboard-card h3 {
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1px;
}

.progress-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat-number {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  color: var(--md-sys-color-outline);
  font-size: 14px;
  font-weight: 400;
  text-align: center;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stats-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 24px 20px;
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
}

.stats-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(46, 125, 50, 0.3);
}

.stats-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--md-sys-color-secondary), var(--md-sys-color-primary));
}

.stats-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--md-sys-color-tertiary), var(--md-sys-color-secondary));
}

.stats-card:nth-child(4)::before {
  background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-primary-container));
}

.stats-card h3 {
  color: var(--md-sys-color-on-surface-variant);
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.43;
  letter-spacing: 0.1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.stat-number {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-card:nth-child(2) .stat-number {
  background: linear-gradient(135deg, var(--md-sys-color-secondary), var(--md-sys-color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-card:nth-child(3) .stat-number {
  background: linear-gradient(135deg, var(--md-sys-color-tertiary), var(--md-sys-color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-card:nth-child(4) .stat-number {
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-primary-container));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-card p {
  color: var(--md-sys-color-outline);
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  letter-spacing: 0.25px;
}

.quick-actions, .recent-activity {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 32px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 32px;
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.quick-actions::before, .recent-activity::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(46, 125, 50, 0.05) 0%,
    rgba(56, 101, 106, 0.03) 50%,
    rgba(46, 125, 50, 0.05) 100%
  );
  pointer-events: none;
}

.quick-actions h3, .recent-activity h3 {
  margin-bottom: 24px;
  color: var(--md-sys-color-on-surface);
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.33;
  letter-spacing: 0px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.quick-actions h3 .material-icons, .recent-activity h3 .material-icons {
  font-size: 28px;
  color: var(--md-sys-color-primary);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  position: relative;
  z-index: 1;
}

.action-btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-slow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  box-shadow: var(--shadow);
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.action-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.action-btn.secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.activity-list {
  max-height: 200px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.activity-item {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.43;
  color: var(--md-sys-color-on-surface);
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--md-sys-shape-corner-small);
}

.no-activity {
  text-align: center;
  color: var(--md-sys-color-outline);
  padding: 24px;
  font-style: italic;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--md-sys-shape-corner-medium);
  margin: 0;
}

.empty-state {
  text-align: center;
  color: var(--md-sys-color-outline);
  padding: 48px 32px;
  font-style: italic;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: var(--md-sys-shape-corner-large);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  margin: 16px 0;
  transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
  position: relative;
  z-index: 1;
}

.empty-state:hover {
  border-color: rgba(46, 125, 50, 0.4);
  color: var(--md-sys-color-on-surface-variant);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

/* Material Design 3 Button Components */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--md-sys-shape-corner-large);
  cursor: pointer;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.1px;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  overflow: hidden;
  min-height: 40px;
  box-sizing: border-box;
}

/* State Layer for Material Design 3 */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: currentColor;
  opacity: 0;
  border-radius: inherit;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.btn:hover::before {
  opacity: 0.08;
}

.btn:focus::before {
  opacity: 0.12;
}

.btn:active::before {
  opacity: 0.12;
}

/* Material Design 3 Button Variants */
.btn.primary, .btn.filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-level1);
}

.btn.primary:hover, .btn.filled:hover {
  box-shadow: var(--md-sys-elevation-level2);
}

.btn.primary:focus, .btn.filled:focus {
  box-shadow: var(--md-sys-elevation-level1);
}

.btn.primary:active, .btn.filled:active {
  box-shadow: var(--md-sys-elevation-level1);
}

.btn.secondary, .btn.outlined {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
  box-shadow: none;
}

.btn.secondary:hover, .btn.outlined:hover {
  background-color: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
}

.btn.text {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  box-shadow: none;
  padding: 10px 12px;
}

.btn.text:hover {
  background-color: var(--md-sys-color-primary-container);
}

.btn.tonal, .btn.filled-tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  box-shadow: none;
}

.btn.tonal:hover, .btn.filled-tonal:hover {
  box-shadow: var(--md-sys-elevation-level1);
}

.btn.danger, .btn.error {
  background-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  box-shadow: var(--md-sys-elevation-level1);
}

.btn.danger:hover, .btn.error:hover {
  box-shadow: var(--md-sys-elevation-level2);
}

/* Button Sizes */
.btn.small {
  padding: 6px 16px;
  font-size: 12px;
  min-height: 32px;
  border-radius: var(--md-sys-shape-corner-medium);
}

.btn.large {
  padding: 14px 32px;
  font-size: 16px;
  min-height: 48px;
}

/* Material Design 3 Card Components with Glass Effects */
.md-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-sys-shape-corner-medium);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  overflow: hidden;
  position: relative;
}

.md-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  pointer-events: none;
}

.md-card.elevated {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.md-card.elevated:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.2);
}

.md-card.filled {
  background-color: var(--md-sys-color-surface-container-highest);
  box-shadow: none;
}

.md-card.outlined {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: none;
}

.md-card-header {
  padding: 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.md-card-title {
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 28px;
  color: var(--md-sys-color-on-surface);
  margin: 0;
}

.md-card-subtitle {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 4px 0 0 0;
}

.md-card-content {
  padding: 16px;
}

.md-card-actions {
  padding: 8px 16px 16px 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

/* Interactive Cards */
.md-card.clickable {
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.md-card.clickable::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--md-sys-color-on-surface);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.md-card.clickable:hover::before {
  opacity: 0.08;
}

.md-card.clickable:focus::before {
  opacity: 0.12;
}

.md-card.clickable:active::before {
  opacity: 0.12;
}

/* Material Design 3 Text Fields */
.md-text-field {
  position: relative;
  margin: 8px 0;
}

.md-text-field input,
.md-text-field textarea {
  width: 100%;
  padding: 16px 12px 8px 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  box-sizing: border-box;
}

.md-text-field input:focus,
.md-text-field textarea:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  padding-left: 15px;
  padding-right: 11px;
}

.md-text-field label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  pointer-events: none;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  background-color: var(--md-sys-color-surface-container-highest);
  padding: 0 4px;
}

.md-text-field input:focus + label,
.md-text-field input:not(:placeholder-shown) + label,
.md-text-field textarea:focus + label,
.md-text-field textarea:not(:placeholder-shown) + label {
  top: -8px;
  left: 12px;
  font-size: 12px;
  color: var(--md-sys-color-primary);
}

/* Material Design 3 Chips */
.md-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--md-sys-shape-corner-small);
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  border: 1px solid var(--md-sys-color-outline);
  background-color: transparent;
  color: var(--md-sys-color-on-surface-variant);
  position: relative;
  overflow: hidden;
}

.md-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: currentColor;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.md-chip:hover::before {
  opacity: 0.08;
}

.md-chip.selected {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}

.md-chip.elevated {
  background-color: var(--md-sys-color-surface-container-low);
  border: none;
  box-shadow: var(--md-sys-elevation-level1);
}

/* Floating Action Button (FAB) */
.fab {
  width: 56px;
  height: 56px;
  border-radius: var(--md-sys-shape-corner-large);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--md-sys-elevation-level3);
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  position: relative;
  overflow: hidden;
}

.fab:hover {
  box-shadow: var(--md-sys-elevation-level4);
}

.fab.small {
  width: 40px;
  height: 40px;
}

.fab.large {
  width: 96px;
  height: 96px;
}

/* Disabled State */
.btn:disabled {
  background-color: var(--md-sys-color-on-surface);
  color: var(--md-sys-color-surface);
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.btn:disabled::before {
  display: none;
}

/* Enhanced Flashcards */
.flashcards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.flashcards-header h2 {
  color: var(--md-sys-color-on-surface);
  margin: 0;
}

.flashcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem 0;
}

.flashcard-header h2 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.flashcard-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.deck-selection {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.deck-selection label {
  font-weight: 600;
  color: var(--text-primary);
}

.deck-selection select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 500;
  transition: var(--transition);
  min-width: 200px;
}

.deck-selection select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.review-area {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--glass-border);
}

.card-container {
  perspective: 1000px;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

.flashcard {
  width: 100%;
  max-width: 600px;
  height: 350px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.card-front {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
}

.card-back {
  background: linear-gradient(135deg, var(--accent-color), var(--success-color));
  color: white;
  transform: rotateY(180deg);
}

.card-content {
  font-size: 1.5rem;
  text-align: center;
  line-height: 1.4;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flip-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  padding: 1rem 2rem;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-slow);
  font-size: 1rem;
  box-shadow: var(--shadow);
}

.flip-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.review-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.review-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-slow);
  color: white;
  font-size: 1rem;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.review-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.review-btn:hover::before {
  left: 100%;
}

.review-btn.hard {
  background: linear-gradient(135deg, var(--danger-color), var(--danger-light));
  box-shadow: var(--shadow);
}

.review-btn.good {
  background: linear-gradient(135deg, var(--warning-color), var(--warning-light));
  box-shadow: var(--shadow);
}

.review-btn.easy {
  background: linear-gradient(135deg, var(--accent-color), var(--success-color));
  box-shadow: var(--shadow);
}

.review-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-xl);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card-item {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition-slow);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

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

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

.card-item-front {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.card-item-back {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.card-item-tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  padding: 0.3rem 0.75rem;
  border-radius: var(--border-radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Notes */
.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.notes-header h2 {
  color: var(--md-sys-color-on-surface);
  margin: 0;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  min-height: 200px;
}

.notes-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  min-height: 500px;
}

.notes-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.search-bar input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.notes-list {
  max-height: 400px;
  overflow-y: auto;
}

.note-item {
  position: relative;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.note-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--subject-color, var(--primary-color));
  border-radius: 0 2px 2px 0;
}

.note-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.note-subject-tag {
  background: var(--subject-color, var(--primary-color));
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
}

.note-topic-tag {
  background: var(--secondary-color);
  color: var(--text-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  font-size: 0.7rem;
  margin-left: 0.25rem;
}

.subject-selector,
.topic-selector {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.subject-selector label,
.topic-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.subject-selector select,
.topic-selector select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.topic-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topic-selector .btn.small {
  align-self: flex-start;
}

.note-meta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.note-organization {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.note-organization select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Flashcard Subject Organization */
.flashcard-filters {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 24px;
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
}

.filter-group label {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  font-weight: 500;
}

.filter-group select,
.filter-group input {
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  background: rgba(255, 255, 255, 0.1);
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--md-sys-shape-corner-small);
  border: 1px solid var(--md-sys-color-outline);
  background: rgba(255, 255, 255, 0.1);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: var(--transition);
}

.btn-sm:hover {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.flashcard-stats {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 24px;
  border-radius: var(--md-sys-shape-corner-medium);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 24px;
  display: flex;
  gap:  32px;
  align-items: center;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-label {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  font-weight: 500;
}

.stat-value {
  color: var(--md-sys-color-primary);
  font-size: 18px;
  font-weight: 600;
}

.review-section {
  margin-bottom: 32px;
}

.review-section h3 {
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
}

.subject-list {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 24px;
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.no-cards {
  text-align: center;
  color: var(--md-sys-color-outline);
  padding: 24px;
  font-style: italic;
  margin: 0;
}

.no-cards a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  font-weight: 500;
}

.no-cards a:hover {
  text-decoration: underline;
}

.flashcard-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Modal and Form Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: var(--md-sys-elevation-level4);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
}

.modal-header {
  padding: 24px 24px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: var(--md-sys-color-on-surface);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--md-sys-shape-corner-small);
  color: var(--md-sys-color-on-surface-variant);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 0 24px 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--md-sys-color-outline);
}

/* Timer Tab */
.timer-header {
  text-align: center;
  margin-bottom: 32px;
}

.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 500px;
  margin: 0 auto;
  padding: 32px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop-blur);
  -webkit-backdrop-filter: var(--glass-backdrop-blur);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

.timer-display {
  position: relative;
  width: 300px;
  height: 300px;
  margin-bottom: 16px;
}

.timer-circle {
  position: relative;
  width: 100%;
  height: 100%;
}

#timer-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* Start from the top */
}

.timer-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  color: var(--text-primary);
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: 72px;
  font-weight: 500;
}

.timer-colon {
  margin: 0 4px;
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.timer-controls {
  display: flex;
  gap: 16px;
}

.timer-controls .btn {
  min-width: 140px;
}

.timer-settings {
  display: flex;
  gap: 24px;
  width: 100%;
  justify-content: center;
}

.setting-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setting-group label {
  font-size: 14px;
  color: var(--text-secondary);
}

.setting-group input {
  width: 80px;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-align: center;
  font-size: 16px;
}

.timer-stats {
  display: flex;
  gap: 32px;
  text-align: center;
  margin-top: 16px;
}

.timer-stats .stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timer-stats .stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.timer-stats .stat-value {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
}
