/* ============================================
   FITCALC HUB - Shared Nutrition Calculator CSS
   Common styles for: fat-intake, carb, macro, creatine
   NOTE: Only non-responsive root-level rules.
   Tool-specific and @media rules stay in each tool's style.css
   ============================================ */

/* --- Goal Selection --- */
.goal-list {
  display: grid;
  gap: 10px;
}

.goal-option {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 28, 40, 0.68);
  color: #94a7bb;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.22s ease;
}

.goal-option i {
  font-size: 12px;
  color: #7d92a8;
}

.goal-option.active {
  background: rgba(91, 163, 220, 0.14);
  border-color: rgba(104, 189, 242, 0.55);
  color: #eef8ff;
  box-shadow: 0 0 0 1px rgba(104, 189, 242, 0.16) inset;
}

.goal-option.active i {
  color: #69bef2;
}

/* --- Meal Toggle --- */
.meal-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  background: rgba(16, 27, 39, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
}

.meal-chip {
  min-height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #8ea2b7;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meal-chip.active {
  background: linear-gradient(135deg, #63b7e8, #5a95d8);
  color: #07131d;
}

.input-shell input::placeholder {
  color: #5f748a;
}

.field-label.fit-label {
  margin: 0;
}

.custom-select-trigger span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-option.active {
  background: rgba(91, 163, 220, 0.14);
  border-color: rgba(104, 189, 242, 0.55);
  color: #eef8ff;
  box-shadow: 0 0 0 1px rgba(104, 189, 242, 0.16) inset;
}

.input-shell,
.select-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 0 18px;
  width: 100%;
  background: rgba(17, 28, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  overflow: visible;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  width: 100%;
  color: #f6fbff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font-size: 18px;
  font-weight: 900;
  color: #eef7ff;
}

.custom-select.open .custom-select-trigger i {
  transform: rotate(180deg);
}

.input-grid-2,
.input-grid-3 {
  display: grid;
  gap: 16px;
}

.section-title i {
  color: #67b8eb;
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #1a2740;
  border: 1px solid rgba(95, 176, 228, 0.2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.goal-option.active i {
  color: #69bef2;
}

.custom-select-option:hover {
  background: rgba(95, 176, 228, 0.14);
}

.toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  background: rgba(16, 27, 39, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
}

.input-shell input,
.select-shell select {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #f6fbff;
  font-size: 20px;
  font-weight: 900;
}

.custom-select-option {
  padding: 14px 18px;
  font-size: 18px;
  font-weight: 700;
  color: #c5dff0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.select-shell select {
  display: none;
}

.field-stack,
.field-row {
  display: grid;
  gap: 10px;
}

.goal-list {
  display: grid;
  gap: 10px;
}

.meal-card[hidden] {
  display: none !important;
}

.source-body {
  padding: 10px 12px 12px;
  display: grid;
  gap: 4px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.distribution-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.target-value-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.meal-chip.active {
  background: linear-gradient(135deg, #63b7e8, #5a95d8);
  color: #07131d;
}

.toggle-chip {
  min-width: 0;
  min-height: 58px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #8ea2b7;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.24s ease;
}

.target-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  max-width: 100%;
  overflow: hidden;
}

.target-unit {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.1;
  margin-bottom: 10px;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.source-thumb {
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(135deg, rgba(110, 183, 240, 0.22), rgba(16, 25, 39, 0.92));
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.custom-select.open .custom-select-options {
  max-height: 320px;
  opacity: 1;
  pointer-events: auto;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.result-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(44, 78, 108, 0.95), rgba(31, 52, 71, 0.96));
}

.card-title i {
  color: #67b8eb;
}

.custom-select-option.selected {
  background: rgba(95, 176, 228, 0.2);
  color: #6ec8f0;
}

.primary-action {
  min-height: 72px;
  border: none;
  border-radius: 20px;
  padding: 0 24px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(135deg, #63b7e8, #5a9ade);
  color: #07131d;
  box-shadow: 0 22px 40px rgba(90, 154, 222, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.save-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.result-card::after {
  content: "\f805";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 26px;
  top: 18px;
  font-size: 98px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.09);
  pointer-events: none;
}

.distribution-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.insight-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sources-card-title,
.distribution-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 900;
  color: #f4fbff;
}

.source-card {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(17, 28, 40, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.meal-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  background: rgba(16, 27, 39, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
}

.meal-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(17, 28, 40, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 10px;
}

.field-has-error .input-shell,
.field-has-error .select-shell {
  border-color: rgba(236, 98, 98, 0.8);
  box-shadow: 0 0 0 1px rgba(236, 98, 98, 0.12);
}

.insight-item strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: #f5fbff;
}

.meal-card strong {
  font-size: 30px;
  font-weight: 900;
  color: #f5fbff;
  line-height: 1;
}

.primary-action:hover {
  transform: translateY(-1px);
}