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

:root {
  --primary-color: #4CAF50;
  --secondary-color: #45a049;
  --danger-color: #F44336;
  --warning-color: #FF9800;
  --text-primary: #333;
  --text-secondary: #666;
  --background: #f5f5f5;
  --card-background: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

#app {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

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

.icon-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  color: white;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

header .icon-btn {
  color: white;
}

/* Date Navigation */
.date-nav {
  background: var(--card-background);
  margin: 1rem 1rem 0 1rem;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-nav-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.date-nav-btn:hover {
  background: var(--secondary-color);
}

.date-nav-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

#weightDate,
.current-date {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Summary Card */
.summary-card {
  background: var(--card-background);
  margin: 1.5rem 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.daily-progress {
  text-align: center;
}

.progress-text {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.progress-bar {
  width: 100%;
  height: 20px;
  background-color: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 10px;
}

.remaining-calories {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Macros Section */
.macros-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.macro-item {
  margin-bottom: 1rem;
}

.macro-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.macro-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.macro-bar {
  flex: 1;
  height: 12px;
  background-color: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.macro-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 6px;
}

.macro-fill.protein {
  background: linear-gradient(90deg, #FF6B6B, #EE5A52);
}

.macro-fill.carbs {
  background: linear-gradient(90deg, #4ECDC4, #44A08D);
}

.macro-fill.fat {
  background: linear-gradient(90deg, #FFD93D, #F6C90E);
}

.macro-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 70px;
  text-align: right;
}

/* Meals Section */
.meals-section {
  padding: 0 1rem;
}

.meal-category {
  background: var(--card-background);
  margin-bottom: 1.5rem;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.meal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.meal-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

.meal-calories {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
}

.meal-items {
  margin: 1rem 0;
  min-height: 20px;
}

.meal-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--background);
  border-radius: 8px;
  transition: background 0.2s;
  gap: 0.75rem;
}

.meal-item:hover {
  background: #ebebeb;
}

.meal-item-image {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.meal-item .delete-btn {
  flex-shrink: 0;
  margin-left: auto;
}

/* Highlight animation for newly copied meals */
.meal-item.highlight-meal {
  animation: highlightPulse 3s ease-in-out;
  background: #c8e6c9;
}

@keyframes highlightPulse {
  0%, 100% {
    background: var(--background);
    transform: scale(1);
  }
  10% {
    background: #81c784;
    transform: scale(1.02);
  }
  20%, 80% {
    background: #c8e6c9;
    transform: scale(1);
  }
  90% {
    background: #e8f5e9;
    transform: scale(1);
  }
}

.meal-item-info {
  flex: 1;
}

.meal-item-name {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.meal-item-details {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.delete-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  line-height: 1;
}

.delete-btn:hover {
  background: #d32f2f;
}

.add-food-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.add-food-btn:hover {
  background: var(--secondary-color);
}

/* Clickable meal items for copying */
body.historical-view .meal-item {
  cursor: pointer;
  transition: background 0.2s;
}

body.historical-view .meal-item:hover {
  background: #e8f5e9;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background-color: var(--card-background);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

.close-btn:hover {
  background: var(--background);
}

.modal-body {
  padding: 1.5rem;
}

/* Food Search */
.search-bar-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

#foodSearch,
#ingredientSearch {
  flex: 1;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.3s;
}

#foodSearch:focus,
#ingredientSearch:focus {
  outline: none;
  border-color: var(--primary-color);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: #3d8b40;
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

.food-results {
  max-height: 400px;
  overflow-y: auto;
}

.food-category {
  margin-bottom: 1.5rem;
}

.food-category-header {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.food-category-header.recently-used {
  color: var(--primary-color);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.food-category-header.recently-used::before {
  content: '🕒';
  font-size: 1.2rem;
}

.food-item {
  padding: 0.75rem;
  cursor: pointer;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.food-item:hover {
  background: var(--background);
}

.food-item-image {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
}

.food-item-image-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
  flex-shrink: 0;
}

.food-item-content {
  flex: 1;
  min-width: 0;
}

.food-item-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.food-item-calories {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Selected Food */
.selected-food {
  background: var(--background);
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.selected-food h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.food-calories {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.food-macros-info {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: var(--background);
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.macro-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.macro-info strong {
  color: var(--text-primary);
  font-weight: 600;
}

.serving-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.serving-input label {
  font-weight: 600;
  min-width: 100px;
}

.serving-input input {
  flex: 1;
  padding: 0.5rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
}

.serving-input input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.total-calories {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 1rem 0;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.3s;
  background: white;
  color: var(--text-primary);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-row .form-group {
  margin-bottom: 0;
}

.form-section-header {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 1.5rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.calculated-goal {
  background: var(--background);
  padding: 1rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  text-align: center;
  font-size: 1.1rem;
}

.calculated-goal span {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.3rem;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: var(--secondary-color);
}

.btn-secondary {
  width: 100%;
  padding: 0.75rem;
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 1rem;
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
}

.btn-danger-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.85em;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-danger-small:hover {
  background: #c0392b;
}

/* Custom Foods Management */
.custom-foods-list {
  max-height: 500px;
  overflow-y: auto;
}

.custom-food-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--background);
  border-radius: 8px;
  transition: background 0.2s;
}

.custom-food-item:hover {
  background: #ebebeb;
}

.custom-food-info {
  flex: 1;
}

.custom-food-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-food-badge {
  background: var(--primary-color);
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.custom-food-image-preview {
  margin-top: 0.5rem;
  text-align: center;
}

.custom-food-image-preview img {
  max-width: 100px;
  max-height: 100px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.custom-food-details {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.custom-food-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit,
.btn-delete-custom {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-edit {
  background: var(--warning-color);
  color: white;
}

.btn-edit:hover {
  background: #F57C00;
}

.btn-delete-custom {
  background: var(--danger-color);
  color: white;
}

.btn-delete-custom:hover {
  background: #d32f2f;
}

.no-data-message {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-style: italic;
}

/* Stats Modal */
.stats-modal {
  max-width: 700px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.9;
}

.stats-section {
  margin-bottom: 2rem;
}

.stats-section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.macro-stats {
  background: var(--background);
  padding: 1rem;
  border-radius: 8px;
}

.macro-stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.macro-stat-item:last-child {
  border-bottom: none;
}

.macro-stat-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.macro-stat-value {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.top-foods-list {
  max-height: 300px;
  overflow-y: auto;
}

.top-food-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--background);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.top-food-name {
  font-weight: 600;
  color: var(--text-primary);
}

.top-food-count {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

  .progress-text {
    font-size: 1.5rem;
  }

  .meal-header h2 {
    font-size: 1.1rem;
  }

  #foodSearch,
  #ingredientSearch {
    min-width: 50px;
    flex: 1 1 auto;
    max-width: calc(100% - 150px);
  }

  .modal-content {
    max-height: 95vh;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-header h2 {
    font-size: 1.25rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .serving-input {
    flex-wrap: wrap;
  }

  .serving-input label {
    width: 100%;
  }
}

/* Copy to Today Modal */
.modal-compact {
  max-width: 400px;
}

.meal-type-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.meal-type-btn {
  padding: 1rem;
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.meal-type-btn:hover {
  background: #e8f5e9;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

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

/* Historical View - Different color scheme for non-current days */
body.historical-view {
  --primary-color: #5B7CDB;
  --secondary-color: #4A67C4;
}

body.historical-view header {
  background: linear-gradient(135deg, #5B7CDB, #4A67C4);
}

body.historical-view ::-webkit-scrollbar-thumb {
  background: #5B7CDB;
}

body.historical-view ::-webkit-scrollbar-thumb:hover {
  background: #4A67C4;
}

body.historical-view .progress-fill {
  background: linear-gradient(90deg, #5B7CDB, #4A67C4) !important;
}

/* Barcode Scanner Styles */
.button-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.button-group button {
  flex: 1;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 1rem auto;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

#barcodeVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scanner-line {
  width: 80%;
  height: 3px;
  background: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
  animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% {
    transform: translateY(-100px);
    opacity: 0;
  }
  50% {
    transform: translateY(100px);
    opacity: 1;
  }
}

.scanner-status {
  padding: 0.75rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}

.scanner-status.info {
  background: #e3f2fd;
  color: #1565c0;
}

.scanner-status.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.scanner-status.error {
  background: #ffebee;
  color: #c62828;
}

.scanner-status.scanning {
  background: #fff3e0;
  color: #e65100;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.scanner-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.scanner-manual {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border-color);
}

@media (max-width: 768px) {
  .button-group {
    flex-direction: column;
  }

  .video-container {
    max-width: 100%;
  }
}

/* Combined Food Styles */
.ingredients-list {
  margin-bottom: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.no-ingredients {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-style: italic;
}

.ingredient-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--background);
  border-radius: 8px;
  transition: background 0.2s;
}

.ingredient-item:hover {
  background: #ebebeb;
}

.ingredient-info {
  flex: 1;
}

.ingredient-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.ingredient-amount {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.ingredient-macros {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.remove-ingredient-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.remove-ingredient-btn:hover {
  opacity: 0.8;
}

.combined-food-totals {
  background: #e8f5e9;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.combined-food-totals h3 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.totals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.total-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-label {
  font-weight: 600;
  color: var(--text-primary);
}

.total-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Update Notification Styles */
.update-notification {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  animation: slideUp 0.3s ease-out;
}

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

.update-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.update-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.update-icon svg {
  animation: rotate 2s linear infinite;
  color: white;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.update-message {
  flex: 1;
  min-width: 200px;
}

.update-message strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.update-message p {
  margin: 0;
  opacity: 0.95;
  font-size: 0.95rem;
}

.update-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-update,
.btn-dismiss {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.btn-update {
  background: white;
  color: #667eea;
}

.btn-update:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-dismiss {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
  .update-content {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .update-actions {
    width: 100%;
  }

  .btn-update,
  .btn-dismiss {
    flex: 1;
  }
}
