/* LifePilot Components — Cards, Buttons, Chips, Nav, Toggles */

/* === HEADER === */
.app-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.header-logo svg {
  width: 28px;
  height: 28px;
}

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

.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.header-btn:active {
  background: var(--primary-light);
  color: var(--primary);
  transform: scale(0.92);
}

/* === BOTTOM NAVIGATION === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

[data-theme="dark"] .bottom-nav {
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  padding: var(--space-xs) 0;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab.active::before {
  content: '';
  position: absolute;
  top: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.nav-tab svg, .nav-tab .nav-icon {
  width: 22px;
  height: 22px;
  font-size: 20px;
  line-height: 22px;
}

.nav-tab:active {
  transform: scale(0.92);
}

.nav-label {
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* === FAB (Floating Action Button) === */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--space-md));
  right: var(--space-md);
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 150;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fab-pulse 3s ease-in-out infinite;
}

.fab:active {
  transform: scale(0.9);
  box-shadow: var(--shadow-sm);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px var(--space-lg);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  transition: all 0.15s ease;
  min-height: 48px;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

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

.btn-primary:hover { background: var(--primary-hover); }

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

.btn-accent:hover { background: var(--accent-hover); }

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

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-large {
  width: 100%;
  padding: 16px var(--space-xl);
  font-size: var(--text-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
}

/* === CARDS === */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.card-elevated {
  box-shadow: var(--shadow-sm);
  border-color: transparent;
}

.card:active {
  transform: scale(0.98);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
}

/* === ENERGY CARDS === */
.energy-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-md);
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.energy-card.low { background: var(--energy-low-bg); }
.energy-card.mid { background: var(--energy-mid-bg); }
.energy-card.high { background: var(--energy-high-bg); }

.energy-card.selected {
  transform: scale(1.02);
}
.energy-card.selected.low { border-color: var(--energy-low); background: var(--energy-low-light); }
.energy-card.selected.mid { border-color: var(--energy-mid); background: var(--energy-mid-light); }
.energy-card.selected.high { border-color: var(--energy-high); background: var(--energy-high-light); }

.energy-card:active {
  transform: scale(0.97);
}

.energy-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.energy-info {
  flex: 1;
  min-width: 0;
}

.energy-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.energy-label.low { color: var(--energy-low); }
.energy-label.mid { color: var(--energy-mid); }
.energy-label.high { color: var(--energy-high); }

.energy-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.energy-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-snug);
}

.energy-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.energy-card.selected .energy-check {
  opacity: 1;
  transform: scale(1);
}

.energy-check.low { background: var(--energy-low); color: white; }
.energy-check.mid { background: var(--energy-mid); color: white; }
.energy-check.high { background: var(--energy-high); color: white; }

/* === CHIPS (Ingredient tags) === */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chip:active { transform: scale(0.94); }

.chip.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* === BADGE === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

.badge-energy {
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-energy:active { transform: scale(0.94); }

.badge-low { background: var(--energy-low-light); color: var(--energy-low); }
.badge-mid { background: var(--energy-mid-light); color: var(--energy-mid); }
.badge-high { background: var(--energy-high-light); color: var(--energy-high); }

/* === TOGGLE === */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle.active {
  background: var(--primary);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.toggle.active .toggle-thumb {
  transform: translateX(20px);
}

/* === PROGRESS BAR === */
.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--divider);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width 0.6s ease;
}

/* === INPUT === */
.input {
  width: 100%;
  padding: 12px var(--space-md);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-base);
  transition: all 0.2s ease;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input {
  padding-left: 44px;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 18px;
}

/* === MODULE CARDS (Dashboard grid) === */
.module-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  border: 1px solid var(--border);
  min-height: 100px;
}

.module-card:active {
  transform: scale(0.96);
}

.module-card .module-emoji {
  font-size: 28px;
  line-height: 1;
}

.module-card .module-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.module-card.training { background: var(--tint-training); border-color: transparent; }
.module-card.nutrition { background: var(--tint-nutrition); border-color: transparent; }
.module-card.kopffrei { background: var(--tint-kopffrei); border-color: transparent; }
.module-card.blitz { background: var(--tint-blitz); border-color: transparent; }

/* === THOUGHT CARDS (Blitz) === */
.thought-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
}

.thought-tag {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.thought-tag.shopping { background: rgba(122, 57, 187, 0.12); color: var(--cat-shopping); }
.thought-tag.todo { background: var(--accent-light); color: var(--accent); }
.thought-tag.idea { background: var(--energy-mid-bg); color: var(--energy-mid); }
.thought-tag.important { background: var(--energy-low-bg); color: var(--energy-low); }

.thought-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text);
  line-height: var(--leading-snug);
}

.thought-time {
  font-size: var(--text-xs);
  color: var(--text-faint);
  white-space: nowrap;
}

.thought-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-faint);
  font-size: 16px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.thought-delete:active {
  background: var(--energy-low-bg);
  color: var(--energy-low);
}

/* === PLANNER BLOCKS === */
.planner-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
}

.planner-time {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-faint);
  width: 54px;
  flex-shrink: 0;
  padding-top: 12px;
  font-variant-numeric: tabular-nums;
}

.planner-block {
  flex: 1;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.planner-block.exercise { background: var(--block-exercise); }
.planner-block.meal { background: var(--block-meal); }
.planner-block.focus { background: var(--block-focus); }
.planner-block.break { background: var(--block-break); }

.planner-block-emoji {
  font-size: 20px;
  flex-shrink: 0;
}

.planner-block-info {
  flex: 1;
}

.planner-block-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.planner-block-subtitle {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.planner-buffer {
  padding: var(--space-xs) 0;
  padding-left: calc(54px + var(--space-md));
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-style: italic;
}

.planner-check {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  color: transparent;
}

.planner-check.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.planner-now-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === TATA LIST ITEMS === */
.tata-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.tata-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--energy-high);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tata-text {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.tata-time {
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* === OVERLAY / MODAL === */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.overlay.visible {
  opacity: 1;
  visibility: visible;
}

.overlay-content {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  width: 100%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.overlay.visible .overlay-content {
  transform: translateY(0) scale(1);
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-secondary);
}

.empty-state .empty-emoji {
  font-size: 48px;
  margin-bottom: var(--space-md);
}

.empty-state .empty-text {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

/* === RECIPE CARDS === */
.recipe-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recipe-card:active {
  transform: scale(0.98);
}

.recipe-header {
  padding: var(--space-lg) var(--space-md) var(--space-md);
  background: var(--tint-nutrition);
  text-align: center;
  font-size: 40px;
}

.recipe-body {
  padding: var(--space-md);
}

.recipe-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.recipe-meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.recipe-tip {
  background: var(--energy-mid-bg);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: var(--leading-snug);
}

/* === TRAINING CARDS === */
.training-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.training-card:active {
  transform: scale(0.97);
}

.training-card-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.training-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: var(--text-xs);
}

.training-meta-tag {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

/* === CIRCULAR TIMER === */
.timer-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  position: relative;
  margin: 0 auto;
}

.timer-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-circle .track {
  fill: none;
  stroke: var(--divider);
  stroke-width: 6;
}

.timer-circle .progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-4xl);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.timer-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.15s ease;
}

.timer-btn:active { transform: scale(0.9); }
.timer-btn-play { background: var(--primary); color: white; }
.timer-btn-pause { background: var(--energy-mid); color: white; }
.timer-btn-stop { background: var(--energy-low); color: white; }

/* Settings items */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--divider);
}

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

.settings-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

/* Theme switcher */
.theme-options {
  display: flex;
  gap: var(--space-xs);
  background: var(--divider);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.theme-opt {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.theme-opt.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* === SECTION HEADER === */
.section-header {
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  margin-bottom: 4px;
}

.section-header p {
  font-size: var(--text-sm);
}
