/* Hybrid Meal Card Styles */

.meal-header-hybrid {
  padding: 12px 14px;
  background: white;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
}

.meal-card.expanded .meal-header-hybrid {
  padding: 14px 16px 16px 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
}

.meal-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.expand-toggle {
  margin-left: auto;
  padding: 6px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.expand-toggle:hover {
  background: #5568d3;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.expand-toggle:active {
  transform: scale(0.95);
}

/* Collapsed Macro Row */
.meal-macros-collapsed {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meal-card.expanded .meal-macros-collapsed {
  display: none !important;
}

/* Expanded Macro Cards */
.meal-macro-cards-expanded {
  display: none !important;
  gap: 8px;
  margin-top: 12px;
  animation: expandFade 0.3s ease-out;
}

.meal-card.expanded .meal-macro-cards-expanded {
  display: flex !important;
}

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

.macro-card-hybrid {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 4px solid;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
  border-top: 1px solid #f3f4f6;
  border-right: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.3s ease;
}

.macro-card-hybrid.protein-card {
  border-left-color: #e74c3c;
}

.macro-card-hybrid.fat-card {
  border-left-color: #f39c12;
}

.macro-card-hybrid.carbs-card {
  border-left-color: #3498db;
}

.macro-card-hybrid.calories-card {
  border-left-color: #6b7280;
}

.macro-card-hybrid.hit {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-left-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2),
              0 4px 12px rgba(16, 185, 129, 0.15);
  animation: macroHit 0.4s ease-out;
}

.macro-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin-bottom: 6px;
}

.macro-card-values {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.macro-card-actual,
.macro-card-actual-cal {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
}

.macro-card-slash {
  font-size: 16px;
  color: #9ca3af;
}

.macro-card-target {
  font-size: 16px;
  font-weight: 600;
  color: #6b7280;
}

@media (max-width: 768px) {
  .meal-card.expanded .meal-macro-cards-expanded {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
  }

  .macro-card-hybrid {
    min-width: unset;
  }
}

/* Green background when meal hits macros (only when collapsed) */
.meal-card.meal-complete:not(.expanded) {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.meal-card.meal-complete:not(.expanded) .meal-header-hybrid {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}
