/* ============================================
   CLEAN MOBILE MEAL CARD FIX
   Simple, working solution without complexity
   ============================================ */

/* ============================================
   PHASE 2: MEAL SLOT VISUAL HIERARCHY
   Per UX spec: Meals are OUTPUT (30% weight)
   Empty meals get dashed borders, ghost buttons
   ============================================ */

/* Empty meal card - dashed border, reduced prominence */
.meal-card-empty {
    border: 2px dashed #d1d5db !important;
    background: #fafafa !important;
    opacity: 0.9;
}

.meal-card-empty .optimized-meal-header {
    background: transparent !important;
    border-bottom: 1px dashed #e5e7eb !important;
}

/* Populated meal card - solid border, normal prominence */
.meal-card-populated {
    border: 1px solid #e5e7eb;
    background: white;
}

/* Meal-time icon styling */
.meal-time-icon {
    font-size: 1.1rem;
    filter: grayscale(0);
    transition: transform 0.2s ease;
}

.meal-card-empty .meal-time-icon {
    filter: grayscale(0.3);
    opacity: 0.8;
}

/* Ghost button for empty meals - subtle, not a CTA */
.meal-add-ghost {
    border: 1px dashed #9ca3af !important;
    color: #6b7280 !important;
    background: transparent !important;
    font-size: 0.8rem;
    padding: 4px 10px;
    transition: all 0.2s ease;
}

.meal-add-ghost:hover {
    border-color: #6b7280 !important;
    color: #374151 !important;
    background: rgba(107, 114, 128, 0.05) !important;
}

/* Edit button for populated meals */
.meal-edit-btn {
    font-size: 0.8rem;
    padding: 4px 10px;
}

/* Empty meal prompt styling */
.meal-empty-prompt {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
}

.meal-empty-prompt i {
    animation: subtle-bounce 2s ease-in-out infinite;
}

@keyframes subtle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@media (max-width: 575px) {
  /* Reset any problematic styles */
  .optimized-meal-card,
  .optimized-meal-card * {
    position: static !important;
    overflow: visible !important;
    z-index: auto !important;
    isolation: auto !important;
  }

  /* Meal card - simple container */
  .optimized-meal-card {
    display: block;
    margin-bottom: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
  }

  /* Meal header - clean and simple */
  .optimized-meal-header {
    padding: 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Meal content - NO HEIGHT RESTRICTIONS */
  .optimized-meal-content {
    display: block;
    padding: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    /* NO max-height, NO overflow hidden */
  }

  /* Each food item */
  .food-item {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
  }

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

  /* Food name */
  .food-item strong {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    display: block;
    margin-bottom: 4px;
  }

  /* Calories and macros line */
  .food-item .d-block.d-sm-none.small.text-muted {
    display: block !important;
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-bottom: 8px;
    line-height: 1.4;
  }

  /* Serving controls */
  .food-item .d-block.d-sm-none.mt-2 {
    display: block !important;
    margin-top: 8px !important;
  }

  .food-item input[type="number"] {
    width: 60px;
    height: 32px;
    padding: 4px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
  }

  /* Hide desktop layout completely */
  .food-item .d-none.d-sm-flex {
    display: none !important;
  }

  /* Ensure proper spacing for empty meals */
  .optimized-meal-empty {
    padding: 20px;
    text-align: center;
    color: #6b7280;
  }

  /* Clean button styles */
  .optimized-meal-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  /* Meal status text */
  .optimized-meal-status {
    font-size: 13px;
    color: #6b7280;
  }

  /* Mobile compact macros display */
  .mobile-macros {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
  }

  .mobile-macros .macro-cal {
    font-weight: 600;
    color: #374151;
  }

  .mobile-macros .macro-sep {
    color: #9ca3af;
    font-size: 8px;
  }

  .mobile-macros .macro-p {
    color: #2563eb; /* blue for protein */
  }

  .mobile-macros .macro-c {
    color: #d97706; /* amber for carbs */
  }

  .mobile-macros .macro-f {
    color: #059669; /* emerald for fat */
  }
}

/* Ensure no overlap between sections */
.meals-container {
  display: block;
}

.meals-container > * {
  display: block;
  margin-bottom: 16px;
}

.snacks-section {
  display: block;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid #f3f4f6;
}

/* Section titles */
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
  padding: 0 12px;
}