﻿/* Custom Calendar Styles - No FullCalendar */

/* Base calendar container */
#calendar-container {
  font-family: var(--bs-body-font-family);
  color: var(--bs-body-color);
}

/* Custom views (common styles) */
/* ==================== MONTH VIEW STYLES ==================== */

/* Month header */
/* Weekday headers */
/* Calendar days grid */
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.day-button {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: none;
  background: none;
  position: relative;
  font-weight: 500;
  padding: 0;
  transition: all 0.2s ease;
}

.day-button:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.day-button.has-events {
  font-weight: 700;
  color: var(--bs-primary);
}

.calendar-day.today .day-button {
  background-color: rgba(var(--bs-primary-rgb), 0.15);
  color: var(--bs-primary);
  font-weight: 700;
}

.calendar-day.other-month .day-button {
  color: var(--bs-secondary);
  opacity: 0.6;
}

/* Event badges for days */
.events-badge-container {
  position: absolute;
  top: -1px;
  right: 0px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.events-badge {
  min-width: 20px;
  height: 20px;
  color: var(--bs-emphasis-color);
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 5px;
}

.recipe-badge {
  background-color: var(--bs-primary);
  border: 1px solid var(--bs-body-color);
}

.snack-badge {
  background-color: var(--bs-warning);
  border: 1px solid var(--bs-body-color);
}

/* ==================== WEEK VIEW STYLES ==================== */

/* Week header */
/* Accordion styling for days */
.custom-week-view .accordion-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(var(--bs-border-color-rgb), 0.2);
}

.custom-week-view .accordion-button {
  padding: 0.75rem 1rem;
  background-color: rgba(var(--bs-light-rgb), 0.5);
}

.custom-week-view .accordion-button:not(.collapsed) {
  background-color: rgba(var(--bs-primary-rgb), 0.05);
  color: var(--bs-primary);
}

.custom-week-view .accordion-button:focus {
  box-shadow: none;
  border-color: rgba(var(--bs-primary-rgb), 0.25);
}

.custom-week-view .accordion-body {
  padding: 1rem;
}

.day-date {
  font-size: var(--fs-body);
  color: var(--bs-secondary);
}

/* Timeline view for days */
.meal-timeline {
  padding: 0.5rem 0;
}

.timeline-item {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  margin-bottom: 1rem;
}

.timeline-item:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.timeline-bullet {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background-color: var(--bs-primary);
  flex-shrink: 0;
}

.timeline-time {
  color: var(--bs-secondary);
  font-size: var(--fs-body-lg);
}

.timeline-title {
  font-weight: 500;
}

.timeline-content {
  padding-top: 6px;
}

/* Nutrition pills */
.nutrition-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

/* ==================== DAY VIEW STYLES ==================== */

/* Day header */
.day-header {
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.day-header h5 {
  font-weight: 600;
  color: var(--bs-primary);
}

/* Meal type sections */
.meal-type-header {
  position: relative;
  padding-left: 0.5rem;
  border-left: 3px solid var(--bs-primary);
  color: var(--bs-primary);
  margin-bottom: 1rem;
}

/* Day event cards */
.day-event-card {
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.day-event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--glass-black-10) !important;
}

.day-event-card .card-title {
  font-size: var(--fs-md);
  font-weight: 600;
}

/* Nutrition summary in cards */
.nutrition-summary {
  font-size: var(--fs-body);
}

/* ==================== MODAL STYLES ==================== */

/* Day events modal */
#dayEventsModal .modal-content {
  border-radius: var(--radius-md);
  overflow: hidden;
}

#dayEventsModal .modal-header {
  background-color: rgba(var(--bs-primary-rgb), 0.05);
  border-bottom: none;
}

#dayEventsModal .modal-footer {
  border-top: none;
}

/* Edit modal */
#editMealModal .modal-content {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

#editMealModal .modal-header {
  background-color: rgba(var(--bs-primary-rgb), 0.05);
  border-bottom: none;
}

#editMealModal .modal-footer {
  border-top: none;
  padding-top: 0;
}

/* Custom tooltip for empty space clicks */
@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.meal-tooltip-content h6 {
  margin: 0;
  font-weight: 600;
  color: var(--bs-primary);
}

/* ==================== COMMON COMPONENTS ==================== */

/* Recipe vs Snack Differentiation */
.recipe-event {
  background-color: var(--bs-primary) !important;
  background-image: linear-gradient(
    45deg,
    var(--bs-primary),
    var(--bs-primary-subtle)
  ) !important;
  border: none !important;
}

.snack-event {
  background-color: var(--bs-warning) !important;
  background-image: linear-gradient(
    45deg,
    var(--bs-warning),
    var(--bs-warning-subtle)
  ) !important;
  border: none !important;
}

/* Consumed meal indicator */
/* Hover shadow effect */
.hover-shadow:hover {
  box-shadow: 0 0.25rem 0.75rem var(--glass-black-10) !important;
}

/* Toast container styles */
.toast-container {
  z-index: 1100;
}

/* ==================== RESPONSIVE STYLES ==================== */

/* Mobile styles */
@media (max-width: 768px) {
  /* Month view adjustments */
  .events-badge {
    min-width: 18px;
    height: 18px;
    font-size: var(--fs-2xs);
  }

  /* Week view adjustments */
  .custom-week-view .accordion-button {
    padding: 0.5rem 0.75rem;
  }

  .timeline-item-header {
    flex-wrap: wrap;
  }

  /* Day view adjustments */
  .day-content .row .col-md-6 {
    margin-bottom: 1rem;
  }

  /* Modal adjustments */
  #dayEventsModal .modal-dialog {
    margin: 0.5rem;
  }

  /* Tooltip adjustments */}

/* Extra small devices */
@media (max-width: 480px) {
  /* Month view adjustments */
  .calendar-day {
    height: 40px;
  }

  .events-badge {
    min-width: 16px;
    height: 16px;
    font-size: var(--fs-2xs);
  }

  /* Timeline adjustments */
  .timeline-item {
    padding: 5px;
  }

  .timeline-content {
    padding-left: 15px !important;
  }

  /* Modal adjustments */
  .modal-body .row .col-md-6 {
    padding: 0 0.5rem;
  }
}

/* ==================== DARK MODE SUPPORT ==================== */

/* Dark mode styles */
[data-bs-theme="dark"] .calendar-day.today .day-button {
  background-color: rgba(var(--bs-primary-rgb), 0.25);
}

[data-bs-theme="dark"] .day-button:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.2);
}

[data-bs-theme="dark"] .events-badge {
  border-color: var(--bs-dark);
}

[data-bs-theme="dark"] .timeline-bullet {
  box-shadow: 0 0 0 2px var(--bs-dark);
}

[data-bs-theme="dark"] .timeline-item:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.15);
}

[data-bs-theme="dark"] .accordion-button {
  background-color: var(--glass-white-5);
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: rgba(var(--bs-primary-rgb), 0.2);
}
.meal-tooltip {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 16px;
  max-width: 280px;
  z-index: 9999;
  font-size: 14px;
  border: 1px solid rgba(var(--bs-border-color-rgb), 0.2);
  transform: translateY(0);
  animation: tooltipFadeIn 0.2s ease-out;
  position: absolute;
}
.meal-consumed {
  opacity: 0.85;
  position: relative;
}

.meal-consumed::after {
  content: "\f058";
  /* checkmark circle icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: -5px;
  right: -5px;
  color: var(--bs-success);
  background-color: white;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.custom-month-view,
.custom-week-view,
.custom-day-view {
  padding: 1rem;
  background-color: var(--bs-body-bg);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  width: 100%;
  overflow-x: hidden;
}

/* ==================== MONTH VIEW STYLES (FIXED RESPONSIVE) ==================== */

/* Month header - removed week view button */
.month-header {
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1), rgba(var(--bs-primary-rgb), 0.05));
  border-radius: 0.5rem;
  padding: 1rem;
}

.month-header h5 {
  font-weight: 600;
  color: var(--bs-primary);
  margin: 0;
}

/* Weekday headers */
.calendar-weekdays {
  display: grid;
  grid-template-columns: 24px repeat(7, 1fr);
  /* Add column for week view buttons */
  text-align: center;
  margin-bottom: 0.5rem;
  gap: 0.125rem;
}

.week-view-header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--bs-secondary);
  font-weight: 600;
}

.weekday-header {
  font-weight: 600;
  color: var(--bs-secondary-text-emphasis);
  font-size: 0.875rem;
  padding: 0.5rem 0.25rem;
  background: var(--bs-secondary-bg-subtle);
  border-radius: 0.375rem;
}
.calendar-days {
  display: grid;
  grid-template-columns: 24px repeat(7, 1fr);
  /* Add column for week view buttons */
  grid-gap: 0.125rem;
  width: 100%;
}

.calendar-week-row {
  display: contents;
  /* Make week rows part of the grid */
}

.week-view-btn-cell {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0.125rem;
}
/* Animation for success actions */
@keyframes pulseSuccess {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--bs-success-rgb), 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(var(--bs-success-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--bs-success-rgb), 0);
  }
}

.highlight-form {
  animation: highlightPulse 2s ease-in-out 3;
  border: 2px solid #28a745 !important;
  box-shadow: 0 0 15px rgba(40, 167, 69, 0.3);
}

@keyframes highlightPulse {
  0% {
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
    border-color: #28a745;
  }
  50% {
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.6);
    border-color: #5cb85c;
  }
  100% {
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
    border-color: #28a745;
  }
}

.form-highlighted {
  border: 2px solid #28a745;
  transition: all 0.3s ease;
}
/* Custom Calendar Styles - Optimized Design */

/* Base calendar container */
#calendar-container {
  font-family: var(--bs-body-font-family);
  color: var(--bs-body-color);
}

/* Custom views (common styles) */
/* ==================== MONTH VIEW STYLES (IMPROVED) ==================== */

/* Month header with week view button */
/* Weekday headers */
/* Calendar days grid - IMPROVED */
.calendar-day {
  min-height: 80px;
  /* Fixed height instead of aspect-ratio */
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: var(--radius-md);
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-body-color);
  transition: all 0.2s ease;
}

.calendar-day:hover {
  border-color: rgba(var(--bs-primary-rgb), 0.3);
  box-shadow: 0 0.25rem 0.5rem var(--glass-black-10);
  transform: translateY(-1px);
}

.day-button {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  border-radius: var(--radius-md);
  /* Rectangular, not circular */
  border: none;
  background: none;
  position: relative;
  font-weight: 500;
  padding: 0.5rem;
  transition: all 0.2s ease;
  text-align: left;
}

.day-button:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.08);
}

.day-button.has-events {
  font-weight: 700;
  color: var(--bs-primary);
}

.calendar-day.today {
  background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.15), rgba(var(--bs-primary-rgb), 0.08));
  border-color: var(--bs-primary);
}

.calendar-day.today .day-button {
  color: var(--bs-primary);
  font-weight: 700;
}

.calendar-day.other-month {
  opacity: 0.5;
}

.calendar-day.other-month .day-button {
  color: var(--bs-secondary);
}

/* Event badges for days - IMPROVED */
.events-badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.events-badge {
  min-width: 24px;
  height: 20px;
  color: var(--bs-emphasis-color);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0 0.375rem;
  box-shadow: 0 1px 3px var(--glass-black-20);
}

.recipe-badge {
  background: linear-gradient(135deg, var(--bs-primary-bg-subtle), var(--bs-primary));
}

.snack-badge {
  background: linear-gradient(135deg, var(--bs-warning-bg-subtle), var(--bs-warning));
}

/* ==================== DAY VIEW STYLES (MODERNIZED) ==================== */

/* Day header */
.day-header {
  padding: 0.75rem 0;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1), rgba(var(--bs-primary-rgb), 0.05));
  border-radius: var(--radius-md);
  padding: 1rem;
}

.day-header h5 {
  font-weight: 600;
  color: var(--bs-primary);
  margin: 0;
}

/* Meal type sections - ENHANCED */
.meal-type-header {
  position: relative;
  padding: 1rem;
  border-left: 4px solid var(--bs-primary);
  background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0.1), transparent);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--bs-primary);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.meal-type-header i {
  color: var(--bs-primary);
}

/* Day event cards - MODERNIZED */
.day-event-card {
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(var(--bs-border-color-rgb), 0.1);
  background: var(--bs-body-bg);
  position: relative;
}

.day-event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--bs-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.day-event-card:hover::before {
  transform: scaleY(1);
}

.day-event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem var(--glass-black-15) !important;
  border-color: rgba(var(--bs-primary-rgb), 0.3);
}

.day-event-card .card-body {
  padding: 1.25rem;
}

.day-event-card .card-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* Enhanced nutrition summary */
.nutrition-summary {
  font-size: var(--fs-body);
  background: rgba(var(--bs-light-rgb), 0.5);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 0.75rem;
}

.nutrition-summary .row {
  --bs-gutter-x: 0.5rem;
}

.nutrition-summary .col-3 {
  text-align: center;
  padding: 0.25rem;
}

.nutrition-summary .fw-bold {
  font-size: var(--fs-md);
  color: var(--bs-primary);
}

/* Daily summary card enhancement */
.daily-summary-card {
  background: linear-gradient(135deg, rgba(var(--bs-success-rgb), 0.1), rgba(var(--bs-info-rgb), 0.1));
  border: 1px solid rgba(var(--bs-success-rgb), 0.2);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.daily-summary-card .card-body {
  padding: 1.5rem;
}

.daily-summary-card .card-title {
  color: var(--bs-success);
  font-weight: 600;
  margin-bottom: 1rem;
}

.daily-summary-card .fs-5 {
  font-size: 1.5rem !important;
  font-weight: 700;
  color: var(--bs-primary);
}

/* ==================== WEEK VIEW STYLES (MINOR IMPROVEMENTS) ==================== */

/* Week header */
/* Enhanced timeline items */
.timeline-item {
  position: relative;
  cursor: pointer;
  padding: 1rem;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  margin-bottom: 1rem;
  background: rgba(var(--bs-light-rgb), 0.3);
  border: 1px solid rgba(var(--bs-border-color-rgb), 0.1);
}

.timeline-item:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.08);
  border-color: rgba(var(--bs-primary-rgb), 0.2);
  transform: translateX(4px);
}

/* ==================== RESPONSIVE STYLES (ENHANCED) ==================== */

/* Tablet styles */
@media (max-width: 992px) {
  .calendar-day {
    min-height: 70px;
  }

  .day-button {
    padding: 0.375rem;
  }

  .events-badge {
    min-width: 22px;
    height: 18px;
    font-size: var(--fs-2xs);
  }
}

/* Mobile styles */
@media (max-width: 768px) {

  /* Month view mobile adjustments */
  .calendar-day {
    min-height: 60px;
  }

  .day-button {
    padding: 0.25rem;
    font-size: var(--fs-body);
  }

  .events-badge {
    min-width: 20px;
    height: 16px;
    font-size: var(--fs-2xs);
    padding: 0 0.25rem;
  }

  /* Day view mobile adjustments */
  .meal-type-header {
    padding: 0.75rem;
    font-size: var(--fs-md);
  }

  .day-event-card .card-body {
    padding: 1rem;
  }

  .day-event-card .card-title {
    font-size: var(--fs-md);
  }

  .nutrition-summary {
    padding: 0.5rem;
  }

  .daily-summary-card .card-body {
    padding: 1rem;
  }

  .daily-summary-card .fs-5 {
    font-size: 1.25rem !important;
  }

  /* Week view mobile adjustments */
  .timeline-item {
    padding: 0.75rem;
  }

  .timeline-content {
    padding-left: 1rem !important;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .calendar-day {
    min-height: 50px;
  }

  .day-button {
    padding: 0.125rem;
    font-size: var(--fs-body-sm);
  }

  .events-badge {
    min-width: 18px;
    height: 14px;
    font-size: 0.55rem;
  }

  .events-badge-container {
    gap: 0.125rem;
  }

  .month-header,
  .week-header,
  .day-header {
    padding: 0.75rem;
  }

  .meal-type-header {
    padding: 0.5rem;
    font-size: var(--fs-body-lg);
  }

  .day-event-card:hover {
    transform: none;
    /* Disable hover transform on very small screens */
  }
}

/* ==================== DARK MODE SUPPORT (ENHANCED) ==================== */

[data-bs-theme="dark"] .calendar-day {
  background-color: var(--glass-white-5);
  border-color: var(--glass-white-10);
}

[data-bs-theme="dark"] .calendar-day:hover {
  border-color: rgba(var(--bs-primary-rgb), 0.5);
  background-color: var(--glass-white-8);
}

[data-bs-theme="dark"] .day-button:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.15);
}

[data-bs-theme="dark"] .day-event-card {
  background-color: var(--glass-white-5);
  border-color: var(--glass-white-10);
}

[data-bs-theme="dark"] .day-event-card:hover {
  background-color: var(--glass-white-8);
  border-color: rgba(var(--bs-primary-rgb), 0.4);
}

[data-bs-theme="dark"] .timeline-item {
  background-color: var(--glass-white-5);
  border-color: var(--glass-white-10);
}

[data-bs-theme="dark"] .timeline-item:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.15);
}

[data-bs-theme="dark"] .nutrition-summary {
  background-color: var(--glass-white-8);
}

[data-bs-theme="dark"] .daily-summary-card {
  background: linear-gradient(135deg, rgba(var(--bs-success-rgb), 0.15), rgba(var(--bs-info-rgb), 0.15));
  border-color: rgba(var(--bs-success-rgb), 0.3);
}

/* ==================== ENHANCED ANIMATIONS ==================== */

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.day-event-card {
  animation: slideInUp 0.3s ease-out;
}

.calendar-day {
  animation: fadeInScale 0.2s ease-out;
}

.timeline-item {
  animation: slideInUp 0.3s ease-out;
}

/* Stagger animation for multiple items */
.day-event-card:nth-child(1) {
  animation-delay: 0.05s;
}

.day-event-card:nth-child(2) {
  animation-delay: 0.1s;
}

.day-event-card:nth-child(3) {
  animation-delay: 0.15s;
}

.day-event-card:nth-child(4) {
  animation-delay: 0.2s;
}

.calendar-day:nth-child(1) {
  animation-delay: 0.02s;
}

.calendar-day:nth-child(2) {
  animation-delay: 0.04s;
}

.calendar-day:nth-child(3) {
  animation-delay: 0.06s;
}

/* Continue pattern... */

/* ==================== ACCESSIBILITY IMPROVEMENTS ==================== */

.calendar-day:focus-within {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.day-event-card:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

  .day-event-card,
  .calendar-day,
  .timeline-item {
    animation: none;
  }

  .day-event-card:hover,
  .calendar-day:hover,
  .timeline-item:hover {
    transform: none;
  }
}

/* Custom Calendar Styles - Mobile Responsive Fix */

/* Base calendar container */
#calendar-container {
  font-family: var(--bs-body-font-family);
  color: var(--bs-body-color);
  overflow-x: hidden;
  /* Prevent horizontal scroll */
}

/* Custom views (common styles) */
/* ==================== MONTH VIEW STYLES (FIXED RESPONSIVE) ==================== */

/* Month header - removed week view button */
/* Weekday headers */
/* Calendar days grid - FIXED RESPONSIVE */
.week-view-btn-small {
  background: rgba(var(--bs-primary-rgb), 0.1);
  border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
  color: var(--bs-primary);
  border-radius: var(--radius-xs);
  padding: 0.25rem;
  font-size: var(--fs-xs);
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.week-view-btn-small:hover {
  background: rgba(var(--bs-primary-rgb), 0.2);
  transform: scale(1.05);
}

.calendar-day {
  min-height: 50px;
  /* Smaller height for mobile */
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: var(--radius-sm);
  /* Smaller border radius */
  background: var(--bs-body-bg);
  border: 0.75px solid var(--bs-body-color);
  transition: all 0.2s ease;
}

.calendar-day:hover {
  border-color: rgba(var(--bs-primary-rgb), 0.3);
  box-shadow: 0 0.125rem 0.25rem var(--glass-black-10);
  transform: translateY(-1px);
}

.day-button {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  position: relative;
  font-weight: 500;
  padding: 0.25rem;
  /* Smaller padding */
  transition: all 0.2s ease;
  text-align: left;
  font-size: var(--fs-body);
}

.day-button:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.08);
}

.day-button.has-events {
  font-weight: 700;
  color: var(--bs-primary);
}

.calendar-day.today {
  background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.15), rgba(var(--bs-primary-rgb), 0.08));
  border-color: var(--bs-primary);
}

.calendar-day.today .day-button {
  color: var(--bs-primary);
  font-weight: 700;
}

.calendar-day.other-month {
  opacity: 0.5;
}

.calendar-day.other-month .day-button {
  color: var(--bs-secondary);
}

/* Event badges for days - SMALLER FOR MOBILE */
.events-badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem;
  margin-top: auto;
  padding-top: 0.175rem;
  padding-right: 0.1rem;
}

.events-badge {
  min-width: 18px;
  height: 16px;
  color: var(--bs-emphasis-color);
  border-radius: var(--radius-xs);
  font-size: var(--fs-2xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0 0.25rem;
  box-shadow: 0 1px 2px var(--glass-black-20);
}

.recipe-badge {
  background: linear-gradient(135deg, var(--bs-primary), var(--bs-primary-bg-subtle));
}

.snack-badge {
  background: linear-gradient(135deg, var(--bs-warning), var(--bs-warning-bg-subtle));
}

/* ==================== RESPONSIVE STYLES (ENHANCED) ==================== */

/* Large screens */
@media (min-width: 1200px) {
  .calendar-day {
    min-height: 70px;
  }

  .day-button {
    padding: 0.5rem;
    font-size: var(--fs-md);
  }

  .events-badge {
    min-width: 24px;
    height: 20px;
    font-size: var(--fs-md);
  }

  .week-view-btn-small {
    min-height: 60px;
  }
}

/* Desktop styles */
@media (min-width: 992px) and (max-width: 1199px) {
  .calendar-day {
    min-height: 60px;
  }

  .day-button {
    padding: 0.375rem;
    font-size: var(--fs-body-lg);
  }

  .events-badge {
    min-width: 22px;
    height: 18px;
    font-size: var(--fs-2xs);
  }

  .week-view-btn-small {
    min-height: 50px;
  }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 991px) {
  .calendar-day {
    min-height: 50px;
  }

  .day-button {
    padding: 0.25rem;
    font-size: var(--fs-body);
  }

  .events-badge {
    min-width: 20px;
    height: 16px;
    font-size: var(--fs-2xs);
  }

  .week-view-btn-small {
    min-height: 45px;
    font-size: var(--fs-2xs);
  }
}

/* Mobile styles */
@media (max-width: 767px) {

  /* Ensure grid fits on mobile */
  .calendar-day {
    min-height: 40px;
  }

  .day-button {
    padding: 0.125rem;
    font-size: var(--fs-sm);
  }

  .events-badge {
    min-width: 16px;
    height: 14px;
    font-size: 0.55rem;
    padding: 0 0.125rem;
  }

  .week-view-btn-small {
    min-height: 35px;
    font-size: var(--fs-2xs);
    padding: 0.125rem;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .calendar-day {
    min-height: 35px;
  }

  .day-button {
    padding: 0.0625rem;
    font-size: var(--fs-xs);
  }

  .events-badge {
    min-width: 14px;
    height: 12px;
    font-size: 0.5rem;
  }

  .week-view-btn-small {
    min-height: 30px;
    font-size: 0.55rem;
  }

  .events-badge-container {
    gap: 0.0625rem;
  }
}

/* Ensure no horizontal overflow */
@media (max-width: 576px) {
  #calendar-container {
    max-width: 100vw;
    overflow-x: hidden;
  }
}

[data-bs-theme="dark"] .week-view-btn-small {
  background-color: var(--glass-white-10);
  border-color: var(--glass-white-20);
  color: var(--bs-primary);
}

[data-bs-theme="dark"] .week-view-btn-small:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* ════════════════════════════════════════════════════════════ */
/* Extracted inline styles (css_extract.py)                    */
/* ════════════════════════════════════════════════════════════ */

/* ═══ Source: Areas/Nutrition/Views/MealPlan/Builder.cshtml ═══ */
.meal-plan-builder-v2 {
        min-height: 100vh;
        padding-bottom: 100px;
        background: var(--bs-body-bg);
    }

    .builder-toolbar {
        position: sticky;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: rgba(var(--bs-body-bg-rgb), 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    }

    .toolbar-left,
    .toolbar-right {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .plan-title-wrapper {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .plan-title-input {
        border: none;
        background: transparent;
        font-size: 1.125rem;
        font-weight: 600;
        padding: 0.25rem 0.5rem;
        border-radius: var(--radius-sm);
        width: auto;
        min-width: 120px;
        max-width: 200px;
    }

    .plan-title-input:focus {
        outline: none;
        background: rgba(var(--bs-primary-rgb), 0.1);
    }

    .btn-icon {
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-full);
    }

    .btn-ghost {
        background: transparent;
        border: none;
        color: var(--bs-body-color);
    }

    .btn-ghost:hover {
        background: rgba(128, 128, 128, 0.1);
    }

    .settings-panel {
        position: fixed;
        top: 60px;
        right: 1rem;
        z-index: 99;
        width: 320px;
        max-width: calc(100vw - 2rem);
        display: none;
    }

    .settings-panel.show {
        display: block;
        animation: slideIn 0.2s ease;
    }

    .settings-content {
        padding: 0;
        overflow: hidden;
    }

    .settings-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    }

    .settings-body {
        padding: 1rem;
    }

    .nutrition-strip {
        padding: 0.75rem 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nutrition-strip::-webkit-scrollbar {
        display: none;
    }

    .nutrition-strip-inner {
        display: flex;
        gap: 1rem;
        min-width: max-content;
    }

    .nutrition-chip {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0.5rem 1rem;
        background: rgba(128, 128, 128, 0.1);
        border-radius: var(--radius-xl);
        min-width: 70px;
    }

    .nutrition-value {
        font-size: var(--fs-md);
        font-weight: 700;
    }

    .nutrition-label {
        font-size: 0.625rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        opacity: 0.7;
    }

    .calendar-navigation {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1rem;
    }

    .period-info {
        text-align: center;
    }

    .period-title {
        font-weight: 600;
    }

    .days-container {
        padding: 0 1rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .day-card {
        background: var(--glass-white-5);
        border-radius: var(--radius-xl);
        overflow: hidden;
        border: 1px solid rgba(128, 128, 128, 0.1);
        transition: all 0.2s ease;
    }

    [data-bs-theme="light"] .day-card {
        background: rgba(255, 255, 255, 0.8);
    }

    .day-card.drag-over {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.2);
    }

    .day-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: rgba(128, 128, 128, 0.05);
        border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    }

    .day-info {
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
    }

    .day-name {
        font-weight: 600;
        font-size: var(--fs-md);
    }

    .day-date {
        font-size: var(--fs-sm);
        opacity: 0.6;
    }

    .day-calories {
        font-size: var(--fs-sm);
        padding: 0.25rem 0.5rem;
        background: rgba(var(--bs-warning-rgb), 0.2);
        border-radius: var(--radius-xl);
        color: var(--bs-warning);
    }

    .day-card-body {
        padding: 0.75rem;
    }

    .meal-slot {
        margin-bottom: 0.5rem;
    }

    .meal-slot:last-child {
        margin-bottom: 0;
    }

    .meal-slot-label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.6875rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--bs-secondary);
        margin-bottom: 0.375rem;
        padding-left: 0.25rem;
    }

    .meal-slot-indicator {
        width: 8px;
        height: 8px;
        border-radius: var(--radius-full);
    }

    .meal-items {
        display: flex;
        flex-direction: column;
        gap: 0.375rem;
        min-height: 36px;
    }

    .meal-item {
        display: flex;
        align-items: center;
        gap: 0.625rem;
        padding: 0.5rem;
        background: rgba(128, 128, 128, 0.08);
        border-radius: var(--radius-md);
        position: relative;
        transition: all 0.2s ease;
    }

    .meal-item:active {
        transform: scale(0.98);
    }

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

    .meal-item-icon {
        width: 40px;
        height: 40px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-warning-rgb), 0.2);
        color: var(--bs-warning);
        flex-shrink: 0;
    }

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

    .meal-item-name {
        font-size: var(--fs-body);
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .meal-item-meta {
        font-size: var(--fs-sm);
        color: var(--bs-secondary);
    }

    .meal-item-remove {
        position: absolute;
        top: -6px;
        right: -6px;
        width: 22px;
        height: 22px;
        padding: 0;
        border-radius: var(--radius-full);
        background: var(--bs-danger);
        color: white;
        border: 2px solid var(--bs-body-bg);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: var(--fs-sm);
        opacity: 0;
        transition: opacity 0.2s;
    }

    .meal-item:hover .meal-item-remove {
        opacity: 1;
    }

    .empty-slot {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem;
        border: 2px dashed rgba(128, 128, 128, 0.2);
        border-radius: var(--radius-md);
        color: var(--bs-secondary);
        font-size: var(--fs-sm);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .empty-slot:hover {
        border-color: var(--bs-primary);
        color: var(--bs-primary);
        background: rgba(var(--bs-primary-rgb), 0.05);
    }

    .fab {
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
        border-radius: var(--radius-full);
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: var(--fs-2xl);
        box-shadow: 0 4px 12px var(--glass-black-30);
        z-index: 90;
        transition: transform 0.2s ease;
    }

    .fab:active {
        transform: scale(0.95);
    }

    .bottom-sheet {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        display: none;
    }

    .bottom-sheet.show {
        display: block;
    }

    .bottom-sheet-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .bottom-sheet.show .bottom-sheet-backdrop {
        opacity: 1;
    }

    .bottom-sheet-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bs-body-bg);
        border-radius: 1.5rem 1.5rem 0 0;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .bottom-sheet.show .bottom-sheet-content {
        transform: translateY(0);
    }

    .bottom-sheet-handle {
        width: 40px;
        height: 4px;
        background: rgba(128, 128, 128, 0.3);
        border-radius: 2px;
        margin: 0.75rem auto;
    }

    .bottom-sheet-header {
        padding: 0 1rem 0.75rem;
        border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    }

    .sheet-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .selected-day-indicator {
        font-size: var(--fs-body);
        color: var(--bs-primary);
        margin-top: 0.25rem;
    }

    .sheet-tabs {
        display: flex;
        padding: 1rem;
        gap: 0.25rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

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

    .sheet-tab {
        display: flex;
        align-items: center;
        gap: 0.375rem;
        padding: 0.75rem;
        border: none;
        background: transparent;
        border-radius: var(--radius-xl);
        font-size: var(--fs-body-sm);
        white-space: nowrap;
        color: var(--bs-body-color);
        transition: all 0.2s ease;
    }

    .sheet-tab.active {
        background: var(--bs-sky-bg-subtle);
        color: var(--bs-sky-text-emphasis);;
    }

    .sheet-search {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .search-input-wrapper {
        flex: 1;
        position: relative;
        display: flex;
        align-items: center;
    }

    .search-input-wrapper .mdi-magnify {
        position: absolute;
        left: 0.75rem;
        color: var(--bs-secondary);
    }

    .search-input-wrapper .form-control {
        padding-left: 2.25rem;
        padding-right: 2.25rem;
        border-radius: 1.5rem;
        background: rgba(128, 128, 128, 0.1);
        border: none;
    }

    .search-input-wrapper #btnClearSearch {
        position: absolute;
        right: 0.25rem;
    }

    .sheet-filters {
        display: flex;
        gap: 0.5rem;
        padding: 0 1rem 0.5rem;
    }

    .sheet-filters .form-select {
        flex: 1;
        border-radius: var(--radius-xl);
        background-color: rgba(128, 128, 128, 0.1);
        border: none;
    }

    .sheet-body {
        flex: 1;
        overflow-y: auto;
        padding: 0.5rem 1rem;
        -webkit-overflow-scrolling: touch;
    }

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

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

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

    .food-card {
        background: rgba(128, 128, 128, 0.08);
        border-radius: var(--radius-lg);
        overflow: hidden;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 2px solid transparent;
    }

    .food-card:active {
        transform: scale(0.98);
    }

    .food-card.selected {
        border-color: var(--bs-primary);
        background: rgba(var(--bs-primary-rgb), 0.1);
    }

    .food-card-image {
        width: 100%;
        aspect-ratio: 4/3;
        object-fit: cover;
    }

    .food-card-body {
        padding: 0.625rem;
    }

    .food-card-name {
        font-size: var(--fs-body-sm);
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 0.25rem;
    }

    .food-card-macros {
        display: flex;
        gap: 0.5rem;
        font-size: 0.6875rem;
        color: var(--bs-secondary);
    }

    .quick-meal-form {
        padding: 0.5rem 0;
    }

    .quick-meal-inputs {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .macro-inputs {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .macro-input {
        text-align: center;
    }

    .macro-input .form-control {
        text-align: center;
        padding: 0.5rem 0.25rem;
        font-weight: 600;
    }

    .macro-input label {
        display: block;
        font-size: 0.625rem;
        text-transform: uppercase;
        color: var(--bs-secondary);
        margin-top: 0.25rem;
    }

    .sheet-footer {
        padding: 1rem;
        border-top: 1px solid rgba(128, 128, 128, 0.1);
        background: var(--bs-body-bg);
    }

    .selected-item-preview {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
        padding: 0.5rem;
        background: rgba(128, 128, 128, 0.08);
        border-radius: var(--radius-md);
    }

    .preview-image img {
        width: 48px;
        height: 48px;
        border-radius: var(--radius-sm);
        object-fit: cover;
    }

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

    .preview-name {
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .preview-macros {
        font-size: var(--fs-sm);
        color: var(--bs-secondary);
    }

    .meal-options {
        display: flex;
        gap: 1rem;
        margin-bottom: 0.75rem;
    }

    .option-row {
        flex: 1;
    }

    .option-row label {
        display: block;
        margin-bottom: 0.25rem;
        color: var(--bs-secondary);
    }

    .serving-stepper {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .serving-stepper .form-control {
        width: 60px;
    }

    .empty-state {
        grid-column: 1 / -1;
        text-align: center;
        padding: 2rem;
        color: var(--bs-secondary);
    }

    .loading-spinner {
        grid-column: 1 / -1;
        display: flex;
        justify-content: center;
        padding: 2rem;
    }

    .glass-card {
        background: var(--glass-white-5);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid var(--glass-white-10);
        border-radius: var(--radius-xl);
    }

    [data-bs-theme="light"] .glass-card {
        background: rgba(255, 255, 255, 0.9);
        border-color: var(--glass-black-8);
        box-shadow: 0 4px 16px var(--glass-black-10);
    }
    .history-card {
        cursor: pointer;
    }

    .history-card .food-card-body {
        padding: 0.75rem;
    }

    .history-icon {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-warning-rgb), 0.2);
        color: var(--bs-warning);
        flex-shrink: 0;
    }

    .min-width-0 {
        min-width: 0;
    }
    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

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

    @media (min-width: 768px) {
        .bottom-sheet-content {
            max-width: 480px;
            left: 50%;
            transform: translateX(-50%) translateY(100%);
            border-radius: 1.5rem 1.5rem 0 0;
        }

        .bottom-sheet.show .bottom-sheet-content {
            transform: translateX(-50%) translateY(0);
        }

        .food-grid {
            grid-template-columns: repeat(3, 1fr);
        }

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

        .btn-text {
            display: inline;
        }

        .fab {
            bottom: 32px;
            right: 32px;
        }
    }

    @media (min-width: 992px) {
        .days-container {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    @media (min-width: 1200px) {
        .days-container {
            grid-template-columns: repeat(4, 1fr);
        }
    }

    @media (max-width: 575.98px) {
        .btn-text {
            display: none;
        }

        .plan-title-input {
            font-size: var(--fs-md);
            max-width: 140px;
        }

        .toolbar-right .btn:not(.btn-icon) {
            width: 40px;
            height: 40px;
            padding: 0;
            border-radius: var(--radius-full);
        }

        .meal-item-remove {
            opacity: 1;
        }
    }

    @media print {
        .builder-toolbar,
        .nutrition-strip,
        .calendar-navigation,
        .fab,
        .bottom-sheet {
            display: none !important;
        }

        .days-container {
            display: block;
        }

        .day-card {
            break-inside: avoid;
            page-break-inside: avoid;
            margin-bottom: 1rem;
        }
    }

/* ═══ Source: Areas/Nutrition/Views/MealPlan/Delete.cshtml ═══ */
.delete-meal-plan-container {
        padding: 1rem 0;
    }

    [data-bs-theme="light"] .glass-card {
        background: rgba(255, 255, 255, 0.8);
        border-color: var(--glass-black-8);
    }

    .delete-icon-wrapper {
        width: 80px;
        height: 80px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-danger-rgb), 0.15);
        border-radius: var(--radius-full);
    }

    .delete-icon-wrapper .mdi {
        font-size: 2.5rem;
        color: var(--bs-danger);
    }

    .detail-card {
        background: rgba(128, 128, 128, 0.1);
    }

    [data-bs-theme="light"] .detail-card {
        background: var(--glass-black-3);
    }

    .plan-icon {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.15);
        border-radius: var(--radius-md);
        flex-shrink: 0;
    }

    .plan-icon .mdi {
        font-size: var(--fs-2xl);
        color: var(--bs-primary);
    }

    .plan-meta {
        font-size: var(--fs-body-sm);
    }

    .meta-item {
        color: var(--bs-secondary);
    }

    .nutrition-summary h6 {
        color: var(--bs-secondary);
        font-size: var(--fs-body);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .nutrition-stat {
        background: rgba(128, 128, 128, 0.1);
    }

    [data-bs-theme="light"] .nutrition-stat {
        background: var(--glass-black-3);
    }

    .stat-value {
        font-size: 1.125rem;
        font-weight: 600;
    }

    .stat-label {
        font-size: 0.6875rem;
        color: var(--bs-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    @media (max-width: 575.98px) {

        .delete-icon-wrapper {
            width: 64px;
            height: 64px;
        }

        .delete-icon-wrapper .mdi {
            font-size: var(--fs-4xl);
        }

        .plan-meta {
            flex-direction: column;
            gap: 0.25rem !important;
        }

        .stat-value {
            font-size: var(--fs-md);
        }
    }

/* ═══ Source: Areas/Nutrition/Views/MealPlan/Details.cshtml ═══ */
.meal-plan-details-container {
        padding: 1rem 0;
    }

    .glass-card {
        background: var(--glass-white-5);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid var(--glass-white-10);
        border-radius: var(--radius-xl);
    }

    [data-bs-theme="light"] .glass-card {
        background: rgba(255, 255, 255, 0.8);
        border-color: var(--glass-black-8);
    }

    .plan-icon-large {
        width: 64px;
        height: 64px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.15);
        border-radius: var(--radius-xl);
        flex-shrink: 0;
    }

    .plan-icon-large .mdi {
        font-size: var(--fs-4xl);
        color: var(--bs-primary);
    }

    .plan-meta {
        font-size: var(--fs-body);
    }

    .meta-item {
        color: var(--bs-secondary);
    }

    .info-grid {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .info-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(128, 128, 128, 0.15);
    }

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

    .info-label {
        color: var(--bs-secondary);
        font-size: var(--fs-body);
    }

    .info-value {
        font-weight: 500;
    }

    .stat-row {
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    }

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

    .stat-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .stat-dot {
        width: 10px;
        height: 10px;
        border-radius: var(--radius-full);
        flex-shrink: 0;
    }

    .stat-label {
        flex-grow: 1;
        font-size: var(--fs-body);
    }

    .stat-value {
        font-weight: 600;
    }

    .shared-users-list .user-avatar {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.15);
        border-radius: var(--radius-full);
        color: var(--bs-primary);
    }

    .badge-sm {
        font-size: var(--fs-2xs);
        padding: 0.15rem 0.35rem;
    }

    .day-section {
        position: relative;
    }

    .day-section.today .day-date {
        color: var(--bs-primary);
        font-weight: 600;
    }

    .day-section.past {
        opacity: 0.7;
    }

    .day-header {
        padding: 0.5rem;
        background: rgba(128, 128, 128, 0.1);
        border-radius: var(--radius-md);
    }

    [data-bs-theme="light"] .day-header {
        background: var(--glass-black-3);
    }

    .day-date {
        font-weight: 500;
    }

    .meals-timeline {
        padding-left: 0.5rem;
    }

    .meal-timeline-item {
        display: flex;
        gap: 0.75rem;
        padding: 0.5rem 0;
    }

    .meal-time {
        width: 45px;
        font-size: var(--fs-body-sm);
        color: var(--bs-secondary);
        text-align: right;
        flex-shrink: 0;
        padding-top: 0.5rem;
    }

    .meal-connector {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 20px;
        flex-shrink: 0;
    }

    .connector-dot {
        width: 12px;
        height: 12px;
        border-radius: var(--radius-full);
        margin-top: 0.5rem;
        flex-shrink: 0;
    }

    .connector-line {
        width: 2px;
        flex-grow: 1;
        background: rgba(128, 128, 128, 0.2);
        margin-top: 0.25rem;
    }

    .meal-timeline-item:last-child .connector-line {
        display: none;
    }

    .meal-card {
        background: var(--glass-white-5);
        border: 1px solid rgba(128, 128, 128, 0.15);
        transition: all 0.2s ease;
    }

    [data-bs-theme="light"] .meal-card {
        background: rgba(255, 255, 255, 0.8);
    }

    .meal-card:hover {
        background: rgba(var(--bs-primary-rgb), 0.05);
        border-color: rgba(var(--bs-primary-rgb), 0.2);
    }

    .meal-timeline-item.consumed .meal-card {
        background: rgba(var(--bs-success-rgb), 0.05);
        border-color: rgba(var(--bs-success-rgb), 0.2);
    }

    .meal-image {
        width: 48px;
        height: 48px;
        object-fit: cover;
        border-radius: var(--radius-sm);
        flex-shrink: 0;
    }

    .meal-image-placeholder {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.1);
        border-radius: var(--radius-sm);
        flex-shrink: 0;
    }

    .meal-image-placeholder .mdi {
        font-size: var(--fs-2xl);
        color: var(--bs-primary);
    }

    .meal-type-badge {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
        background: rgba(var(--bs-primary-rgb), 0.15);
        color: var(--bs-primary);
        border-radius: var(--radius-xs);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 500;
    }

    .meal-name {
        font-weight: 500;
        margin: 0.25rem 0;
    }

    .serving-badge {
        font-size: var(--fs-sm);
        padding: 0.25rem 0.5rem;
        background: rgba(128, 128, 128, 0.1);
        border-radius: var(--radius-xs);
        white-space: nowrap;
    }

    @media (max-width: 991.98px) {
        .plan-icon-large {
            width: 48px;
            height: 48px;
        }

        .plan-icon-large .mdi {
            font-size: var(--fs-2xl);
        }
    }

    @media (max-width: 575.98px) {
        .details-header .btn {
            padding: 0.375rem 0.75rem;
            font-size: var(--fs-body);
        }

        .details-header .btn span:not(.mdi) {
            display: none;
        }

        .meal-card {
            flex-direction: column;
            align-items: flex-start !important;
        }

        .meal-actions {
            margin-top: 0.5rem;
        }
    }

    @media print {
        .glass-card {
            background: white !important;
            border: 1px solid #ddd !important;
        }

        .btn, .dropdown, .modal {
            display: none !important;
        }

        .meal-card {
            break-inside: avoid;
        }
    }

/* ═══ Source: Areas/Nutrition/Views/MealPlan/Edit.cshtml ═══ */
.edit-meal-plan-container {
        padding: 1rem 0;
    }

    .glass-card {
        background: var(--glass-white-5);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid var(--glass-white-10);
        border-radius: var(--radius-xl);
    }

    [data-bs-theme="light"] .glass-card {
        background: rgba(255, 255, 255, 0.8);
        border-color: var(--glass-black-8);
    }

    .glass-card.border-danger {
        border-color: rgba(var(--bs-danger-rgb), 0.3) !important;
    }

    .plan-icon-large {
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.15);
        border-radius: var(--radius-xl);
        flex-shrink: 0;
    }

    .plan-icon-large .mdi {
        font-size: var(--fs-3xl);
        color: var(--bs-primary);
    }

    .setting-item {
        background: rgba(128, 128, 128, 0.05);
        border: 1px solid rgba(128, 128, 128, 0.1);
    }

    [data-bs-theme="light"] .setting-item {
        background: var(--glass-black-2);
    }

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

    .nutrition-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
        background: rgba(128, 128, 128, 0.05);
        border-radius: var(--radius-md);
    }

    .nutrition-icon {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-md);
        flex-shrink: 0;
    }

    .nutrition-icon .mdi {
        font-size: var(--fs-xl);
    }

    .nutrition-value {
        font-weight: 600;
        font-size: var(--fs-md);
    }

    .nutrition-label {
        font-size: 0.6875rem;
        color: var(--bs-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .daily-avg-info {
        background: rgba(var(--bs-primary-rgb), 0.1);
    }

    .info-list {
        display: flex;
        flex-direction: column;
    }

    .info-row {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    }

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

    .info-label {
        color: var(--bs-secondary);
        font-size: var(--fs-body);
    }

    .info-value {
        font-weight: 500;
        font-size: var(--fs-body);
    }

    .user-avatar-sm {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.15);
        border-radius: var(--radius-full);
        flex-shrink: 0;
        color: var(--bs-primary);
        font-size: var(--fs-body);
    }

    .badge-xs {
        font-size: var(--fs-2xs);
        padding: 0.1rem 0.3rem;
    }

    .day-preview {
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    }

    .day-preview:last-child {
        border-bottom: none;
    }

    .day-dot {
        width: 8px;
        height: 8px;
        border-radius: var(--radius-full);
        flex-shrink: 0;
    }

    .meal-chip {
        display: inline-flex;
        align-items: center;
        padding: 0.25rem 0.5rem;
        background: rgba(128, 128, 128, 0.1);
        border-radius: var(--radius-xl);
        font-size: var(--fs-sm);
        max-width: 150px;
    }

    .meal-chip.consumed {
        background: rgba(var(--bs-success-rgb), 0.15);
    }

    .meal-chip.more {
        background: rgba(var(--bs-primary-rgb), 0.1);
        color: var(--bs-primary);
    }

    .meal-chip-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    @media (max-width: 991.98px) {
        .col-lg-4 {
            order: -1;
        }

        .nutrition-summary-grid {
            grid-template-columns: repeat(4, 1fr);
        }

        .nutrition-item {
            flex-direction: column;
            text-align: center;
            gap: 0.25rem;
            padding: 0.5rem;
        }
    }

    @media (max-width: 575.98px) {
        .nutrition-summary-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .edit-header .btn span:not(.mdi) {
            display: none;
        }
    }

/* ═══ Source: Areas/Nutrition/Views/MealPlan/Index.cshtml ═══ */
.meal-plans-container {
        padding: 1rem 0;
    }

    .glass-card {
        background: var(--glass-white-5);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid var(--glass-white-10);
        border-radius: var(--radius-xl);
    }

    [data-bs-theme="light"] .glass-card {
        background: rgba(255, 255, 255, 0.8);
        border-color: var(--glass-black-8);
    }

    .page-icon {
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.15);
        border-radius: var(--radius-xl);
        flex-shrink: 0;
    }

    .page-icon .mdi {
        font-size: var(--fs-3xl);
        color: var(--bs-primary);
    }

    .stat-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .stat-card:hover {
        transform: translateY(-2px);
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-lg);
        flex-shrink: 0;
    }

    .stat-icon .mdi {
        font-size: var(--fs-2xl);
    }

    .stat-value {
        font-size: var(--fs-2xl);
        font-weight: 700;
        line-height: 1.2;
    }

    .stat-label {
        font-size: var(--fs-sm);
        color: var(--bs-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .plan-card {
        display: flex;
        flex-direction: column;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        overflow: hidden;
    }

    .plan-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 25px var(--glass-black-15);
    }

    .plan-card.active-plan {
        border: 2px solid var(--bs-success);
    }

    .plan-card-header {
        padding: 1rem 1rem 0.75rem;
    }

    .plan-card-body {
        padding: 0 1rem;
        flex: 1;
    }

    .plan-card-footer {
        padding: 0.75rem 1rem;
        border-top: 1px solid rgba(128, 128, 128, 0.15);
        margin-top: auto;
    }

    .plan-name {
        font-size: var(--fs-lg);
        max-width: 200px;
    }

    .plan-description {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-full);
        border: none;
        background: transparent;
    }

    .btn-icon:hover {
        background: rgba(128, 128, 128, 0.15);
    }

    .nutrition-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        padding: 0.75rem;
        background: rgba(128, 128, 128, 0.05);
        border-radius: var(--radius-md);
    }

    .nutrition-item {
        text-align: center;
    }

    .nutrition-value {
        font-weight: 600;
        font-size: var(--fs-body-lg);
        display: block;
    }

    .nutrition-label {
        font-size: var(--fs-2xs);
        color: var(--bs-secondary);
        text-transform: uppercase;
    }

    .plan-icon-sm {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.1);
        border-radius: var(--radius-md);
        flex-shrink: 0;
    }

    .plan-icon-sm.active {
        background: rgba(var(--bs-success-rgb), 0.15);
        color: var(--bs-success);
    }

    .plan-icon-sm .mdi {
        font-size: var(--fs-xl);
        color: var(--bs-primary);
    }

    .plan-icon-sm.active .mdi {
        color: var(--bs-success);
    }

    .empty-state {
        max-width: 800px;
        margin: 0 auto;
    }

    .empty-icon {
        width: 120px;
        height: 120px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.1);
        border-radius: var(--radius-full);
    }

    .empty-icon .mdi {
        font-size: 3.5rem;
        color: var(--bs-primary);
    }

    .tip-card {
        background: rgba(128, 128, 128, 0.05);
        border: 1px solid rgba(128, 128, 128, 0.1);
    }

    @media (max-width: 767.98px) {
        .page-header .btn span:not(.mdi) {
            display: none;
        }

        .filters-row .input-group,
        .filters-row .form-select {
            max-width: 100% !important;
        }

        .stat-value {
            font-size: var(--fs-xl);
        }

        .nutrition-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

/* ═══ Source: Areas/Nutrition/Views/MealPlan/Templates.cshtml ═══ */
.templates-container {
        padding: 1rem 0;
    }

    .glass-card {
        background: var(--glass-white-5);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid var(--glass-white-10);
        border-radius: var(--radius-xl);
    }

    [data-bs-theme="light"] .glass-card {
        background: rgba(255, 255, 255, 0.8);
        border-color: var(--glass-black-8);
    }

    .page-icon {
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-info-rgb), 0.15);
        border-radius: var(--radius-xl);
        flex-shrink: 0;
    }

    .page-icon .mdi {
        font-size: var(--fs-3xl);
        color: var(--bs-info);
    }

    .template-card {
        display: flex;
        flex-direction: column;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        overflow: hidden;
    }

    .template-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 25px var(--glass-black-15);
    }

    .template-header {
        padding: 1rem 1rem 0.75rem;
    }

    .template-body {
        padding: 0 1rem;
        flex: 1;
    }

    .template-footer {
        padding: 0.75rem 1rem;
        border-top: 1px solid rgba(128, 128, 128, 0.15);
        margin-top: auto;
    }

    .template-name {
        font-size: var(--fs-lg);
    }

    .template-description {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .meal-preview-grid {
        display: flex;
        gap: 0.5rem;
    }

    .meal-preview-item {
        width: 48px;
        height: 48px;
        border-radius: var(--radius-md);
        overflow: hidden;
        flex-shrink: 0;
    }

    .meal-preview-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .meal-preview-placeholder {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.1);
    }

    .meal-preview-placeholder .mdi {
        font-size: var(--fs-xl);
        color: var(--bs-primary);
    }

    .meal-preview-more {
        width: 48px;
        height: 48px;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(128, 128, 128, 0.15);
        font-size: var(--fs-body);
        font-weight: 500;
        color: var(--bs-secondary);
    }

    .nutrition-summary {
        padding: 0.75rem;
        background: rgba(128, 128, 128, 0.05);
        border-radius: var(--radius-md);
    }

    .nutrition-stat .stat-value {
        font-weight: 600;
        font-size: var(--fs-md);
    }

    .nutrition-stat .stat-label {
        font-size: var(--fs-2xs);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--bs-secondary);
    }

    .empty-state {
        max-width: 600px;
        margin: 0 auto;
    }

    .empty-icon {
        width: 100px;
        height: 100px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-secondary-rgb), 0.1);
        border-radius: var(--radius-full);
    }

    .empty-icon .mdi {
        font-size: var(--fs-5xl);
        color: var(--bs-secondary);
    }

    .preview-day {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(128, 128, 128, 0.15);
    }

    .preview-day:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .preview-meal-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.5rem;
        background: rgba(128, 128, 128, 0.05);
        border-radius: var(--radius-md);
        margin-bottom: 0.5rem;
    }

    .preview-meal-item:last-child {
        margin-bottom: 0;
    }

    .preview-meal-image {
        width: 40px;
        height: 40px;
        object-fit: cover;
        border-radius: var(--radius-sm);
    }

    .preview-meal-placeholder {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), 0.1);
        border-radius: var(--radius-sm);
    }

    @media (max-width: 767.98px) {
        .page-header .btn span:not(.mdi) {
            display: none;
        }

        .template-card {
            margin-bottom: 1rem;
        }
    }
