/* CSS Design System — Human Performance & Nutrition Atlas */

:root {
  --bg-main: #07080b;
  --bg-sidebar: #0d0f14;
  --bg-card: rgba(20, 24, 33, 0.6);
  --bg-card-hover: rgba(28, 33, 46, 0.85);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-focus: rgba(139, 92, 246, 0.4);

  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-white: #ffffff;

  /* Primary Colors */
  --primary: #8b5cf6;
  /* Violet */
  --primary-hover: #a78bfa;
  --primary-glow: rgba(139, 92, 246, 0.15);

  --success: #10b981;
  /* Emerald */
  --success-light: #34d399;

  --warning: #f59e0b;
  /* Amber */
  --danger: #ef4444;
  /* Rose */

  /* Fonts */
  --font-header: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-header);
  color: var(--text-white);
  font-weight: 600;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.8rem;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-tab {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-header);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-white);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
  color: var(--text-white);
  background-color: var(--primary-glow);
  border-color: var(--border-color-focus);
}

/* Main Content Wrapper */
.app-content {
  flex: 1;
  padding: 2rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Toggleable Sections */
.content-section {
  display: none;
}

.content-section.active-section {
  display: block;
}

/* ================= SECTION 1: NUTRIENT DATABASE ================= */
.atlas-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Sidebar styling */
.atlas-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.25rem;
  backdrop-filter: blur(16px);
}

.filter-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.search-wrapper {
  position: relative;
}

#search-input {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  color: var(--text-white);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

#search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

#category-filter,
#table-category-filter {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgba(139, 92, 246, 0.06); /* Soft violet background tint */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  border: 1px solid rgba(139, 92, 246, 0.3); /* Translucent violet border */
  border-radius: 0.5rem;
  padding: 0.6rem 2.2rem 0.6rem 1rem;
  color: var(--primary-hover); /* Vibrant violet/purple text color */
  outline: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-header);
  letter-spacing: 0.025em;
  backdrop-filter: blur(8px);
}

#category-filter:focus,
#table-category-filter:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
  color: var(--text-white);
  background-color: rgba(139, 92, 246, 0.12);
}

#category-filter:hover,
#table-category-filter:hover {
  border-color: var(--primary-hover);
  background-color: rgba(139, 92, 246, 0.12);
}

#category-filter option,
#table-category-filter option {
  background-color: #0d0f14; /* Dark dropdown list background */
  padding: 0.5rem;
  font-weight: 500;
}

/* Individual Option Color Customizations */
#category-filter option[value="all"],
#table-category-filter option[value="all"] {
  color: var(--text-white); /* Original White */
}

#category-filter option[value="Vitamin"],
#table-category-filter option[value="Vitamin"] {
  color: #fcd34d; /* Vitamins - Sunny Yellow */
}

#category-filter option[value="Mineral"],
#table-category-filter option[value="Mineral"] {
  color: #60a5fa; /* Minerals - Sky Blue */
}

#category-filter option[value="Amino Acid"],
#table-category-filter option[value="Amino Acid"] {
  color: #fb923c; /* Amino Acids - Muscle Orange */
}

#category-filter option[value="Fatty Acid"],
#table-category-filter option[value="Fatty Acid"] {
  color: #2dd4bf; /* Fatty Acids - Ocean Teal */
}

#category-filter option[value="Antioxidant"],
#table-category-filter option[value="Antioxidant"] {
  color: #f472b6; /* Antioxidants - Vibrant Pink */
}

#category-filter option[value="Phytonutrient"],
#table-category-filter option[value="Phytonutrient"] {
  color: #4ade80; /* Phytonutrients - Leaf Green */
}

#category-filter option[value="Gut Health"],
#table-category-filter option[value="Gut Health"] {
  color: #a78bfa; /* Gut Health - Lavender Purple */
}

#category-filter option[value="Performance Supplement"],
#table-category-filter option[value="Performance Supplement"] {
  color: #fb7185; /* Performance Supplements - High Energy Rose */
}

.benefit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.benefit-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.benefit-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
}

.benefit-chip.active {
  background-color: var(--primary-glow);
  border-color: var(--primary);
  color: var(--text-white);
}

/* Directory Card */
.directory-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 600px;
}

.directory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.badge {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-white);
}

.directory-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.directory-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  background-color: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-align: left;
}

.directory-item:hover {
  background-color: var(--bg-card-hover);
  transform: translateX(4px);
}

.directory-item.active {
  background-color: var(--primary-glow);
  border-color: var(--border-color-focus);
}

.item-name {
  color: var(--text-white);
  font-weight: 500;
  font-size: 0.95rem;
}

.item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
}

/* Details Panel styling */
.atlas-details-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  min-height: 600px;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.details-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 4rem 2rem;
  text-align: center;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  display: block;
}

.details-placeholder p {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0.5rem auto 0;
}

/* Detail Sheet Content styling */
.detail-sheet {
  padding: 2.5rem;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.category-pill-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.category-pill {
  background-color: var(--primary-glow);
  border: 1px solid var(--border-color-focus);
  color: var(--primary-hover);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  text-transform: uppercase;
}

.status-pill {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

#detail-name {
  font-size: 2rem;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.evidence-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.evidence-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.evidence-badge {
  font-size: 1.75rem;
  font-weight: 800;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-header);
}

.badge-a {
  background-color: var(--success);
  color: #000;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.badge-b {
  background-color: #3b82f6;
  color: #fff;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.badge-c {
  background-color: var(--warning);
  color: #000;
}

.badge-d {
  background-color: var(--danger);
  color: #fff;
}

/* Detail Tabs */
.detail-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.tab-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-link:hover {
  color: var(--text-white);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.tab-link.active {
  color: var(--primary-hover);
  border-bottom-color: var(--primary);
}

/* Tab Panels */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.span-full {
  grid-column: span 2;
}

.info-card {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.25s ease;
}

.info-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background-color: rgba(0, 0, 0, 0.25);
}

.border-accent {
  border-left: 4px solid var(--primary);
}

.bg-glass {
  background-color: var(--primary-glow);
  border-color: var(--border-color-focus);
}

.info-card h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.info-card p {
  color: var(--text-main);
  font-size: 0.95rem;
}

.code-font {
  font-family: monospace;
  font-size: 0.85rem !important;
  line-height: 1.7;
  color: #a78bfa !important;
}

.highlight-val {
  font-size: 1.35rem !important;
  font-weight: 700;
  font-family: var(--font-header);
}

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

.text-success-light {
  color: var(--success-light) !important;
}

.text-danger {
  color: #f87171 !important;
}

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

.text-accent {
  color: var(--primary-hover) !important;
}

/* ================= SECTION 2: DIET PLANNER ================= */
.diet-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 2rem;
  align-items: start;
}

.diet-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.diet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 1.5rem;
  backdrop-filter: blur(16px);
}

.profile-card h3 {
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

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

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-white);
  margin-top: 0.15rem;
}

.profile-goals {
  font-size: 0.85rem;
}

.profile-goals strong {
  color: var(--text-white);
  display: block;
  margin-bottom: 0.5rem;
}

.profile-goals ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.profile-goals li::before {
  content: "⚡";
  margin-right: 0.4rem;
}

/* Plan Selector Toggles */
.plan-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.plan-toggle-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.plan-toggle-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.plan-toggle-btn.active {
  background-color: var(--primary-glow);
  border-color: var(--primary);
  color: var(--text-white);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
}

.plan-icon {
  font-size: 1.6rem;
}

.plan-btn-text {
  display: flex;
  flex-direction: column;
}

.plan-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-white);
}

.plan-sub {
  font-size: 0.75rem;
}

/* Diet Display Area */
.diet-display-area {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.meal-log-card h2 {
  font-size: 1.6rem;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.diet-description-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.meal-list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meal-row {
  display: grid;
  grid-template-columns: 140px 1fr 180px;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.meal-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.meal-label-cell {
  background-color: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  font-weight: 700;
  font-family: var(--font-header);
  color: var(--primary-hover);
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border-color);
}

.meal-foods-cell {
  padding: 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.meal-macros-cell {
  border-left: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.1);
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  align-content: center;
  font-size: 0.8rem;
  text-align: center;
}

.meal-cals {
  grid-column: span 2;
  font-weight: 700;
  color: var(--text-white);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
}

/* Metrics Dashboard Card */
.metrics-card h3 {
  margin-bottom: 1.25rem;
}

.macros-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.macro-metric-box {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.macro-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.macro-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-white);
}

.progress-bar-bg {
  height: 5px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.2rem 0;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
}

.bar-calories {
  background-color: var(--warning);
}

.bar-protein {
  background-color: var(--primary);
}

.bar-carbs {
  background-color: #3b82f6;
}

.bar-fat {
  background-color: #f43f5e;
}

.target-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.micros-section h4 {
  font-size: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.micros-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.micro-card {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.micro-card:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.micro-name-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.micro-val-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-white);
  font-family: var(--font-header);
}

/* ================= SECTION 3: ULTIMATE COMPARISON TABLE ================= */
.table-container-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2.5rem;
  backdrop-filter: blur(16px);
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#table-search-input {
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  color: var(--text-white);
  font-size: 0.9rem;
  outline: none;
  width: 250px;
  transition: border-color 0.2s ease;
}

#table-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Styled dropdown (moved to shared section) */

.table-scroll-wrapper {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.1);
}

.ultimate-nutrient-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.ultimate-nutrient-table th {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-white);
  font-family: var(--font-header);
  font-weight: 600;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.ultimate-nutrient-table td {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: top;
  line-height: 1.5;
}

.ultimate-nutrient-table tr:hover {
  background-color: rgba(255, 255, 255, 0.015);
}

.table-cell-bold {
  font-weight: 600;
  color: var(--text-white);
  font-size: 1.05rem;
}

.table-cell-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.table-sources-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.table-sources-item {
  font-size: 0.85rem;
}

.table-sources-item strong {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-right: 0.25rem;
  display: inline-block;
  min-width: 55px;
}

/* Footer styling */
.app-footer {
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Base styles for back button (hidden on desktop) */
.mobile-back-btn {
  display: none;
}

/* Responsive Overrides */
@media (max-width: 1100px) {
  .atlas-grid, .diet-container {
    grid-template-columns: 1fr;
  }
  .app-content {
    padding: 1rem;
  }
  
  /* Master-Detail mobile navigation */
  .atlas-grid .atlas-sidebar {
    display: flex;
  }
  .atlas-grid .atlas-details-panel {
    display: none;
  }
  .atlas-grid.show-detail .atlas-sidebar {
    display: none;
  }
  .atlas-grid.show-detail .atlas-details-panel {
    display: block;
  }

  .mobile-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--primary-hover);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-family: var(--font-header);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
  }
  .mobile-back-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary-hover);
  }
  .back-icon {
    font-size: 1rem;
  }

  /* Make tabs scrollable horizontally on smaller screens */
  .detail-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }
  .tab-link {
    flex: 0 0 auto;
  }
}

@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
  .span-full {
    grid-column: span 1;
  }
  
  /* Header styling on mobile */
  .app-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
    text-align: center;
  }
  .header-logo {
    justify-content: center;
  }
  .logo-text {
    font-size: 1.25rem;
  }
  .header-nav {
    width: 100%;
    justify-content: space-around;
  }
  .nav-tab {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    flex: 1;
    text-align: center;
  }

  /* Diet Planner mobile improvements */
  .meal-row {
    display: flex;
    flex-direction: column;
  }
  .meal-label-cell {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
  }
  .meal-foods-cell {
    padding: 1rem;
  }
  .meal-macros-cell {
    border-left: none;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem;
  }
  
  .macros-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .micros-grid {
    grid-template-columns: 1fr;
  }

  /* Ultimate Table mobile scroll optimization */
  .ultimate-nutrient-table {
    min-width: 850px;
  }
  .ultimate-nutrient-table th, 
  .ultimate-nutrient-table td {
    padding: 0.75rem;
  }

  /* Dropdown and search box styling stacking */
  .table-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }
  #table-search-input,
  #table-category-filter {
    width: 100% !important;
  }
}