/* ── Ingredient detail page ─────────────────────────────────────────────────── */
.ingredient-page {
  max-width: 860px;
  margin: 7rem auto 4rem;
  padding: 0 1.5rem;
}

/* ── Ingredient header ─────────────────────────────────────────────────────── */
.ingredient-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.ingredient-img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.ingredientTitle-Report {
  display: flex;
  gap: 1rem;
}

.ingredientTitle-Report button {
  background: none;
  border: none;
  cursor: pointer;
}

.reportFlag-img {
  width: 18px;
  height: 18px;
  transition: transform 0.15s ease;
}

.reportFlag-img:hover {
  transform: translate(-2px, -2px);
}

.admin-button {
  text-decoration: none;
  color: black;
  background-color: #88D498;
  width: 30%;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
}

.admin-button:hover {
  background-color: #6cb56d;
  color: white;
}

.ingredient-title {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  line-height: 1.3;
}

/* Coloured safety score dot */
.safety-dot {
  font-size: 0.8rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 99px;
  color: white;
}

.safety-dot.safe    { background: #6cb56d; }
.safety-dot.caution { background: #e9a84c; }
.safety-dot.concern { background: #d9534f; }

/* ── Ingredient Info ─────────────────────────────────────────────────────── */
.ingredients-section {
  margin-bottom: 2rem;
}

.ingredients-section h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #6cb56d;
  padding-bottom: 0.4rem;
}

.ingredient-detail {
  padding: 1rem 1.2rem 1.2rem;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ing-section {
  margin-bottom: 0.75rem;
}

.ing-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6cb56d;
  margin-bottom: 0.3rem;
}

.ing-section ul {
  padding-left: 1.2rem;
  color: #444;
}

.ing-science {
  font-size: 0.82rem;
  color: #777;
  border-top: 1px solid #e8e8e8;
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}

/* The clickable row for each ingredients products */
.ingredient-products-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: white;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.ingredient-products-toggle:hover { background: #f7fff6; }

.toggle-arrow {
  font-size: 0.85rem;
  color: #999;
  flex-shrink: 0;
}

/* Expanded ingredient products panel */
.ingredient-products {
  padding: 1rem 1.2rem 1.2rem;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ingredient-products a {
  text-decoration: none;
  color: black;
}

.ingredient-products a:hover {
  color: #A3D0A1;
}

.ingredient-products.hidden { display: none; }

/* ── Report Overlay ───────────────────────────────────────────────────────────────── */
.reportContainer {
  position: fixed;
  display: none;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.4);
}

.reportContent {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 25px;
  width: 60%;
  height: 80vh;
  border: 4px solid #6cb56d;
  background-color: white;
  padding: 0 10%;
}

.reportContent textarea:focus {
  border: 2px solid #A3D0A1;
  outline: none;
  border-radius: 4px;
}

@media screen and (min-width: 768px) {
  .reportContent {
    height: 50vh;
  }
}

.visibleReport {
  display: flex;
}

.closebtn {
  position: absolute;
  top: 215px;
  right: 350px;
  font-size: 70px;
  font-weight: bold;
  color: white;
  cursor: pointer;
}

.report-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}