﻿/**
 * Calculator Styles - Nutrition Calculator Interface
 * 🧮 CALCULATOR: Styles for calculator view and modal
 */

/* Calculator View Styles */
.calculator-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.calculator-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px;
  background: linear-gradient(135deg, #283655 0%, #1e2a43 100%);
  color: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.calculator-header h1 {
  font-size: 2.5rem;
  margin: 0 0 10px 0;
  font-weight: 700;
}

.calculator-header p {
  font-size: 1.2rem;
  margin: 0 0 20px 0;
  opacity: 0.9;
}

/* Access Status */
.access-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.access-granted {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.2);
  padding: 12px 20px;
  border-radius: 25px;
  backdrop-filter: blur(10px);
}

.access-required {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.2);
  padding: 12px 20px;
  border-radius: 25px;
  backdrop-filter: blur(10px);
}

.access-icon {
  font-size: 1.2rem;
}

.access-text {
  font-weight: 600;
}

.calculations-remaining {
  background: rgba(255, 255, 255, 0.3);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.9rem;
}

.unlimited-calculations {
  background: rgba(76, 175, 80, 0.3);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.9rem;
}

/* Calculator Interface */
.calculator-interface {
  display: grid;
  gap: 30px;
}

.calculator-page-shell {
  min-height: calc(100vh - var(--lpo-navbar-height, 103px));
  display: grid;
  place-items: start center;
  padding: clamp(20px, 4vw, 44px);
}

.calculator-page-shell--summary {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92));
}

.calculator-summary-modal {
  width: min(760px, 100%);
  background: var(--color-surface, #ffffff);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.calculator-summary-header {
  padding: clamp(22px, 4vw, 34px);
  color: #ffffff;
  background: linear-gradient(135deg, #213047 0%, #38506f 58%, #1d5d5a 100%);
}

.calculator-summary-kicker,
.calculator-summary-serving {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.82;
}

.calculator-summary-header h1 {
  margin: 0.45rem 0 0.4rem;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.calculator-summary-recipe {
  margin: 0 0 0.6rem;
  font-size: clamp(1rem, 2.5vw, 1.18rem);
  line-height: 1.45;
  opacity: 0.95;
}

.calculator-page-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(15, 23, 42, 0.08);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.calculator-summary-card {
  min-width: 0;
  padding: 18px 16px;
  background: #ffffff;
  text-align: center;
}

.calculator-summary-card h2 {
  margin: 0 0 0.45rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.calculator-summary-card p {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 800;
  line-height: 1.1;
}

.calculator-page-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px clamp(20px, 4vw, 34px) 0;
}

.calculator-page-details p {
  margin: 0;
  padding: 6px 10px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.calculator-page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 22px clamp(20px, 4vw, 34px) clamp(22px, 4vw, 34px);
}

/* Recipe Input Section */
.recipe-input-section {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.recipe-input-section h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.recipe-form {
  display: grid;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: #555;
  font-size: 1rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #283655;
  box-shadow: 0 0 0 3px rgba(40, 54, 85, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.form-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

/* Premium Required Section */
.premium-required {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.premium-content h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 2rem;
}

.premium-content p {
  color: #666;
  margin-bottom: 30px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.premium-features {
  text-align: left;
  max-width: 500px;
  margin: 0 auto 30px;
}

.premium-features h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.premium-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.premium-features li {
  padding: 8px 0;
  color: #555;
  font-size: 1rem;
}

.upgrade-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Recent Calculations */
.recent-calculations {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.recent-calculations h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.calculations-list {
  display: grid;
  gap: 15px;
}

.calculation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.calculation-item:hover {
  background: #e9ecef;
  border-color: #283655;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.calc-info h3 {
  margin: 0 0 5px 0;
  color: #333;
  font-size: 1.1rem;
}

.calc-info p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.calc-nutrition {
  text-align: right;
}

.calc-nutrition .calories {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: #283655;
  margin-bottom: 5px;
}

.calc-nutrition .macros {
  font-size: 0.9rem;
  color: #666;
}

.no-calculations {
  text-align: center;
  padding: 40px;
  color: #666;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, #283655 0%, #1e2a43 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(40, 54, 85, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================
   Calculator Modal — enterprise-grade, clean, functional
   ============================================================ */

.calculator-modal-backdrop {
  position: fixed;
  top: var(--lpo-navbar-height, 103px);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.calculator-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.calculator-modal-container {
  background: #ffffff;
  border-radius: 20px;
  width: min(860px, 100%);
  max-height: calc(100vh - var(--lpo-navbar-height, 103px) - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(0,0,0,0.06);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
  opacity: 0;
  font-family: inherit;
}

.calculator-modal-backdrop.active .calculator-modal-container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Header */
.calculator-modal-container .calculator-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px 18px;
  background: linear-gradient(135deg, #1e2d4d 0%, #283655 60%, #1a3a5c 100%);
  color: #fff;
  flex-shrink: 0;
}

.calculator-title h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.recipe-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  opacity: 0.88;
  flex-wrap: wrap;
}

.recipe-name {
  font-weight: 500;
}

.usda-badge {
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.calculator-close-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
  line-height: 1;
}

.calculator-close-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.calculator-close-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Tabs */
.calculator-tabs {
  display: flex;
  background: #f7f8fa;
  border-bottom: 1px solid #e4e7ed;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.calculator-tabs::-webkit-scrollbar { display: none; }

.calc-tab-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.calc-tab-btn:hover {
  color: #283655;
  background: #edf0f5;
}

.calc-tab-btn.active {
  color: #283655;
  border-bottom-color: #283655;
  background: #fff;
}

/* Content area — scrollable */
.calculator-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
}

.calculator-content::-webkit-scrollbar {
  width: 6px;
}

.calculator-content::-webkit-scrollbar-track {
  background: transparent;
}

.calculator-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.calc-tab-content {
  display: none;
}

.calc-tab-content.active {
  display: block;
}

/* Nutrition Facts Panel */
.nutrition-facts-panel {
  background: #fafafa;
  border: 1px solid #e4e7ed;
  border-radius: 12px;
  overflow: hidden;
}

.nutrition-facts-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e4e7ed;
  background: #fff;
}

.nutrition-facts-header h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.serving-info {
  color: #64748b;
  font-size: 0.82rem;
  margin: 0 0 4px;
}

.usda-attribution {
  color: #94a3b8;
  font-size: 0.75rem;
}

.nutrition-facts-body {
  padding: 16px 20px;
}

.calories-section {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 5px solid #0f172a;
}

.calories-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.calories-label {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.calories-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.macronutrients-section {
  margin-bottom: 16px;
}

.macronutrients-section h4 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.nutrient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}

.nutrient-row:last-child {
  border-bottom: none;
}

.nutrient-row.detailed {
  padding: 5px 0;
}

.nutrient-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: #334155;
}

.nutrient-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
}

.nutrient-value small {
  font-weight: 400;
  color: #64748b;
  margin-left: 4px;
}

.detailed-nutrients-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e4e7ed;
}

.detailed-nutrients-section h4 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

/* Admin-only blocks */
.nutrition-quality-indicators,
.nutrition-ai-validation {
  margin-top: 16px;
  padding: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.nutrition-quality-indicators h4,
.nutrition-ai-validation h4 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1d4ed8;
}

.quality-indicator {
  margin-bottom: 10px;
}

.quality-label,
.status-label,
.quality-item-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.quality-value,
.quality-item-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  margin-left: 6px;
}

.status-badge,
.quality-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
  margin-left: 6px;
}

.quality-item {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

/* Controls / Footer */
.calculator-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #f7f8fa;
  border-top: 1px solid #e4e7ed;
  flex-shrink: 0;
}

.servings-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.servings-control label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.servings-input {
  width: 70px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  text-align: center;
  background: #fff;
  transition: border-color 0.18s ease;
}

.servings-input:focus {
  outline: none;
  border-color: #283655;
  box-shadow: 0 0 0 3px rgba(40, 54, 85, 0.1);
}

.recalculate-btn {
  padding: 7px 14px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease;
}

.recalculate-btn:hover {
  background: #15803d;
}

.recalculate-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.calculator-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.calc-action-btn {
  padding: 8px 16px;
  background: #283655;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.18s ease, transform 0.14s ease;
}

.calc-action-btn:hover {
  background: #1e2a43;
  transform: translateY(-1px);
}

.calc-action-btn.daily-intake-btn {
  background: #0e7490;
}

.calc-action-btn.daily-intake-btn:hover {
  background: #0c4a6e;
}

/* Loading States */
.calculator-loading-skeleton__content {
  padding: 60px 20px;
  text-align: center;
}

.calculator-loading-skeleton__icon {
  margin-bottom: 16px;
  font-size: 3rem;
}

.calculator-loading-skeleton__title {
  margin-bottom: 8px;
  color: #333;
}

.calculator-loading-skeleton__description {
  color: #888;
  font-size: 0.875rem;
}

.calculator-loading-skeleton__progress {
  width: 200px;
  height: 4px;
  margin: 20px auto;
  overflow: hidden;
  background: #e0e0e0;
  border-radius: 2px;
}

.calculator-loading-skeleton__bar {
  width: 60%;
  height: 100%;
  background: #283655;
  border-radius: 2px;
  animation: calc-load 1.5s ease-in-out infinite;
}

.calculator-loading {
  text-align: center;
  padding: 60px 30px;
}

.loading-spinner {
  margin-bottom: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #283655;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.quality-progress,
.metric-progress {
  width: 100%;
  height: 0.6rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e9ecef;
}

.quality-progress::-webkit-progress-bar,
.metric-progress::-webkit-progress-bar {
  background: #e9ecef;
}

.quality-progress::-webkit-progress-value,
.metric-progress::-webkit-progress-value {
  background: #283655;
}

.quality-progress::-moz-progress-bar,
.metric-progress::-moz-progress-bar {
  background: #283655;
}

@keyframes calc-load {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(80%);
  }
  100% {
    transform: translateX(180%);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .calculator-page-shell {
    padding: 12px;
  }

  .calculator-page-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calculator-page-actions {
    justify-content: stretch;
  }

  .calculator-page-actions .btn {
    width: 100%;
  }

  .calculator-view {
    padding: 10px;
  }

  .calculator-header h1 {
    font-size: 2rem;
  }

  .access-status {
    flex-direction: column;
    gap: 10px;
  }

  .form-actions {
    flex-direction: column;
  }

  .calculation-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .calc-nutrition {
    text-align: left;
  }

  .calculator-modal-backdrop {
    padding: 8px;
  }

  .calculator-modal-container {
    width: 100%;
    border-radius: 16px;
    max-height: 96vh;
  }

  .calculator-modal-container .calculator-header {
    padding: 16px 18px;
  }

  .calculator-content {
    padding: 16px;
  }

  .calc-tab-btn {
    font-size: 0.78rem;
    padding: 10px 12px;
  }

  .calculator-controls {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding: 14px 16px;
  }

  .servings-control {
    justify-content: center;
  }

  .calculator-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Login Required States */
.calculator-login-required,
.premium-required {
  text-align: center;
  padding: 60px 30px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.calculator-login-required h3,
.premium-required h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.calculator-login-required p,
.premium-required p {
  color: #666;
  margin-bottom: 30px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.login-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   ADDITIONAL STYLES FOR CALCULATOR UI
   Referenced in calculator-ui.js comments
   ======================================== */

/* Ingredient card states */
.ingredient-card.zero-data {
  border-left: 4px solid #ff9800;
  background-color: #fff3e0;
}

.ingredient-card.valid {
  border-left: 4px solid #28a745;
}

.ingredient-card.unmapped {
  border-left: 4px solid #f44336;
  background-color: #ffebee;
}

/* Warning data */
.warning-data {
  padding: 12px;
  background-color: #fff3e0;
  border-radius: 4px;
  margin: 8px 0;
}

.warning-data p {
  margin: 4px 0;
  color: #f57c00;
  font-size: 14px;
}

.warning-data .help-text {
  font-size: 12px;
  color: #666;
}

/* Refetch button */
.btn-refetch {
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background-color: #0F172A3D;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.btn-refetch:hover {
  background-color: #d4955f;
}

/* Zero value nutrition */
.nutrition-card.zero-value {
  opacity: 0.5;
  position: relative;
}

.zero-warning {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 16px;
}

/* ========================================
   NUTRITION SUMMARY SECTIONS
   For Total Recipe and Per-Serving display
   ======================================== */

/* Calculator Section Container */
.calculator-section {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.calculator-section h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.8rem;
  font-weight: 700;
}

/* Nutrition Section */
.nutrition-section {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Section Subtitle */
.section-subtitle {
  color: #333;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #e9ecef;
}

/* Total Recipe Nutrition Section */
.nutrition-total-section {
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #283655;
}

.nutrition-total-section .section-subtitle {
  color: #283655;
  border-bottom-color: #283655;
}

/* Per-Serving Nutrition Section */
.nutrition-serving-section {
  margin-top: 30px;
  padding: 20px;
  background: #f0f7ff;
  border-radius: 10px;
  border-left: 4px solid #28a745;
}

.nutrition-serving-section .section-subtitle {
  color: #28a745;
  border-bottom-color: #28a745;
}

/* Nutrition Grid */
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.nutrition-grid-full {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Nutrition Card */
.nutrition-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.nutrition-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.nutrition-card-label {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 5px;
  font-weight: 500;
}

.nutrition-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
}

.nutrition-card-unit {
  font-size: 0.9rem;
  color: #999;
  margin-left: 4px;
}

/* Primary Nutrients (Calories, Protein, Carbs, Fat) */
.nutrition-card.primary {
  background: linear-gradient(135deg, #283655 0%, #1e2a43 100%);
  color: white;
  border: none;
}

.nutrition-card.primary .nutrition-card-label,
.nutrition-card.primary .nutrition-card-value,
.nutrition-card.primary .nutrition-card-unit {
  color: white;
}

/* Validation Messages */
.validation-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.validation-message.error {
  background-color: #ffebee;
  border-left: 4px solid #f44336;
  color: #c62828;
}

.validation-message.warning {
  background-color: #fff3e0;
  border-left: 4px solid #ff9800;
  color: #e65100;
}

.validation-message.info {
  background-color: #ebeef3;
  border-left: 4px solid #283655;
  color: #1e2a43;
}

.validation-message.success {
  background-color: #d4edda;
  border-left: 4px solid #28a745;
  color: #2e7d32;
}

.validation-message-icon {
  font-size: 1.2rem;
}

/* No Data Message */
.no-data {
  text-align: center;
  padding: 40px;
  color: #999;
  font-style: italic;
}

/* Responsive Design for Nutrition Sections */
@media (max-width: 768px) {
  .nutrition-grid {
    grid-template-columns: 1fr;
  }

  .nutrition-grid-full {
    grid-template-columns: 1fr;
  }

  .nutrition-total-section,
  .nutrition-serving-section {
    padding: 15px;
  }

  .section-subtitle {
    font-size: 1.1rem;
  }

  .calculator-section {
    padding: 20px;
  }
}

/* Extended nutrients panel */
.calculator-extended-nutrients {
  padding: clamp(14px, 3vw, 22px) clamp(20px, 4vw, 34px);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.calculator-extended-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.calculator-extended-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  overflow: hidden;
  list-style: none;
  margin: 0;
  padding: 0;
}

.calculator-extended-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: #ffffff;
}

.calculator-extended-label {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.calculator-extended-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

/* Not-detected block — shared between extended panel and detailed modal */
.calculator-not-detected,
.nutrient-row--not-detected {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.calculator-not-detected-label,
.nutrient-not-detected-label {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  white-space: nowrap;
}

.calculator-not-detected-list,
.nutrient-not-detected-list {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.55;
}
