/* ==========================
       Minimal Recipe App — Dark
       HTML + CSS only (no JS)
       ========================== */

:root {
  --bg: #0f1724; /* deep navy */
  --card: #0b1220; /* slightly lighter */
  --muted: #94a3b8; /* soft slate */
  --accent: #ffb86b; /* warm apricot */
  --glass: rgba(255, 255, 255, 0.03);
  --glass-2: rgba(255, 255, 255, 0.02);
  --radius: 14px;
  --fw-regular: 400;
  --fw-medium: 600;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: radial-gradient(
      1200px 600px at 10% 10%,
      rgba(139, 92, 246, 0.08),
      transparent
    ),
    linear-gradient(180deg, var(--bg), #07101a 120%);
  color: #e6eef8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-size: 15px;
}

.wrap {
  width: min(1100px, 96vw);
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
}

/* ----- SIDEBAR ----- */
.sidebar {
  background: linear-gradient(180deg, var(--card), rgba(255, 255, 255, 0.01));
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  min-height: 520px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 18px;
}
.brand h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.search {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.search input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.03);
  color: inherit;
  font-weight: 500;
}
.search button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: linear-gradient(90deg, #ffb86b, #ff8a65);
  color: #08101a;
  font-weight: 700;
  cursor: pointer;
}

.filters {
  margin-top: 18px;
}
.filters h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--glass-2);
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.01);
}
.chip:hover {
  color: #fff;
  background: linear-gradient(
    90deg,
    rgba(255, 184, 107, 0.08),
    rgba(255, 138, 101, 0.05)
  );
}

.saved {
  margin-top: 20px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
  border: 1px solid rgba(255, 255, 255, 0.02);
}
.saved h4 {
  margin: 0 0 6px 0;
  color: var(--muted);
  font-size: 13px;
}
.saved p {
  margin: 0;
  font-weight: 600;
}

/* ----- MAIN ----- */
.main {
  min-height: 520px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), transparent);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.title {
  display: flex;
  flex-direction: column;
}
.title h1 {
  margin: 0;
  font-size: 18px;
}
.title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sort {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sort select {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
}

/* recipe grid */
.grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}

.card-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6);
}

.card-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-body h3 {
  margin: 0;
  font-size: 15px;
}
.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 8px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--accent);
  font-size: 12px;
}

/* wide card (featured) */
.featured {
  grid-column: 1 / -1;
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
}
.featured img {
  height: 220px;
  width: 420px;
  object-fit: cover;
  border-radius: 10px;
}
.featured .info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

/* responsive */
@media (max-width: 980px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .featured img {
    width: 100%;
    height: 180px;
  }
}
@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .search input {
    font-size: 14px;
  }
  .sidebar {
    padding: 16px;
  }
  .card-item img {
    height: 140px;
  }
}

/* tiny utility */
.muted {
  color: var(--muted);
}
.featured_timing_div {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
/* Error message box (default hidden) */
#errormessage {
  display: flex; /* layout content nicely */
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    rgba(255, 75, 75, 0.12),
    rgba(255, 64, 64, 0.06)
  );
  color: #fff;
  color: #ffeef0;
  border-left: 4px solid rgba(255, 75, 75, 0.95);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.45);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  max-width: 720px;
  margin: 12px 0;
  word-break: break-word;
  transform-origin: top center;
  opacity: 1;
  transition: transform 0.18s ease, opacity 0.18s ease;
  will-change: transform, opacity;
}

/* Hidden utility (completely removed from layout & screen readers) */
.hidden {
  display: none !important;
}

/* Optional "visible" state with subtle entrance animation */
.show-error {
  display: flex !important; /* override .hidden if toggled */
  animation: errorEnter 0.22s ease forwards;
}

@keyframes errorEnter {
  from {
    transform: translateY(-6px) scale(0.995);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Small helper for lighter/more compact message */
#errormessage.small {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  box-shadow: none;
  max-width: 420px;
}

/* Icon styling (if you put an inline SVG or emoji) */
#errormessage .icon {
  font-size: 18px;
  opacity: 0.95;
}
#brand_id {
  cursor: pointer;
}
/* Card must be positioned */
.card-item {
  position: relative;
  overflow: hidden;
}

/* Hidden Save Button */
/* EXISTING: Card save button (hidden until hover) */
.save-button {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Show on card hover */
.card-item:hover .save-button {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Hover effect for the button itself */
.save-button:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ========== NEW: Modal save button (always visible) ========== */
.modal-content .save-button {
  position: static; /* Remove absolute positioning */
  opacity: 1; /* Always visible */
  transform: none; /* No transform */
  pointer-events: auto; /* Clickable */
  margin-bottom: 12px; /* Add some spacing below it */
  background: rgba(255, 184, 107, 0.2); /* Slightly highlighted */
  padding: 8px 12px;
  font-size: 20px;
}

/* Show on hover */

/* Hover effect for the button itself */
.save-button:hover {
  background: rgba(255, 255, 255, 0.25);
}
/* Saved section wrapper */
.saved {
  margin-top: 40px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  backdrop-filter: blur(4px);
}

.saved h4 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #fff;
}

.saved .empty-msg {
  color: #bbb;
  font-size: 14px;
  margin-top: 4px;
}

/* Grid for saved recipe cards */
.saved-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

/* Small saved cards */
.saved-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
  cursor: pointer;
}

.saved-card:hover {
  transform: translateY(-4px);
}

/* Thumbnail image */
.saved-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

/* Info inside */
.saved-card .info {
  padding: 10px 12px;
}

.saved-card h3 {
  font-size: 15px;
  color: #fff;
  margin-bottom: 6px;
}

.saved-card .muted {
  font-size: 13px;
  color: #aaa;
}

/* Modal background */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
  padding-bottom: 40px;
  overflow-y: auto;

  /* opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease; */
}

/* Show modal */
/* .modal.show {
  opacity: 1;
  pointer-events: auto;
} */

/* Modal card */
.modal-content {
  background: #141414;
  width: min(90%, 700px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  padding-bottom: 30px;
  animation: popin 0.28s ease;
}

@keyframes popin {
  from {
    transform: scale(0.94);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Close button */
.close-btn {
  position: absolute;
  right: 20px;
  top: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  font-size: 20px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: white;
  transition: background 0.15s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Recipe image */
#modal-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

/* Title */
#modal-title {
  padding: 20px 24px;
  color: #fff;
  margin-bottom: 10px;
}

/* Section titles */
.section-title {
  padding: 0 24px;
  color: #ffdd99;
  font-size: 18px;
  margin-top: 18px;
  margin-bottom: 8px;
}

/* Ingredients list */
.ingredients-list {
  padding: 0 40px;
  margin: 0;
  list-style: square;
}

.ingredients-list li {
  color: #ccc;
  margin-bottom: 6px;
  line-height: 1.4;
}

/* Instructions */
.instructions {
  padding: 0 24px;
  color: #ddd;
  margin-top: 6px;
  line-height: 1.6;
}

/*  */

.tutorial-link {
  display: inline-block;
  padding: 10px 16px;
  margin: 10px 24px;
  background: #1f1f1f;
  color: #ffdd99;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s ease;
}

.tutorial-link:hover {
  background: #2c2c2c;
  color: #ffe7b8;
}
.ingredients-list {
  padding: 0 40px;
  margin: 0;
  list-style: square;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px 18px;
}
.bookmark-btn {
  position: absolute;
  left: 28%;
  top: 10%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  font-size: 20px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: white;
  transition: background 0.15s ease;
}

.bookmark-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.save-button {
  cursor: pointer;
}
