/* frontend.css — visual profissional, limpo e responsivo */

:root {
  /* Paleta de cores moderna */
  --dfd-primary-color: #0070c9; /* Um azul profissional */
  --dfd-text-color: #333;
  --dfd-light-grey: #f5f5f5;
  --dfd-border-color: #e0e0e0;
  --dfd-success-green: #28a745;
}

/* 1. Container Principal */
.dfd-recipes-app {
  max-width: 960px;
  margin: 20px auto;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.08); /* Sombra mais suave */
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--dfd-text-color);
  line-height: 1.6;
}

/* 2. Controles (Filtros e Botões) */
.dfd-controls {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--dfd-light-grey);
  padding-bottom: 16px;
}

.dfd-select-inline {
  display: flex;
  gap: 12px;
  align-items: flex-end; /* Alinha labels e botões à base */
}

.dfd-select-inline label {
  font-weight: 600;
  font-size: 14px;
  color: #555;
  display: block;
}

.dfd-select-inline select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--dfd-border-color);
  background-color: #fff;
  font-size: 15px;
  min-width: 150px;
}

.dfd-select-inline .button {
  height: 40px; /* Alinha com a altura dos selects */
  padding: 0 16px;
  background-color: var(--dfd-primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dfd-select-inline .button:hover {
  background-color: #005aa7; /* Azul mais escuro no hover */
}

/* 3. Cartão da Receita (Display) */
.dfd-recipe-card {
  /* Remove padding e borda do container, eles serão aplicados internamente */
  padding: 0;
  border: none;
}

.dfd-card-outer {
  border: 1px solid var(--dfd-border-color);
  border-radius: 12px;
  padding: 24px;
  background: var(--dfd-light-grey);
}

.dfd-card-outer h2 {
  font-size: 28px;
  margin: 0 0 10px 0;
  color: var(--dfd-primary-color);
  font-weight: 700;
}

/* Grid de Informações (Imagem e Corpo) */
.dfd-recipe-grid {
  display: grid;
  grid-template-columns: 1fr 2fr; /* 1/3 para imagem, 2/3 para corpo */
  gap: 30px;
  margin-top: 20px;
}

.dfd-image-col {
  /* Garante que a imagem se ajuste à coluna */
  grid-column: 1 / 2;
}

.dfd-content-col {
  grid-column: 2 / 3;
}

.dfd-card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3; /* Imagem com proporção moderna */
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Metadata (Categoria, Porções, Calorias) */
.dfd-meta-grid {
  display: flex;
  justify-content: space-between;
  background: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--dfd-border-color);
}

.dfd-meta-item {
  text-align: center;
  flex-grow: 1;
}

.dfd-meta-item strong {
  display: block;
  font-size: 14px;
  color: #888;
  font-weight: 500;
  margin-bottom: 2px;
}

.dfd-meta-item span {
  font-size: 18px;
  font-weight: 700;
  color: var(--dfd-text-color);
}

/* 4. Corpo da Receita (Ingredientes e Modo de Preparo) */
.dfd-body-content h3 {
  font-size: 22px;
  color: var(--dfd-primary-color);
  border-bottom: 2px solid var(--dfd-primary-color);
  padding-bottom: 5px;
  margin: 30px 0 15px 0;
}

.dfd-ingredients, .dfd-method {
  white-space: pre-wrap; /* Mantém quebras de linha/formatação */
  padding: 10px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--dfd-border-color);
  font-size: 16px;
}

/* 5. Barra de Macronutrientes */
.dfd-macros-bar {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  padding: 15px;
  background: var(--dfd-primary-color);
  border-radius: 8px;
  color: white;
  text-align: center;
}

.dfd-macro-item {
  flex-grow: 1;
  padding: 5px;
}

.dfd-macro-item strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.dfd-macro-item span {
  font-size: 20px;
  font-weight: 700;
}

/* 6. Ações (Botão Imprimir) */
.dfd-actions {
  margin-top: 24px;
  text-align: right;
}

.dfd-actions #dfd_print_btn {
  background-color: var(--dfd-success-green);
  color: white;
}

.dfd-actions #dfd_print_btn:hover {
  background-color: #1e7e34;
}


/* Media Queries (Responsivo) */
@media (max-width: 900px) {
  .dfd-recipe-grid {
    grid-template-columns: 1fr; /* Coluna única em telas menores */
  }
  .dfd-image-col, .dfd-content-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .dfd-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .dfd-select-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .dfd-select-inline select, .dfd-select-inline .button {
    width: 100%;
    margin-top: 5px;
  }
  .dfd-meta-grid, .dfd-macros-bar {
    flex-direction: column;
    gap: 15px;
  }
  .dfd-macro-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
  }
  .dfd-macro-item:last-child {
    border-bottom: none;
  }
}