/* Planner/css/utils.css */
/* ==========================================================================
   7. Animações e Efeitos
   ========================================================================== */

/* ---- Animações (Keyframes) ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Loading Overlay ---- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  color: white;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

/* ==========================================================================
   12. Estilos Adicionados para Resumo da Refeição no Modal
   ========================================================================== */

/* Resumo da refeição principal (dentro do modal) */
/* *** MODIFICADO PELA CORREÇÃO *** */
.meal-summary-card {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--text-secondary);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  margin-right: 1rem;
  display: none; /* JS controla para 'flex' */
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 1rem;
  flex-shrink: 0; /* *** ADICIONADO *** */
}

.nutrient-row {
  display: flex;
  gap: 0.5rem;
  font-size: 1rem;
  align-items: center;
}

.nutrient-row .label {
  color: var(--text-secondary);
  font-weight: 500;
}

.nutrient-row .value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

/* ==========================================================================
   14. Botões de Scroll das Abas de Divisão (Workout) - NOVO
   ========================================================================== */

.divisions-tabs-wrapper {
    position: relative;
    
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: transparent;
    backdrop-filter: blur(4px); /* Sem fundo por padrão */
    color: var(--text-primary);
    width: 36px;
    height: 86%; /* Apenas o tamanho do ícone */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    transition: var(--transition);
    user-select: none;
    border: none;
}

.scroll-btn:hover {
    background: rgba(0, 0, 0, 0.5); /* Fundo preto translúcido no hover */
    backdrop-filter: blur(4px);
    border-color: var(--primary-color);
}

.scroll-btn-left {
    left: 0.001rem;
    border-bottom-right-radius: var(--border-radius-sm);
    border-top-right-radius:  var(--border-radius-sm);
}

.scroll-btn-right {
    right: 0.001rem;
    border-bottom-left-radius: var(--border-radius-sm);
    border-top-left-radius:  var(--border-radius-sm);
}

/* ==========================================================================
   Estilos de Lista de Alimentos (Reutilizado em Modais)
   ========================================================================== */

/* --- MODIFICAÇÃO: Layout da lista de alimentos atual --- */
.current-foods-list {
  overflow-y: auto; /* A rolagem acontece aqui */
  flex-grow: 1; /* Ocupa o espaço restante */
  min-height: 200px; /* Altura mínima para não sumir */
  padding-right: 10px; /* Espaço para o scrollbar */
}

.modal-list-title {
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 1rem 0;
  text-align: center;
  flex-shrink: 0; /* Garante que o título não encolha */
}


.current-foods-list p {
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem 0;
}
.current-food-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.current-foods-list .food-item{
  background-color: var(--bg-primary);
}

.current-food-item:hover {
  border-color: var(--border-color);
}
.current-food-info {
  flex-grow: 1;
}
.current-food-info h5 {
  margin: 0;
  font-weight: 500;
  font-size: 0.95rem;
}
.current-food-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.current-food-actions .quantity-input {
  width: 70px;
  padding: 0.5rem;
  text-align: center;
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.current-food-actions .icon-btn {
  width: 32px;
  height: 32px;
}
.current-food-actions .icon-btn:hover {
  background: var(--danger-color);
}

.meal-footer {
    padding: 0.5rem 1.5rem;
    text-align: center;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.btn-expand-meal {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 0.9rem;
    gap: 0.5rem;
    transition: var(--transition);
}
.btn-expand-meal:hover {
    color: var(--text-primary);
}

.btn-expand-meal .icon,
.substitution-header .icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.meal-content.expanded + .meal-footer .btn-expand-meal .icon,
.icon.rotated {
    transform: rotate(180deg);
}

.food-details, .food-nutrition{
  flex-direction: column;
}

/* Container principal do resumo no modal */
.substitution-summary-card {
  background-color: var(--bg-primary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* --- MODIFICAÇÃO: Não cresce, fica fixo --- */
  flex-shrink: 0;
}

.substitution-summary-card h4 {
  margin: 0;
  color: var(--primary-color);
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.substitution-summary-card p {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  text-align: center;
  color: var(--text-secondary);
  font-weight: 500;
}

#main-meal-totals,
#substitution-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding-bottom: 0.5rem;
}