/* ==============================================================================
   Albo Neuro – Liquid Glass Design System
   Reizarm, OLED-Darkmode, Glassmorphism, Zero Decision Fatigue
   ============================================================================== */

:root {
  --bg-deep: #06080e;
  --bg-card: rgba(18, 23, 34, 0.72);
  --bg-card-hover: rgba(28, 35, 52, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(99, 179, 237, 0.4);
  
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  padding-bottom: calc(85px + env(safe-area-inset-bottom, 20px));
}

/* Ambient Ambient Orbs */
.ambient-glow {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 350px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(99, 102, 241, 0.08) 50%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-bottom {
  position: fixed;
  bottom: 0;
  right: -50px;
  width: 400px;
  height: 300px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 8, 14, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 640px;
  margin: 0 auto;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-left: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover, .btn-icon:active {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-focus);
  transform: scale(0.96);
}

/* Main Container */
.main-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hero Section (Match Screenshot) */
.hero-header {
  text-align: center;
  padding: 12px 8px 6px;
}

.hero-title {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 6px;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Supermarket Selector Capsule */
.market-selector-wrap {
  display: flex;
  justify-content: center;
  margin: 6px 0 12px;
}

.market-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.market-capsule:hover {
  border-color: var(--accent-cyan);
}

.market-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.market-badge.edeka { background: #00457d; color: #ffeb00; }
.market-badge.rewe { background: #cc071e; color: #ffffff; }
.market-badge.aldi { background: #002b49; color: #00b0f0; }
.market-badge.lidl { background: #0050aa; color: #fff000; }
.market-badge.kaufland { background: #d40000; color: #ffffff; }

.market-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Summary Grid: 2 Cards (Cost & Shopping List Progress) */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-glass);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.summary-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-focus);
}

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

.summary-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.summary-value .highlight-cost {
  color: var(--accent-emerald);
  font-size: 1.25rem;
}

.summary-value .budget-target {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}

.summary-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  margin-top: 10px;
  overflow: hidden;
}

.summary-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-emerald), #34d399);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* Day Plan Cards (Match Screenshot) */
.plan-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-glass);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.day-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.day-badge-top {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.day-content-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.day-image-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  overflow: hidden;
}

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

.day-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.day-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-bottom: 6px;
}

.day-tag-pill.shake {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.day-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 500;
}

.day-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Neuro Quick Action: "Entscheide für mich" */
.decide-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.decide-banner:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.5);
}

.decide-banner:active {
  transform: scale(0.98);
}

.decide-text-group {
  flex: 1;
}

.decide-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.decide-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.decide-btn-dice {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

/* Supermarket Deals Section */
.deals-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deals-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.deals-filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-chip.active, .filter-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.deal-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.deal-card:hover {
  border-color: var(--glass-border-focus);
}

.deal-main {
  flex: 1;
  min-width: 0;
}

.deal-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.deal-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-unit {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.deal-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.deal-discount-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.deal-regular-price {
  font-size: 0.74rem;
  color: var(--text-dim);
  text-decoration: line-through;
}

.btn-add-deal {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.15s ease;
}

.btn-add-deal:hover {
  background: var(--accent-emerald);
  color: #ffffff;
}

/* Bento Saves Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.bento-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.bento-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-focus);
}

.bento-badge-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  align-self: flex-start;
  margin-bottom: 8px;
}

.bento-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 6px;
}

.bento-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Modals & Sheets */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-sheet {
  background: #0f1422;
  border: 1px solid var(--glass-border);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  margin: 10px auto 6px;
}

.sheet-header {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.sheet-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.sheet-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Shopping Item Row */
.shopping-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  cursor: pointer;
}

.shopping-row.bought {
  opacity: 0.45;
  background: transparent;
}

.shopping-row.bought .shopping-name {
  text-decoration: line-through;
}

.shopping-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.shopping-row.bought .shopping-checkbox {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.shopping-info {
  flex: 1;
}

.shopping-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.shopping-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.shopping-deal-tag {
  color: var(--accent-emerald);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Bottom Nav Bar (iOS Floating Glass Tabbar) */
.glass-tabbar {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  background: rgba(15, 20, 32, 0.82);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 60;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

.tab-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.tab-btn svg {
  width: 20px;
  height: 20px;
}

/* Supermarket Switch Modal List */
.market-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.market-option:hover, .market-option.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}
