/* Meal Planner Styles - Matches Nutrition/Workout aesthetic */

.meal-planner-space {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  color: var(--text);
}

/* Header & Tabs */
.mp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.mp-tabs {
  display: flex;
  gap: 8px;
}

.mp-tab {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.mp-tab:hover {
  background: rgba(196, 149, 106, 0.1);
}

.mp-tab.active {
  background: rgba(196, 149, 106, 0.2);
  border-color: var(--rose);
  color: var(--rose);
}

.mp-add-recipe-btn {
  padding: 10px 20px;
  background: var(--rose);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.mp-add-recipe-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Date Navigation */
.mp-date-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  justify-content: center;
}

.mp-nav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--rose);
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-nav-btn:hover {
  background: rgba(196, 149, 106, 0.1);
}

.mp-date-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
}

.mp-today-btn,
.mp-copy-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.mp-today-btn:hover,
.mp-copy-btn:hover {
  border-color: var(--rose);
  color: var(--rose);
}

/* Week Navigation */
.mp-week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.mp-week-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--rose);
}

/* Daily Summary */
.mp-daily-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.mp-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.mp-summary-card.protein {
  border-color: rgba(104, 185, 132, 0.3);
}

.mp-summary-card.carbs {
  border-color: rgba(139, 150, 201, 0.3);
}

.mp-summary-card.fat {
  border-color: rgba(212, 136, 136, 0.3);
}

.mp-summary-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.mp-summary-value {
  display: block;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
}

/* Meal Slots */
.mp-meal-slots {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mp-meal-slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.mp-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.mp-slot-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--rose);
  margin: 0;
}

.mp-add-btn {
  padding: 6px 14px;
  background: rgba(196, 149, 106, 0.1);
  border: 1px solid rgba(196, 149, 106, 0.3);
  color: var(--rose);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.mp-add-btn:hover {
  background: rgba(196, 149, 106, 0.2);
}

.mp-slot-meals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-meal-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

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

.mp-meal-name {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.mp-meal-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

.mp-meal-macros {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.mp-meal-actions {
  display: flex;
  gap: 4px;
}

.mp-edit-btn,
.mp-delete-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-edit-btn:hover {
  background: rgba(196, 149, 106, 0.2);
  color: var(--rose);
}

.mp-delete-btn:hover {
  background: rgba(212, 136, 136, 0.2);
  color: #d48888;
}

.mp-empty-slot {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}

/* Week View Grid */
.mp-week-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.mp-week-header {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  background: rgba(196, 149, 106, 0.1);
  border-bottom: 1px solid var(--border);
}

.mp-week-day-header {
  padding: 12px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--rose);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mp-week-row {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}

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

.mp-week-meal-label {
  padding: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: capitalize;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.mp-week-cell {
  padding: 8px;
  border-left: 1px solid var(--border);
  min-height: 60px;
}

.mp-week-meal {
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-week-meal.has-recipe {
  background: rgba(196, 149, 106, 0.15);
  color: var(--rose);
}

.mp-week-meal.custom {
  background: rgba(139, 150, 201, 0.15);
  color: #8b96c9;
}

/* Recipe Browser */
.mp-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.mp-search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
}

.mp-filter-select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  min-width: 140px;
}

.mp-recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.mp-recipe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.mp-recipe-card:hover {
  transform: translateY(-2px);
  border-color: var(--rose);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mp-recipe-image {
  height: 140px;
  background: rgba(255, 255, 255, 0.05);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-recipe-no-image {

.mp-recipe-no-image {
  font-size: 48px;
  opacity: 0.3;
}

.mp-recipe-difficulty {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 11px;
  border-radius: 4px;
  text-transform: capitalize;
}

.mp-recipe-content {
  padding: 16px;
}

.mp-recipe-content h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  margin: 0 0 4px 0;
  color: var(--text);
}

.mp-recipe-cuisine {
  font-size: 12px;
  color: var(--rose);
  margin: 0 0 8px 0;
}

.mp-recipe-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.mp-recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mp-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(196, 149, 106, 0.15);
  color: var(--rose);
  border-radius: 12px;
}

.mp-empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

/* Modal Styles */
.mp-recipe-modal {
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
}

.mp-form-row {
  margin-bottom: 16px;
}

.mp-form-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.mp-form-section {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.mp-form-section label {
  display: block;
  font-size: 13px;
  color: var(--rose);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mp-ingredient-inputs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mp-add-ingredient-btn,
.mp-add-instruction-btn {
  padding: 8px 16px;
  background: var(--rose);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.mp-ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-ingredient-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.mp-ingredient-item button {
  background: none;
  border: none;
  color: #d48888;
  cursor: pointer;
  font-size: 18px;
}

.mp-instruction-input {
  margin-bottom: 12px;
}

.mp-instruction-input textarea {
  margin-bottom: 8px;
}

.mp-instructions-list {
  margin: 0;
  padding-left: 24px;
}

.mp-instructions-list li {
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.mp-instructions-list li button {
  background: none;
  border: none;
  color: #d48888;
  cursor: pointer;
  font-size: 18px;
}

/* Meal Modal */
.mp-meal-modal {
  max-width: 500px;
}

.mp-recipe-selection {
  margin-bottom: 16px;
}

.mp-selected-recipe {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(196, 149, 106, 0.1);
  border: 1px solid var(--rose);
  border-radius: 8px;
  margin-bottom: 12px;
}

.mp-selected-recipe button {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.mp-recipe-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mp-recipe-list-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
}

.mp-recipe-list-item:last-child {
  border-bottom: none;
}

.mp-recipe-list-item:hover {
  background: rgba(196, 149, 106, 0.1);
}

.mp-recipe-list-item .name {
  font-weight: 500;
  color: var(--text);
}

.mp-recipe-list-item .meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .meal-planner-space {
    padding: 12px;
  }

  .mp-header {
    flex-direction: column;
    align-items: stretch;
  }

  .mp-tabs {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .mp-daily-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .mp-summary-value {
    font-size: 18px;
  }

  .mp-meal-card {
    flex-wrap: wrap;
  }

  .mp-meal-macros {
    width: 100%;
    order: 3;
  }

  .mp-week-grid {
    font-size: 11px;
  }

  .mp-week-cell {
    min-height: 40px;
    padding: 4px;
  }

  .mp-recipe-grid {
    grid-template-columns: 1fr;
  }

  .mp-form-cols {
    grid-template-columns: 1fr;
  }

  .mp-ingredient-inputs {
    flex-wrap: wrap;
  }

  .mp-tag-filters {
    flex-wrap: wrap;
  }
}

/* Tag category colors */
.mp-tag-meal { background: rgba(196, 149, 106, 0.2); color: #c4956a; }
.mp-tag-effort { background: rgba(139, 150, 201, 0.2); color: #8b96c9; }
.mp-tag-nutrition { background: rgba(106, 166, 130, 0.2); color: #6aa682; }
.mp-tag-lifestyle { background: rgba(180, 140, 180, 0.2); color: #b48cb4; }

.mp-tag-filters {
  margin-top: 4px;
  gap: 6px;
}

/* Star rating in form */
.mp-rating-stars {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mp-star {
  cursor: pointer;
  font-size: 1.6em;
  color: #3a3530;
  transition: color 0.15s;
}
.mp-star:hover, .mp-star-filled {
  color: #c4956a;
}

/* Small stars on recipe cards */
.mp-star-small {
  font-size: 0.85em;
  color: #3a3530;
}
.mp-star-small.mp-star-filled {
  color: #c4956a;
}
.mp-recipe-rating {
  margin-top: 4px;
}
