/* Goroutinely - Design System CSS */
/* Based on DESIGN.md specification */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - EXACT Bento Colors (from /tmp/bento/website/src/css/custom.css) */
  --bg-warm: #FFF4E9;          /* Main background - Bento's exact warm cream */
  --bg-card: #ffffff;          /* Card background - pure white */
  --bg-surface: #FDE5D8;       /* Surface background - Bento's exact light peach */
  --bg-mantle: #FCE9D6;        /* Code/mantle background - peachy cream */

  /* Primary Colors (EXACT Bento pink/coral palette) */
  --color-primary: #FFBCBA;    /* Primary solid color - Bento exact */
  --color-secondary: #ffe6d0;  /* Secondary color - Bento tabs color */
  --color-primary-dark: #FFA7A5;   /* Bento's lighter pink variant */
  --color-primary-darker: #EB8788; /* Bento's coral red */
  --color-primary-darkest: #E89896; /* Bento's button active state */
  --color-primary-light: #ffccc9;
  --color-primary-lighter: #ffd6d4;
  --color-primary-lightest: #ffe5e3;

  /* Button Colors (EXACT Bento button palette) */
  --btn-bg: #ffbcba9e;         /* Button background with alpha - Bento exact */
  --btn-border: #FFBCBA;       /* Button border - primary */
  --btn-shadow: #E8908E;       /* Button shadow - Bento exact */
  --btn-hover: #FFA7A5;        /* Button hover state */
  --btn-active: #E89896;       /* Button active/pressed state - Bento exact */
  --btn-shadow-hover: #d67573; /* Hover/active shadow color - Bento exact */

  /* Text Colors (EXACT Bento) */
  --color-text: #553630;       /* Bento's heading/text color - exact */
  --color-text-base: #333;     /* Base text color - Bento exact */
  --color-text-dark: #3a2623;  /* Darker text - Bento exact */
  --color-neutral: #8b7b76;    /* Lighter brown - softer contrast */

  /* Mood Colors (1-5) - Pastel rainbow for pixels */
  --mood-1: #ffb3ba;  /* Pastel Rose - worst mood */
  --mood-2: #ffbe76;  /* Mango Orange - low mood */
  --mood-3: #95e1d3;  /* Sea Foam - neutral */
  --mood-4: #bae1ff;  /* Pastel Sky - good mood */
  --mood-5: #e0bbff;  /* Pastel Lilac - best mood */

  /* Habit Color Palette - for habit indicators */
  --habit-color-1: #F5B5A8;  /* Soft coral */
  --habit-color-2: #C5AED4;  /* Soft lavender */
  --habit-color-3: #FFB88C;  /* Soft orange */
  --habit-color-4: #A8D5BA;  /* Soft green */
  --habit-color-5: #A8C5D4;  /* Soft blue */
  --habit-color-6: #E0BBE4;  /* Soft purple */
  --habit-color-7: #FFD4A8;  /* Soft peach */

  /* Stat Card Colors */
  --stat-success-bg: #b5ead7;  /* Light green for positive stats */
  --stat-success-text: #3d7a5e; /* Dark green text */
  --stat-warning-bg: #ffd4a3;  /* Light orange for neutral stats */
  --stat-warning-text: #8b6b3d; /* Dark orange text */

  /* Semantic Colors */
  --status-success: var(--mood-4);  /* Blue - positive */
  --status-warning: var(--mood-2);  /* Orange - caution */
  --status-error: var(--mood-1);    /* Pink - negative */

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Softer Shadows (Bento-style) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

  /* Typography (Bento-style clean fonts) */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --text-3xl: 30px;
  --text-2xl: 24px;
  --text-xl: 20px;
  --text-base: 16px;
  --text-sm: 14px;
  --text-xs: 12px;

  --line-relaxed: 1.625;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-warm: #1e1e2e;
  --bg-card: #181825;
  --bg-surface: #11111b;
  --bg-mantle: #181825;

  --color-primary: #FFBCBA;    /* Keep primary pink in dark mode */
  --color-secondary: #ffe6d0;  /* Secondary peachy color */
  --color-accent: #FFBCBA;
  --color-text: #e6e6e6;       /* Brighter text for better contrast */
  --color-neutral: #b4b4b4;    /* Lighter neutral text */

  /* Stat card colors for dark mode */
  --stat-success-text: #a6e3a1; /* Brighter green */
  --stat-warning-text: #fab387; /* Brighter orange */

  /* Dark theme uses same distinct mood colors for consistency */
}

/* Admin Dashboard Styles */
.admin-table {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  gap: var(--space-md);
  transition: all 150ms ease;
}

.admin-user-row:hover {
  background: var(--bg-mantle);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
}

.admin-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.admin-user-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
}

.admin-user-email {
  font-size: var(--text-sm);
  color: var(--color-neutral);
}

.admin-user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  color: var(--color-neutral);
  margin-top: 0.25rem;
}

.admin-user-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.activity-time {
  font-size: var(--text-xs);
  color: var(--color-neutral);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}

/* Responsive Admin Layout */
@media (max-width: 768px) {
  .admin-user-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-user-actions {
    width: 100%;
  }

  .admin-user-actions button {
    flex: 1;
  }
}

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

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: 1.4;  /* Bento uses tighter line height */
  color: var(--color-text-base);
  background-color: var(--bg-warm);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);  /* Bento's brown heading color */
}

h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.4;
}

small {
  font-size: var(--text-sm);
}

/* Layout */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.page-header h1 {
  margin: 0;
  font-size: var(--text-3xl);
}

.page-header-actions {
  display: flex;
  gap: var(--space-sm);
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .page-header-actions {
    width: 100%;
  }

  .page-header-actions .btn {
    flex: 1;
  }
}

@media (min-width: 768px) {
  .container {
    padding: var(--space-2xl) var(--space-xl);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 900px;
    padding: var(--space-2xl);
  }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background-color: rgba(255, 188, 186, 0.04);
  border-bottom: 1px solid rgba(255, 188, 186, 0.15);
  box-shadow: 0 1px 3px rgba(255, 167, 165, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.header-gopher {
  width: 32px;
  height: 32px;
  background-image: url('../../static/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.header-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
  transition: all 200ms ease;
  position: relative;
  border: 1px solid rgba(255, 188, 186, 0.1);
}

.card:hover {
  box-shadow: 0 2px 8px rgba(255, 167, 165, 0.12);
  transform: translateY(-1px);
  border-color: rgba(255, 188, 186, 0.2);
}

.card-compact {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: var(--text-base);
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  font-family: var(--font-heading);
  gap: var(--space-sm);
  position: relative;
}

.btn:focus-visible {
  outline: 2px solid #d32f2f;
  outline-offset: 2px;
}

.btn-primary {
  background-color: #ffbcba9e;  /* Exact Bento color with alpha */
  border: 2px solid #FFBCBA;
  box-shadow: 0 6px 0 #E8908E;
  color: #333;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.75rem 2rem;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background-color: #FFA7A5;
  border-color: #FFA7A5;
  box-shadow: 0 8px 0 #D67573;
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #D67573;
  background-color: #E89896;
  transition: all 0.05s ease-in;
}

.btn-outline {
  background: rgba(255, 188, 186, 0.2);  /* Translucent pink like Bento secondary */
  color: var(--color-text);
  border: 2px solid #FFBCBA;
  border-radius: 6px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  box-shadow: 0 6px 0 #E8908E;  /* Pink shadow */
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.btn-outline:hover {
  background: rgba(255, 188, 186, 0.3);
  color: var(--color-text);
  box-shadow: 0 8px 0 #D67573;
  transform: translateY(-2px);
}

.btn-outline:active {
  background: rgba(255, 188, 186, 0.4);
  color: var(--color-text);
  transform: translateY(4px);  /* Press down */
  box-shadow: 0 2px 0 #D67573;  /* Compressed shadow */
  transition: transform 0.05s ease-in, box-shadow 0.05s ease-in;
}

.btn-secondary {
  background: rgba(255, 188, 186, 0.08);
  color: var(--color-text);
  border: 2px solid rgba(255, 188, 186, 0.3);
  border-radius: 6px;
  padding: 0.75rem 2rem;
  font-weight: 500;
  box-shadow: 0 6px 0 rgba(255, 188, 186, 0.2);
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s, border-color 0.3s;
}

.btn-secondary:hover {
  background: rgba(255, 167, 165, 0.15);
  border-color: rgba(255, 167, 165, 0.5);
  box-shadow: 0 8px 0 rgba(255, 167, 165, 0.3);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #bdbdbd;
  transition: transform 0.05s ease-in, box-shadow 0.05s ease-in;
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background-color: var(--bg-surface);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-ghost:active {
  background-color: var(--bg-mantle);
}

.btn-accent {
  background-color: var(--color-accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-sm);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Month Card */
.month-card {
  position: relative;
  overflow: hidden;
  background-color: white;
}

.month-card > * {
  position: relative;
  z-index: 1;
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.month-title {
  font-size: var(--text-xl);
  font-weight: 700;
}

.month-gopher {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #E89896 0%, #FFD6AF 100%);
  border-radius: var(--radius-sm);
  opacity: 0.8;
  box-shadow: 0 2px 8px rgba(232, 152, 150, 0.3);
}

/* Pixel Grid */
.pixel-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.weekday-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.weekday-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  color: #7f8a9d;
  letter-spacing: 0.5px;
}

.pixel {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
}

.pixel:hover {
  transform: scale(1.1) rotate(2deg);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Pixel States */
.pixel-empty-past {
  background-color: transparent;
  border-color: var(--color-neutral);
}

.pixel-empty-future {
  background-color: var(--bg-mantle);
  cursor: not-allowed;
  opacity: 0.5;
}

.pixel-today {
  box-shadow: 0 0 0 3px var(--color-text);  /* Ring around today */
}

.pixel-rated-1 {
  background-color: var(--mood-1);
  color: #c44856;
  font-weight: 700;
}
.pixel-rated-2 {
  background-color: var(--mood-2);
  color: #d47d2e;
  font-weight: 700;
}
.pixel-rated-3 {
  background-color: var(--mood-3);
  color: #3a9b87;
  font-weight: 700;
}
.pixel-rated-4 {
  background-color: var(--mood-4);
  color: #4a7ab3;
  font-weight: 700;
}
.pixel-rated-5 {
  background-color: var(--mood-5);
  color: #9858d9;
  font-weight: 700;
}

/* Mood Rating Selector */
.mood-selector {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin: var(--space-lg) 0;
}

.mood-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 3px solid transparent;
  font-size: var(--text-xl);
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood-btn:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.mood-btn.selected {
  border-color: var(--color-text);
  transform: scale(1.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.mood-btn-1 {
  background: linear-gradient(135deg, var(--mood-1) 0%, rgba(255, 179, 186, 0.8) 100%);
  color: #8b4a52;
}
.mood-btn-2 {
  background: linear-gradient(135deg, var(--mood-2) 0%, rgba(255, 212, 163, 0.8) 100%);
  color: #8b6b3d;
}
.mood-btn-3 {
  background: linear-gradient(135deg, var(--mood-3) 0%, rgba(181, 234, 215, 0.8) 100%);
  color: #3d7a5e;
}
.mood-btn-4 {
  background: linear-gradient(135deg, var(--mood-4) 0%, rgba(186, 225, 255, 0.8) 100%);
  color: #3d5a7a;
}
.mood-btn-5 {
  background: linear-gradient(135deg, var(--mood-5) 0%, rgba(224, 187, 255, 0.8) 100%);
  color: #6a3d9d;
}

/* Habit List */
.habit-list {
  display: flex;
  flex-direction: column;
}

.habit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid rgba(255, 188, 186, 0.1);
  min-height: 64px;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

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

.habit-item:hover {
  background-color: rgba(255, 188, 186, 0.05);
  border-color: rgba(255, 188, 186, 0.2);
}

.habit-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
}

.habit-indicator {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Soft habit indicator colors (Bento-style) */
.habit-indicator-1 { background-color: #F5B5A8; }  /* Soft coral */
.habit-indicator-2 { background-color: #C5AED4; }  /* Soft lavender */
.habit-indicator-3 { background-color: #FFB88C; }  /* Soft orange */
.habit-indicator-4 { background-color: #A8D5BA; }  /* Soft green */
.habit-indicator-5 { background-color: #A8C5D4; }  /* Soft blue */
.habit-indicator-6 { background-color: #E0BBE4; }  /* Soft purple */
.habit-indicator-7 { background-color: #FFD4A8; }  /* Soft peach */

.habit-indicator-negative {
  background-color: transparent;
  border: 2px solid currentColor;
}

/* Stat Cards */
.stat-card {
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-md);
}

.stat-card-success {
  background: var(--stat-success-bg);
}

.stat-card-success .stat-value,
.stat-card-success .stat-label {
  color: var(--stat-success-text);
}

.stat-card-warning {
  background: var(--stat-warning-bg);
}

.stat-card-warning .stat-value,
.stat-card-warning .stat-label {
  color: var(--stat-warning-text);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
}

.stat-label {
  font-size: 0.875rem;
}

/* Color Picker Buttons */
.color-picker {
  display: flex;
  gap: 0.5rem;
}

.color-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.selected {
  border-color: var(--color-text);
  border-width: 2px;
}

.color-btn-1 { background: var(--habit-color-1); }
.color-btn-2 { background: var(--habit-color-2); }
.color-btn-3 { background: var(--habit-color-3); }
.color-btn-4 { background: var(--habit-color-4); }
.color-btn-5 { background: var(--habit-color-5); }

/* Streak Badge */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  background: var(--stat-warning-bg);
  color: var(--stat-warning-text);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.streak-badge.streak-high {
  background: var(--stat-success-bg);
  color: var(--stat-success-text);
}

.streak-icon {
  font-size: 0.875rem;
}

.habit-emoji {
  font-size: var(--text-xl);
}

.habit-name {
  font-weight: 600;
}

.habit-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.habit-value {
  font-size: var(--text-sm);
  color: var(--color-neutral);
}

.habit-checkbox {
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-neutral);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms ease;
}

.habit-checkbox.checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(255, 188, 186, 0.15);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  padding: var(--space-sm) var(--space-md);
  z-index: 100;
  height: 72px;
  box-shadow: 0 -1px 3px rgba(255, 167, 165, 0.08);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-neutral);
  transition: all 150ms ease;
  min-width: 80px;
}

.nav-item.active {
  background: rgba(255, 188, 186, 0.204);
  color: #944c4b;
  box-shadow: 0 2px 8px rgba(255, 167, 165, 0.15);
}

.nav-item:hover {
  background-color: rgba(255, 167, 165, 0.1);
  transform: translateY(-2px);
}

.nav-icon {
  font-size: 24px;
}

.nav-label {
  font-size: var(--text-xs);
  font-weight: 600;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 88px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: #ffbcba9e;
  border: 2px solid #FFBCBA;
  color: #553630;
  box-shadow: 0 4px 12px rgba(255, 167, 165, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  z-index: 99;
  transition: all 200ms ease;
}

.fab:hover {
  transform: scale(1.05);
  background: #FFA7A5;
  border-color: #FFA7A5;
  box-shadow: 0 6px 16px rgba(255, 167, 165, 0.4);
}

.fab:active {
  transform: scale(0.95);
}

.fab.expanded {
  transform: rotate(45deg);
}

/* FAB Menu */
.fab-menu {
  position: fixed;
  bottom: 88px;
  right: 16px;
  z-index: 98;
  display: none;
}

.fab-menu.active {
  display: block;
}

.fab-menu-item {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 200ms ease;
  opacity: 0;
  transform: scale(0.8);
}

.fab-menu.active .fab-menu-item {
  opacity: 1;
  transform: scale(1);
}

.fab-menu-item:nth-child(1) {
  background: linear-gradient(135deg, #78dce8 0%, #ffd866 100%);
  box-shadow: 0 4px 16px rgba(120, 220, 232, 0.4);
  bottom: 60px;
  right: 60px;
  transition-delay: 0ms;
}

.fab-menu-item:nth-child(2) {
  background: linear-gradient(135deg, #FFD6AF 0%, #a9dc76 100%);
  box-shadow: 0 4px 16px rgba(255, 214, 175, 0.4);
  bottom: 110px;
  right: 20px;
  transition-delay: 50ms;
}

/* Bottom Sheet */
.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 250ms ease;
}

.bottom-sheet-overlay.active {
  display: block;
  opacity: 1;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-lg);
  z-index: 201;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 250ms ease-out;
}

.bottom-sheet.active {
  transform: translateY(0);
}

.drag-handle {
  width: 40px;
  height: 4px;
  background-color: var(--color-neutral);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-lg);
}

.sheet-header {
  margin-bottom: var(--space-lg);
}

.sheet-date {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.sheet-section {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--bg-mantle);
}

.sheet-section-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--color-neutral);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--text-sm);
}

/* Gopher Illustrations */
.gopher-illustration {
  text-align: center;
  margin: var(--space-lg) 0;
}

.gopher-large {
  width: 120px;
  height: 120px;
  background-image: url('../../static/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin: 0 auto;
}

.gopher-medium {
  width: 80px;
  height: 80px;
  background-image: url('../../static/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin: 0 auto;
}

.gopher-small {
  width: 48px;
  height: 48px;
  background-image: url('../../static/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin: 0 auto;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
  background-image:
    radial-gradient(circle, rgba(181, 234, 215, 0.08) 2px, transparent 2px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.empty-state::before {
  content: '✨';
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 32px;
  opacity: 0.3;
  animation: sparkle 3s ease-in-out infinite;
}

.empty-state::after {
  content: '💖';
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 28px;
  opacity: 0.3;
  animation: sparkle 3s ease-in-out infinite 1.5s;
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  color: var(--color-neutral);
  margin-bottom: var(--space-lg);
}

/* Year Overview Grid Container */
.year-grid-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* Year Overview Grid */
.year-overview-page .container {
  max-width: 1400px;
}

.year-grid-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  display: inline-flex;
  gap: 3px;
  padding: 8px;
}

/* Day Number Labels Column (1-31) */
.year-dow-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.year-dow-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--color-neutral);
  text-align: center;
  line-height: 1;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
}

.year-dow-label:first-child {
  height: 40px;
  visibility: hidden;
}

/* Year Month Columns */
.year-month {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.year-month-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-neutral);
  text-align: center;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.year-pixels {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.year-pixel {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 150ms ease;
  flex-shrink: 0;
}

.year-pixel:hover {
  opacity: 0.8;
}

/* Ensure year grid fits on mobile */
@media (max-width: 480px) {
  .year-month-name {
    font-size: 0.5rem;
    min-width: 25px;
  }

  .year-month {
    padding: 2px;
  }

  .year-dow-label {
    font-size: 0.45rem;
  }
}

/* Stats Cards */
.stat-card {
  background: white;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid rgba(255, 167, 165, 0.15);
  transition: all 200ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 167, 165, 0.15);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-neutral);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Settings */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  gap: var(--space-md);
}

.setting-label {
  font-weight: 600;
  margin-bottom: 4px;
}

.setting-description {
  font-size: var(--text-sm);
  color: var(--color-neutral);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-mantle);
  transition: 0.3s;
  border-radius: var(--radius-full);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: var(--radius-full);
}

.toggle input:checked + .toggle-slider {
  background-color: var(--color-accent);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--text-base);
  font-family: var(--font-family);
  background-color: var(--bg-surface);
  border: 2px solid rgba(181, 234, 215, 0.3);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: all 150ms ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--mood-3);
  box-shadow: 0 0 0 3px rgba(181, 234, 215, 0.2);
  background-color: var(--bg-card);
}

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

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 300;
  display: none;
  opacity: 0;
  transition: opacity 250ms ease;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 250ms ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-title {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: transparent;
  border: none;
  color: var(--color-neutral);
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease;
}

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

.modal-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-neutral { color: var(--color-neutral); }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.pb-nav { padding-bottom: 88px; }

/* Sparkle Animation */
.sparkle {
  display: inline-block;
  opacity: 0.4;
  font-size: 0.75em;
  margin-left: 0.3rem;
  animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.5; }
}

/* Page Enter Animation */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

main {
  animation: pageEnter 400ms ease-out;
}

/* Habit Celebration */
@keyframes celebrate {
  0% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1); }
}

.habit-checkbox.checked {
  animation: celebrate 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Decorative Background Shapes */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: var(--radius-full);
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
}

body::before {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--mood-1) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  animation: float 15s ease-in-out infinite;
}

body::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--mood-5) 0%, transparent 70%);
  bottom: -150px;
  left: -150px;
  animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) translateX(0px); }
  33% { transform: translateY(-30px) translateX(20px); }
  66% { transform: translateY(-10px) translateX(-15px); }
}

/* Decorative Floating Shapes */
.decorative-shapes {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.deco-shape {
  position: absolute;
  font-size: 24px;
  opacity: 0.15;
  pointer-events: none;
}

.deco-star {
  animation: float 8s ease-in-out infinite;
}

.deco-heart {
  animation: float 10s ease-in-out infinite 1s;
}

.deco-sparkle {
  animation: float 12s ease-in-out infinite 2s;
}

.deco-cloud {
  animation: float 15s ease-in-out infinite 3s;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .bottom-sheet,
  .modal,
  .bottom-sheet-overlay,
  .modal-overlay {
    transition: opacity 150ms ease !important;
  }

  main {
    animation: none !important;
  }
}

/* Responsive */
@media (min-width: 768px) {
  .pixel {
    font-size: var(--text-sm);
  }
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }

  .fab {
    bottom: 24px;
    right: 24px;
  }

  .pixel-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-sm);
  }

  .pixel {
    max-width: 32px;
    max-height: 32px;
  }
}
