/* Glassmorphism & Modern Dashboard Stylesheet */

:root {
  /* Light Mode Glassmorphism Variables */
  --bg-viewport: #f3f4f6;
  --bg-primary: rgba(255, 255, 255, 0.4);
  --bg-secondary: rgba(243, 244, 246, 0.6);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --border-color: rgba(0, 0, 0, 0.06);
  --card-bg: rgba(255, 255, 255, 0.45);
  --card-border: rgba(255, 255, 255, 0.6);
  
  --satisfaction-color: #0d9488;
  --satisfaction-bg: rgba(13, 148, 136, 0.08);
  
  --mood-color: #0284c7;
  --mood-bg: rgba(2, 132, 199, 0.08);
  
  --energy-color: #ea580c;
  --energy-bg: rgba(234, 88, 12, 0.08);

  --stoic-color: #7c3aed;
  --stoic-bg: rgba(124, 58, 237, 0.08);

  --shadow-subtle: 0 8px 32px 0 rgba(31, 38, 135, 0.03), inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
  --radius-modern: 20px;
  
  --blob-color-1: rgba(99, 102, 241, 0.16);  /* Indigo */
  --blob-color-2: rgba(168, 85, 247, 0.14);  /* Purple */
  --blob-color-3: rgba(6, 182, 212, 0.12);   /* Cyan */
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark Mode Glassmorphism Variables */
    --bg-viewport: #0a0a0c;
    --bg-primary: rgba(15, 15, 17, 0.5);
    --bg-secondary: rgba(24, 24, 28, 0.45);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.05);
    --card-bg: rgba(20, 20, 23, 0.55);
    --card-border: rgba(255, 255, 255, 0.07);
    
    --satisfaction-color: #2dd4bf;
    --satisfaction-bg: rgba(45, 212, 191, 0.07);
    
    --mood-color: #38bdf8;
    --mood-bg: rgba(56, 189, 248, 0.07);
    
    --energy-color: #fb923c;
    --energy-bg: rgba(251, 146, 60, 0.07);

    --stoic-color: #a78bfa;
    --stoic-bg: rgba(167, 139, 250, 0.07);

    --shadow-subtle: 0 12px 40px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
    
    --blob-color-1: rgba(99, 102, 241, 0.10);
    --blob-color-2: rgba(168, 85, 247, 0.08);
    --blob-color-3: rgba(6, 182, 212, 0.07);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-viewport);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background Glowing Blobs */
.bg-blobs-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.85;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background-color: var(--blob-color-1);
  animation: drift-1 18s ease-in-out infinite alternate;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background-color: var(--blob-color-2);
  animation: drift-2 22s ease-in-out infinite alternate-reverse;
}

.blob-3 {
  top: 30%;
  right: -10%;
  width: 45vw;
  height: 45vw;
  background-color: var(--blob-color-3);
  animation: drift-3 26s ease-in-out infinite alternate;
}

@keyframes drift-1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8%, 5%) scale(1.15); }
  100% { transform: translate(-4%, -5%) scale(0.9); }
}

@keyframes drift-2 {
  0% { transform: translate(0, 0) scale(1.1); }
  50% { transform: translate(-6%, 8%) scale(0.9); }
  100% { transform: translate(5%, -4%) scale(1.05); }
}

@keyframes drift-3 {
  0% { transform: translate(0, 0) scale(0.95); }
  50% { transform: translate(7%, -6%) scale(1.08); }
  100% { transform: translate(-5%, 8%) scale(1.02); }
}

/* App Container */
.app-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  box-shadow: 0 0 40px rgba(0,0,0,0.02);
  transition: max-width 0.3s ease, margin 0.3s ease, border-radius 0.3s ease;
}

@media (min-width: 1024px) {
  .app-container {
    max-width: 760px;
    margin: 40px auto;
    min-height: calc(100vh - 80px);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.08);
  }
}

/* Header */
.app-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-text .subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.theme-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--satisfaction-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--satisfaction-color);
  animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
  0% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.4; transform: scale(0.9); }
}

/* Main Area */
.app-main {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: display 0.3s ease, grid-template-columns 0.3s ease, padding 0.3s ease;
}

@media (min-width: 1024px) {
  .app-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
  }
}

/* Glassmorphic Cards */
.section-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-modern);
  padding: 20px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.section-card:hover {
  transform: translateY(-4px) translateZ(0);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(255, 255, 255, 0.85);
}

@media (prefers-color-scheme: dark) {
  .section-card:hover {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.15);
  }
}

.card-header {
  margin-bottom: 18px;
}

.card-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.card-meta, .selected-date {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.selected-date {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* Chart Navigation Controls */
.chart-header-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-controls h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.2px;
}

.nav-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  user-select: none;
}

.nav-btn svg {
  display: block;
}

.nav-btn:hover:not(:disabled) {
  background-color: var(--bg-primary);
  border-color: var(--text-primary);
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nav-btn:active:not(:disabled) {
  transform: translateY(0px) scale(0.95);
}

.nav-btn:disabled {
  opacity: 0.15;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Chart Wrapper */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
}

.custom-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 18px;
  font-size: 11px;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.legend-item:hover {
  color: var(--text-primary);
}

.bullet {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.bullet.satisfaction { color: var(--satisfaction-color); background-color: var(--satisfaction-color); }
.bullet.mood { color: var(--mood-color); background-color: var(--mood-color); }
.bullet.energy { color: var(--energy-color); background-color: var(--energy-color); }

/* Placeholders */
.placeholder-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-modern);
  background: var(--bg-secondary);
}

.placeholder-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
  box-shadow: var(--shadow-subtle);
}

.placeholder-area p {
  font-size: 12px;
  font-weight: 500;
  max-width: 260px;
}

/* Details Content */
.details-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hidden {
  display: none !important;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric-score-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 10px;
  border-radius: 16px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Satisfaction Metric (Teal) */
.evening-session .metrics-grid .metric-score-card:nth-child(1) {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.05), rgba(255, 255, 255, 0.2));
  border: 1px solid rgba(13, 148, 136, 0.15);
}
.evening-session .metrics-grid .metric-score-card:nth-child(1) .score-val {
  color: var(--satisfaction-color);
}
.evening-session .metrics-grid .metric-score-card:nth-child(1):hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(13, 148, 136, 0.4);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Mood Metric (Blue) */
.evening-session .metrics-grid .metric-score-card:nth-child(2),
.morning-session .metrics-grid .metric-score-card:nth-child(1) {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.05), rgba(255, 255, 255, 0.2));
  border: 1px solid rgba(2, 132, 199, 0.15);
}
.evening-session .metrics-grid .metric-score-card:nth-child(2) .score-val,
.morning-session .metrics-grid .metric-score-card:nth-child(1) .score-val {
  color: var(--mood-color);
}
.evening-session .metrics-grid .metric-score-card:nth-child(2):hover,
.morning-session .metrics-grid .metric-score-card:nth-child(1):hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Energy Metric (Orange) */
.evening-session .metrics-grid .metric-score-card:nth-child(3),
.morning-session .metrics-grid .metric-score-card:nth-child(2) {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.05), rgba(255, 255, 255, 0.2));
  border: 1px solid rgba(234, 88, 12, 0.15);
}
.evening-session .metrics-grid .metric-score-card:nth-child(3) .score-val,
.morning-session .metrics-grid .metric-score-card:nth-child(2) .score-val {
  color: var(--energy-color);
}
.evening-session .metrics-grid .metric-score-card:nth-child(3):hover,
.morning-session .metrics-grid .metric-score-card:nth-child(2):hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(234, 88, 12, 0.4);
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Sleep Metric (Purple) */
.morning-session .metrics-grid .metric-score-card:nth-child(3) {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(255, 255, 255, 0.2));
  border: 1px solid rgba(124, 58, 237, 0.15);
}
.morning-session .metrics-grid .metric-score-card:nth-child(3) .score-val {
  color: var(--stoic-color);
}
.morning-session .metrics-grid .metric-score-card:nth-child(3):hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

@media (prefers-color-scheme: dark) {
  .evening-session .metrics-grid .metric-score-card:nth-child(1) {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.05), rgba(20, 20, 23, 0.45));
    border-color: rgba(45, 212, 191, 0.15);
  }
  .evening-session .metrics-grid .metric-score-card:nth-child(1):hover {
    border-color: rgba(45, 212, 191, 0.35);
    box-shadow: 0 8px 24px rgba(45, 212, 191, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .evening-session .metrics-grid .metric-score-card:nth-child(2),
  .morning-session .metrics-grid .metric-score-card:nth-child(1) {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.05), rgba(20, 20, 23, 0.45));
    border-color: rgba(56, 189, 248, 0.15);
  }
  .evening-session .metrics-grid .metric-score-card:nth-child(2):hover,
  .morning-session .metrics-grid .metric-score-card:nth-child(1):hover {
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .evening-session .metrics-grid .metric-score-card:nth-child(3),
  .morning-session .metrics-grid .metric-score-card:nth-child(2) {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.05), rgba(20, 20, 23, 0.45));
    border-color: rgba(251, 146, 60, 0.15);
  }
  .evening-session .metrics-grid .metric-score-card:nth-child(3):hover,
  .morning-session .metrics-grid .metric-score-card:nth-child(2):hover {
    border-color: rgba(251, 146, 60, 0.35);
    box-shadow: 0 8px 24px rgba(251, 146, 60, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .morning-session .metrics-grid .metric-score-card:nth-child(3) {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.05), rgba(20, 20, 23, 0.45));
    border-color: rgba(167, 139, 250, 0.15);
  }
  .morning-session .metrics-grid .metric-score-card:nth-child(3):hover {
    border-color: rgba(167, 139, 250, 0.35);
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}

.score-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  text-align: center;
  opacity: 0.85;
}

.score-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  text-align: center;
}

/* Period Averages Widget */
.period-averages-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.avg-metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-modern);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.avg-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.avg-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-align: center;
}

.avg-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.avg-satisfaction:hover {
  border-color: var(--satisfaction-color);
  box-shadow: 0 4px 12px var(--satisfaction-bg);
}

.avg-mood:hover {
  border-color: var(--mood-color);
  box-shadow: 0 4px 12px var(--mood-bg);
}

.avg-energy:hover {
  border-color: var(--energy-color);
  box-shadow: 0 4px 12px var(--energy-bg);
}

/* Callouts (Glassmorphic & Glowing Capsule Layout) */
.notion-callout {
  display: flex;
  gap: 14px;
  padding: 14px 16px 14px 20px;
  border-radius: 14px;
  font-size: 13px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.01);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.notion-callout::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.notion-callout:hover {
  transform: translateX(3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.02);
}

.callout-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.callout-text {
  flex: 1;
}

.callout-title {
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.callout-body {
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
}

/* Custom Callout Variations */
.highlight-callout {
  background-color: var(--satisfaction-bg);
  border-color: rgba(13, 148, 136, 0.15);
  color: var(--satisfaction-color);
}
.highlight-callout::before {
  background-color: var(--satisfaction-color);
}
.highlight-callout .callout-body { color: var(--text-primary); }

.lowlight-callout {
  background-color: var(--energy-bg);
  border-color: rgba(234, 88, 12, 0.15);
  color: var(--energy-color);
}
.lowlight-callout::before {
  background-color: var(--energy-color);
}
.lowlight-callout .callout-body { color: var(--text-primary); }

.stoic-callout {
  background-color: var(--stoic-bg);
  border-color: rgba(124, 58, 237, 0.15);
  color: var(--stoic-color);
}
.stoic-callout::before {
  background-color: var(--stoic-color);
}
.stoic-callout .callout-body { color: var(--text-primary); font-style: italic; font-weight: 500; }

/* Detail Lists */
.details-list-section {
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
}

.details-list-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.notion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notion-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.18);
  margin-bottom: 8px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.notion-list-item:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.25);
}

@media (prefers-color-scheme: dark) {
  .notion-list-item {
    background: rgba(20, 20, 23, 0.25);
  }
  .notion-list-item:hover {
    background: rgba(20, 20, 23, 0.35);
  }
}

.item-key {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.habits-empty-state {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  .habits-empty-state {
    background: rgba(20, 20, 23, 0.15);
  }
}

.list-icon {
  width: 15px;
  height: 15px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2.2px;
  vertical-align: middle;
  display: inline-block;
  margin-right: 2px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.badge.success {
  background-color: var(--satisfaction-bg);
  color: var(--satisfaction-color);
  border: 1px solid rgba(13, 148, 136, 0.15);
}

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

.badge.danger {
  background-color: var(--energy-bg);
  color: var(--energy-color);
  border: 1px solid rgba(234, 88, 12, 0.15);
}

/* Footer */
.app-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: 11px;
  background-color: var(--bg-secondary);
}

/* Debug Console */
#debug-console {
  border-radius: var(--radius-modern);
  box-shadow: var(--shadow-subtle);
  border: 1px solid #fda4af !important;
}

/* Day Change Smooth Blur/Fade Animation */
@keyframes blur-fade-in {
  0% {
    filter: blur(20px);
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  100% {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-blur-fade {
  animation: blur-fade-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Tageszusammenfassung Markdown Box */
.summary-body-markdown {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 18px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-primary);
  max-height: 350px;
  overflow-y: auto;
  scrollbar-width: thin;
  margin-top: 4px;
}

.summary-body-markdown h2,
.summary-body-markdown h3,
.summary-body-markdown h4 {
  margin-top: 18px;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

.summary-body-markdown h2:first-of-type,
.summary-body-markdown h3:first-of-type,
.summary-body-markdown h4:first-of-type {
  margin-top: 0;
}

.summary-body-markdown h2 { font-size: 16px; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
.summary-body-markdown h3 { font-size: 14.5px; }
.summary-body-markdown h4 { font-size: 13.5px; color: var(--text-secondary); }

.summary-body-markdown ul {
  margin-left: 20px;
  margin-bottom: 12px;
}

.summary-body-markdown li {
  margin-bottom: 4px;
}

.summary-body-markdown strong {
  font-weight: 700;
}

/* Session Blocks Visual Separation */
.session-block {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.session-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 14px;
}

@media (prefers-color-scheme: dark) {
  .session-block-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }
}

.session-block-header h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0;
  flex: 1;
}

.session-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* Evening Session: Main visual focus (Indigo Theme Glow) */
.evening-session {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.45) 0%, rgba(255, 255, 255, 0.5) 100%);
  border-color: rgba(99, 102, 241, 0.12);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.evening-session .session-icon {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.evening-session .session-block-header h3 {
  color: #4f46e5;
  text-shadow: 0 0 12px rgba(99, 102, 241, 0.08);
}

.evening-session:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@media (prefers-color-scheme: dark) {
  .evening-session {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(20, 20, 23, 0.6) 100%);
    border-color: rgba(99, 102, 241, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  .evening-session .session-block-header h3 {
    color: #a5b4fc;
  }
  .evening-session:hover {
    border-color: rgba(129, 140, 248, 0.3);
    box-shadow: 0 18px 48px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

/* Morning Session: Secondary focus (Warm Amber Theme Glow) */
.morning-session {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.35) 0%, rgba(255, 255, 255, 0.5) 100%);
  border-color: rgba(245, 158, 11, 0.12);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.morning-session .session-icon {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.morning-session .session-block-header h3 {
  color: #d97706;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.08);
}

.morning-session:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 16px 40px rgba(245, 158, 11, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@media (prefers-color-scheme: dark) {
  .morning-session {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.02) 0%, rgba(20, 20, 23, 0.6) 100%);
    border-color: rgba(245, 158, 11, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  .morning-session .session-block-header h3 {
    color: #fbbf24;
  }
  .morning-session:hover {
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow: 0 18px 48px rgba(245, 158, 11, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

/* Common details block: Neutral styling */
.common-details {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.4) 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.01), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.common-details:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

@media (prefers-color-scheme: dark) {
  .common-details {
    background: rgba(20, 20, 23, 0.55);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  .common-details:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

.morning-notes-callout {
  background-color: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.15);
  color: #d97706;
  margin-top: 14px;
}

.morning-notes-callout::before {
  background-color: #f59e0b;
}

.morning-notes-callout .callout-body {
  color: var(--text-primary);
}

@media (prefers-color-scheme: dark) {
  .morning-notes-callout {
    background-color: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
  }
  .morning-notes-callout::before {
    background-color: #fbbf24;
  }
}

/* Glowing circular status point indicators (symbols & points instead of text) */
.status-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.status-indicator:hover {
  transform: scale(1.15);
}

.status-indicator svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.8px;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.status-indicator.success {
  background-color: var(--satisfaction-bg);
  color: var(--satisfaction-color);
  border: 1px solid rgba(13, 148, 136, 0.25);
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.2);
}

.status-indicator.danger {
  background-color: var(--energy-bg);
  color: var(--energy-color);
  border: 1px solid rgba(234, 88, 12, 0.25);
  box-shadow: 0 0 10px rgba(234, 88, 12, 0.2);
}

.status-indicator.neutral {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}



/* ============================================================
   Session Input UI (Morning / Evening) — v11
   ============================================================ */

/* Today / Start card */
.today-card { }
@media (min-width: 1024px) {
  .today-card { grid-column: 1 / -1; }
}
.today-head { margin-bottom: 16px; }
.today-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.today-sub { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

.session-start-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.session-start-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), box-shadow 0.28s ease;
  text-align: left;
  color: var(--text-primary);
}
/* soft tinted gradient surfaces per session */
.session-start-btn.morning {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(234,88,12,0.16), transparent 55%),
    linear-gradient(150deg, rgba(251,191,36,0.14), rgba(255,255,255,0.04));
}
.session-start-btn.evening {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(99,102,241,0.18), transparent 55%),
    linear-gradient(150deg, rgba(2,132,199,0.14), rgba(255,255,255,0.04));
}
.session-start-btn::after {
  content: "";
  position: absolute; top: 20px; right: 20px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--card-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23656564' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
  border: 1px solid var(--card-border);
  transition: transform 0.28s cubic-bezier(0.16,1,0.3,1);
}
.session-start-btn:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(31,38,135,0.12); }
.session-start-btn:hover::after { transform: translateX(3px); }
.session-start-btn:active { transform: translateY(-1px); }
.ss-emoji {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 16px;
  font-size: 26px; line-height: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.5);
}
.ss-label { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.ss-state {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 4px 10px; border-radius: 999px;
  background: var(--card-bg); border: 1px solid var(--card-border);
}
.ss-state.done {
  color: #fff; border-color: transparent;
  background: var(--satisfaction-color);
}
@media (max-width: 560px) {
  .session-start-grid { grid-template-columns: 1fr; }
}

/* Session view layout: force single column even on desktop */
.session-view { max-width: 760px; margin: 0 auto; width: 100%; }
@media (min-width: 1024px) {
  .session-view { display: flex; grid-template-columns: none; }
}

.session-topbar {
  display: flex; align-items: center; gap: 12px;
}
.session-topbar h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; flex: 1; }
.session-date { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.back-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--card-bg);
  color: var(--text-primary); cursor: pointer; transition: background 0.2s ease;
}
.back-btn:hover { background: var(--bg-secondary); }

.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 14px; letter-spacing: -0.1px;
}
.form-section-title .optional { font-weight: 500; color: var(--text-secondary); font-size: 11px; }

/* Segmented control */
.segmented, .relapse-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented button, .relapse-toggles button {
  flex: 1; min-width: 90px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--bg-secondary);
  color: var(--text-secondary); font-size: 12.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.18s ease;
}
.segmented button.active {
  background: var(--mood-color); border-color: var(--mood-color); color: #fff;
}
.relapse-toggles button.active {
  background: var(--energy-color); border-color: var(--energy-color); color: #fff;
}

/* Sliders */
.slider-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 8px 12px; margin-bottom: 14px;
}
.slider-row label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); grid-column: 1; }
.slider-row output {
  grid-column: 2; grid-row: 1 / span 2;
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  min-width: 28px; text-align: center;
}
.slider-row input[type="range"] {
  grid-column: 1; width: 100%; height: 6px; -webkit-appearance: none; appearance: none;
  background: var(--border-color); border-radius: 999px; outline: none; cursor: pointer;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--mood-color); border: 3px solid var(--bg-viewport);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2); cursor: pointer;
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--mood-color); border: 3px solid var(--bg-viewport); cursor: pointer;
}

/* Number / time fields */
.num-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
.num-field { display: flex; flex-direction: column; gap: 6px; }
.num-field label { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); }
.num-field input {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--bg-secondary);
  color: var(--text-primary); font-size: 14px; font-family: inherit;
}

/* Checklist toggles */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--bg-secondary);
  cursor: pointer; transition: all 0.16s ease; user-select: none;
}
.check-item .ci-box {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 8px;
  border: 2px solid var(--border-color); background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.16s ease;
}
.check-item .ci-box svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3.5; fill: none; opacity: 0; }
.check-item .ci-text { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.check-item .ci-target { font-size: 11px; font-weight: 500; color: var(--text-secondary); display: block; margin-top: 1px; }
.check-item.checked { border-color: var(--satisfaction-color); background: var(--satisfaction-bg); }
.check-item.checked .ci-box { background: var(--satisfaction-color); border-color: var(--satisfaction-color); }
.check-item.checked .ci-box svg { opacity: 1; }

/* Voice recorder */
.voice-card { }
.record-area { display: flex; align-items: center; gap: 14px; }
.record-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--card-border); background: var(--bg-secondary);
  color: var(--text-primary); font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.18s ease;
}
.record-btn:hover { background: var(--border-color); }
.record-btn .rec-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--energy-color); flex-shrink: 0;
}
.record-btn.recording { border-color: var(--energy-color); background: var(--energy-bg); }
.record-btn.recording .rec-dot { animation: rec-pulse 1.1s ease-in-out infinite; }
@keyframes rec-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(1.35); } }
.rec-timer { font-size: 14px; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.voice-status { margin-top: 12px; font-size: 12px; font-weight: 500; color: var(--text-secondary); min-height: 16px; }
.voice-status.error { color: var(--energy-color); }
.voice-status.busy { color: var(--mood-color); }

/* AI review fields */
.ai-review { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.ai-field { display: flex; flex-direction: column; gap: 6px; }
.ai-field label { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.ai-field textarea {
  width: 100%; min-height: 64px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--bg-secondary);
  color: var(--text-primary); font-size: 13px; font-family: inherit; line-height: 1.5; resize: vertical;
}
.ai-badge { font-size: 10px; font-weight: 700; color: var(--stoic-color); background: var(--stoic-bg); padding: 2px 8px; border-radius: 999px; margin-left: 8px; }

/* Primary save button */
.primary-save-btn {
  width: 100%; padding: 16px; border-radius: 16px; border: none;
  background: var(--satisfaction-color); color: #fff;
  font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer;
  box-shadow: 0 8px 24px rgba(13,148,136,0.25); transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: sticky; bottom: 16px;
}
.primary-save-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(13,148,136,0.35); }
.primary-save-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

@media (max-width: 480px) {
  .num-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 🔒 Premium Login Screen & Logout button */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  z-index: 100;
  animation: fadeIn 0.4s ease;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: center;
}

.login-header {
  margin-bottom: 28px;
}

.login-logo {
  font-size: 40px;
  display: inline-block;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.login-header p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0;
}

.login-card .input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  text-align: left;
}

.login-card label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.login-card input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card input:focus {
  outline: none;
  border-color: var(--mood-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--mood-color), var(--satisfaction-color));
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 8px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}

.login-btn:active {
  transform: translateY(0);
}

.login-error {
  margin-top: 16px;
  font-size: 13px;
  color: var(--energy-color);
  min-height: 18px;
  font-weight: 500;
}

/* Logout Button */
.logout-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
