/* ==========================================================================
   DJALALS NÄHRSTOFFE - HELL, HOCHLESERLICH & NEBENEINANDER (LIGHT THEME)
   ========================================================================== */

:root {
  /* Bright, Crisp Light Palette */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-input: #ffffff;

  --border-light: #e2e8f0;
  --border-focus: #10b981;
  --border-hover: #cbd5e1;

  /* High-Contrast Legible Text */
  --text-main: #0f172a;       /* Deep slate for crystal-clear readability */
  --text-secondary: #334155;  /* Slate 700 */
  --text-muted: #64748b;      /* Slate 500 */

  /* Vibrant Accents */
  --emerald-main: #059669;
  --emerald-bright: #10b981;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;

  --blue-main: #0284c7;
  --blue-bg: #f0f9ff;
  --blue-border: #bae6fd;

  --amber-main: #d97706;
  --amber-bg: #fffbeb;

  /* Shadows & Radii */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', var(--font-body);
}

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

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 32px 24px 64px 24px;
  min-height: 100vh;
}

.page-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* ==========================================================================
   SIDE-BY-SIDE 2-COLUMN DASHBOARD LAYOUT
   ========================================================================== */
.app-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: start;
}

/* --- LEFT COLUMN (SIDEBAR) --- */
.sidebar-col {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--emerald-bg);
  color: var(--emerald-main);
  border: 1px solid var(--emerald-border);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.15;
}

.subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Quick Stats Card */
.stats-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border-light);
}

.text-emerald {
  color: var(--emerald-main) !important;
}

/* Supplements Section in Left Col */
.supplements-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.col-heading {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.col-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.count-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.supplements-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Supplement Cards */
.supp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.supp-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.supp-card-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.supp-img-box {
  width: 68px;
  height: 68px;
  min-width: 68px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
}

.supp-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
  transition: transform 0.2s ease;
}

.supp-card:hover .supp-img {
  transform: scale(1.08);
}

.supp-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.supp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.supp-brand {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--emerald-main);
  letter-spacing: 0.04em;
}

.supp-timing-badge {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

.supp-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.supp-dose-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 0.84rem;
}

.supp-dose-val {
  color: var(--text-secondary);
  font-weight: 600;
}

.supp-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue-main);
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   RIGHT COLUMN (MAIN NUTRIENTS DASHBOARD)
   ========================================================================== */
.main-content-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

/* Search Bar */
.search-box {
  position: relative;
  min-width: 280px;
}

.search-svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 10px 16px 10px 38px;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Filter Pills */
.filter-pills-wrap {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.filter-pill:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.filter-pill.active {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

/* --- NUTRIENTS GRID (2 COLUMNS SIDE-BY-SIDE) --- */
.nutrients-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.nut-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.nut-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.nut-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.nut-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nut-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.nut-extra {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.nut-source-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-muted);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.nut-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 2px;
}

.nut-amount-val {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.nut-percent-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--emerald-main);
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.nut-percent-pill.is-missing {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.nut-card.is-missing {
  border: 1px dashed #cbd5e1;
  background: #fdfdfd;
}

.nut-card.is-missing:hover {
  border-color: #f59e0b;
}

.nut-source-tag.is-missing {
  background: #f1f5f9;
  color: #94a3b8;
  font-style: italic;
}

.nut-progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.nut-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-bright) 0%, var(--emerald-main) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.nut-ref-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: right;
}

/* Empty State */
.empty-msg {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Footer Note */
.footer-note {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-sub {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .sidebar-col {
    position: static;
  }
}

@media (max-width: 640px) {
  body {
    padding: 20px 14px 48px 14px;
  }
  .title {
    font-size: 1.7rem;
  }
  .nutrients-grid {
    grid-template-columns: 1fr;
  }
  .search-box {
    min-width: 100%;
  }
  .stats-card {
    flex-wrap: wrap;
    gap: 12px;
  }
  .stat-divider {
    display: none;
  }
}
