:root {
  --bg-main: #fdf8fc;
  --bg-soft: #f8f3ff;
  --bg-soft-2: #f7fbf8;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-strong: rgba(255, 255, 255, 0.9);

  --text-main: #4f4656;
  --text-soft: #7d7384;
  --text-muted: #9b90a3;

  --accent-lavender: #d9c6f3;
  --accent-blush: #f3cfdd;
  --accent-sage: #d6ead8;
  --accent-cream: #fff2dd;
  --accent-gold: #f7e7a9;

  --border-soft: rgba(176, 154, 193, 0.28);
  --border-strong: rgba(176, 154, 193, 0.42);

  --shadow-soft: 0 10px 30px rgba(132, 112, 150, 0.12);
  --shadow-hover: 0 16px 36px rgba(132, 112, 150, 0.18);

  --button-main: linear-gradient(135deg, #ead8ff 0%, #f7dbe8 100%);
  --button-hover: linear-gradient(135deg, #e3cffd 0%, #f3d1e1 100%);
  --button-green: linear-gradient(135deg, #dff2e3 0%, #cfe8d4 100%);
  --button-danger: linear-gradient(135deg, #f3d1d8 0%, #edbcc8 100%);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --content-width: 900px;
}

/* Reset & base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, #fff7fb 0%, transparent 28%),
    radial-gradient(circle at top right, #f6efff 0%, transparent 26%),
    radial-gradient(circle at bottom left, #f4fbf5 0%, transparent 24%),
    linear-gradient(180deg, var(--bg-main) 0%, var(--bg-soft) 52%, var(--bg-soft-2) 100%);
  min-height: 100vh;

  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 4px 20px rgba(132, 112, 150, 0.08);
  padding: 1rem 2rem;
}

.navbar h1 {
  font-size: 1.9rem;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.navbar h1 a {
  text-decoration: none;
  color: inherit;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.navbar a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.navbar a:hover {
  background: rgba(233, 216, 255, 0.45);
  color: #5d4b6c;
  transform: translateY(-1px);
}

/* Hero Section */
.hero {
  max-width: 1100px;
  margin: 2rem auto 2.5rem auto;
  padding: 3rem 2rem;
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(255, 247, 252, 0.8),
    rgba(245, 239, 255, 0.85),
    rgba(242, 250, 244, 0.82)
  );
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.hero h2 {
  font-size: clamp(2rem, 3vw, 2.7rem);
  margin-bottom: 1rem;
  color: #5b4f66;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 720px;
  margin: 0 auto;
}

/* Shared card styles */
.recipe-card,
.recipe-detail-card,
.inventory-card,
.form-card,
.meal-plan-card,
.grocery-list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Featured Recipes */
.featured-recipes {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.featured-recipes h3,
.category-links h3,
.recipe-section h3,
.inventory-list-section h3,
.meal-plan-list-section h3 {
  margin-bottom: 1rem;
  font-size: 1.45rem;
  color: #6b5a79;
}

.recipe-card-container {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.recipe-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.15rem;
  width: 250px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

.recipe-card h4 {
  margin-bottom: 0.45rem;
  color: var(--text-main);
  font-size: 1.15rem;
}

.recipe-card p {
  color: var(--text-soft);
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 90;
  margin-top: auto;
}

/* All Recipes / Search */
.all-recipes-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.search-bar {
  margin-bottom: 1.25rem;
  text-align: center;
}

#searchInput,
#recipeSearchInput,
.ingredient-selector input,
.form-card input,
.form-card select,
.form-card textarea,
.meal-plan-count-input,
.edit-ingredient-row input,
.edit-ingredient-row select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#searchInput:focus,
#recipeSearchInput:focus,
.ingredient-selector input:focus,
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus,
.edit-ingredient-row input:focus,
.edit-ingredient-row select:focus {
  border-color: rgba(186, 154, 213, 0.75);
  box-shadow: 0 0 0 4px rgba(223, 202, 245, 0.38);
  background: rgba(255, 255, 255, 0.98);
}

#searchInput {
  max-width: 420px;
}

.sort-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  color: var(--text-soft);
}

.sort-bar select {
  max-width: 220px;
}

.recipe-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Category pages */
.category-header {
  text-align: center;
  margin-bottom: 2rem;
}

.category-header h2 {
  font-size: 2.1rem;
  color: #6a5f73;
  margin-bottom: 0.4rem;
}

.category-header p {
  font-size: 1.08rem;
  color: var(--text-soft);
}

.category-links {
  max-width: 1200px;
  margin: 0 auto 1rem auto;
  padding: 0 2rem 2rem 2rem;
  text-align: center;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.category-link {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  box-shadow: 0 6px 18px rgba(132, 112, 150, 0.08);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.category-link:hover {
  background: rgba(240, 229, 255, 0.8);
  transform: translateY(-2px);
}

/* Recipe detail page */
.recipe-page,
.inventory-page,
.form-page,
.meal-plan-page,
.grocery-list-page {
  padding: 2rem;
  display: flex;
  justify-content: center;
}

.recipe-detail-card,
.inventory-card,
.form-card,
.meal-plan-card,
.grocery-list-card {
  width: 100%;
  max-width: var(--content-width);
  padding: 2rem;
  margin-bottom: 4rem;
}

.recipe-detail-card h2 {
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

#recipeServings {
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 1rem;
}

.recipe-section {
  margin-top: 1.6rem;
}

.recipe-section ul {
  padding-left: 1.4rem;
}

.recipe-section li {
  margin-bottom: 0.55rem;
  color: var(--text-main);
}

.recipe-page-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.recipe-page-actions a {
  color: #7a5fa1;
  text-decoration: none;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(233, 216, 255, 0.38);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.recipe-page-actions a:hover {
  background: rgba(233, 216, 255, 0.58);
  transform: translateY(-1px);
}

/* Inventory */
.ingredient-selector {
  position: relative;
  margin-top: 1rem;
}

.ingredient-selector label,
.form-card label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: #62576a;
}

.suggestions-list {
  display: none;
  position: absolute;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-soft);
  border-radius: 0 0 14px 14px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 12px 25px rgba(132, 112, 150, 0.12);
}

.suggestion-item {
  padding: 0.8rem 1rem;
  cursor: pointer;
  border-top: 1px solid rgba(223, 214, 232, 0.7);
  color: var(--text-main);
  background: transparent;
}

.suggestion-item:hover {
  background-color: rgba(242, 234, 251, 0.72);
}

.inventory-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.inventory-list-section {
  margin-top: 2rem;
}

.inventory-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.inventory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.72);
}

/* Forms */
.form-card h2,
.inventory-card h2,
.meal-plan-card h2,
.grocery-list-card h2 {
  color: var(--text-main);
  margin-bottom: 1rem;
}

.form-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-card textarea {
  min-height: 150px;
  resize: vertical;
}

/* Ingredient row editor */
.edit-ingredient-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto auto;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: start;
}

.ingredient-search-wrapper {
  position: relative;
}

.ingredient-search-wrapper .suggestions-list {
  display: none;
  position: absolute;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-soft);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
}

/* Buttons */
button,
.inventory-actions button,
.inventory-item button,
.add-new-ingredient-btn,
.remove-ingredient-btn,
.form-card button,
.grocery-list-actions button {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
  background: var(--button-main);
  box-shadow: 0 6px 18px rgba(163, 139, 182, 0.14);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover,
.inventory-actions button:hover,
.inventory-item button:hover,
.add-new-ingredient-btn:hover,
.form-card button:hover,
.grocery-list-actions button:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(163, 139, 182, 0.18);
}

.add-new-ingredient-btn {
  background: var(--button-green);
}

.add-new-ingredient-btn:hover {
  background: linear-gradient(135deg, #d8eddc 0%, #c7e2cd 100%);
}

.remove-ingredient-btn {
  background: var(--button-danger);
}

.remove-ingredient-btn:hover {
  background: linear-gradient(135deg, #efc4cf 0%, #e8b3c1 100%);
}

/* Meal plan */
.meal-plan-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.meal-plan-item-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.meal-plan-count-input {
  width: 90px;
  padding: 0.7rem 0.85rem;
}

/* Grocery list */
.grocery-list-card p {
  color: var(--text-soft);
  margin-bottom: 0.6rem;
}

.grocery-list-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
}

.grocery-item-left {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.grocery-list-item input[type="checkbox"] {
  margin-top: 0.35rem;
  transform: scale(1.2);
  accent-color: #b996df;
}

/* Responsive */
@media (max-width: 900px) {
  .edit-ingredient-row {
    grid-template-columns: 1fr;
  }

  .meal-plan-add {
    grid-template-columns: 1fr;
  }

  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar ul {
    gap: 0.6rem;
  }
}

@media (max-width: 600px) {
  header,
  .all-recipes-container,
  .featured-recipes,
  .category-links,
  .recipe-page,
  .inventory-page,
  .form-page,
  .meal-plan-page,
  .grocery-list-page {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero {
    padding: 2rem 1.25rem;
  }

  .recipe-detail-card,
  .inventory-card,
  .form-card,
  .meal-plan-card,
  .grocery-list-card {
    padding: 1.25rem;
  }

  .inventory-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .recipe-page-actions {
    align-items: flex-start;
  }
}

/* Firefly background */
#fairy-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* Subtle vines */
.vine {
  position: fixed;
  top: 0;
  width: 180px;
  height: 320px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.28;
  filter: blur(0.2px);
}

.vine-left {
  left: 0;
  background:
    radial-gradient(circle at 35% 18%, rgba(214, 234, 216, 0.95) 0 7px, transparent 8px),
    radial-gradient(circle at 48% 34%, rgba(214, 234, 216, 0.9) 0 6px, transparent 7px),
    radial-gradient(circle at 28% 48%, rgba(214, 234, 216, 0.92) 0 7px, transparent 8px),
    radial-gradient(circle at 56% 62%, rgba(214, 234, 216, 0.88) 0 6px, transparent 7px),
    radial-gradient(circle at 30% 78%, rgba(214, 234, 216, 0.9) 0 7px, transparent 8px),
    linear-gradient(115deg, transparent 0 42%, rgba(144, 178, 146, 0.7) 43%, rgba(144, 178, 146, 0.7) 45%, transparent 46%),
    linear-gradient(100deg, transparent 0 52%, rgba(144, 178, 146, 0.5) 53%, rgba(144, 178, 146, 0.5) 55%, transparent 56%);
  border-bottom-right-radius: 140px;
}

.vine-right {
  right: 0;
  transform: scaleX(-1);
  background:
    radial-gradient(circle at 35% 18%, rgba(214, 234, 216, 0.95) 0 7px, transparent 8px),
    radial-gradient(circle at 48% 34%, rgba(214, 234, 216, 0.9) 0 6px, transparent 7px),
    radial-gradient(circle at 28% 48%, rgba(214, 234, 216, 0.92) 0 7px, transparent 8px),
    radial-gradient(circle at 56% 62%, rgba(214, 234, 216, 0.88) 0 6px, transparent 7px),
    radial-gradient(circle at 30% 78%, rgba(214, 234, 216, 0.9) 0 7px, transparent 8px),
    linear-gradient(115deg, transparent 0 42%, rgba(144, 178, 146, 0.7) 43%, rgba(144, 178, 146, 0.7) 45%, transparent 46%),
    linear-gradient(100deg, transparent 0 52%, rgba(144, 178, 146, 0.5) 53%, rgba(144, 178, 146, 0.5) 55%, transparent 56%);
  border-bottom-right-radius: 140px;
}

/* Keep main UI above background decor */
header,
main,
footer {
  position: relative;
  z-index: 1;
}

#recipeImagePreview,
#recipeImageDisplay {
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.7);
}

.recipe-image-wrap {
  margin: 0.75rem 0 1rem 0;
}

.grocery-manual-add {
  margin: 1.25rem 0 2rem 0;
}

/* =========================
   Grocery List Styling
========================= */

.grocery-manual-add {
  margin: 1.5rem 0 2rem 0;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.grocery-manual-add h3 {
  margin-bottom: 1rem;
}

/* Search row */
.meal-plan-add {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

/* Search input wrapper */
.ingredient-search-wrapper {
  position: relative;
  flex: 1;
}

/* Main search box */
#grocerySearchInput {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-soft);
  font-size: 0.95rem;
  outline: none;
}

#grocerySearchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(215, 190, 235, 0.25);
}

/* Quantity + unit row */
.inventory-form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.inventory-form-row > div {
  flex: 1;
}

/* Styled inputs */
#groceryQuantity,
#groceryUnit {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-soft);
  font-size: 0.95rem;
}

/* Grocery item cards */
.grocery-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.grocery-item-left {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

/* Buttons */
.grocery-list-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* Suggestions dropdown */
.suggestions-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
}

.suggestion-item {
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.suggestion-item:hover {
  background: rgba(245, 232, 255, 0.6);
}

.grocery-item-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.remove-btn {
  background: rgba(255, 205, 210, 0.75);
  color: #6b2f36;
}

.remove-btn:hover {
  background: rgba(255, 190, 196, 0.9);
}

.inventory-search {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.inventory-search label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #62576a;
}

.inventory-search input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.inventory-search input:focus {
  border-color: rgba(186, 154, 213, 0.75);
  box-shadow: 0 0 0 4px rgba(223, 202, 245, 0.38);
  background: rgba(255, 255, 255, 0.98);
}

.site-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 1rem 0;
}

.site-logo {
  width: 220px;
  max-width: 80%;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(160, 130, 180, 0.15));
}

.hero-logo {
  width: 700px;
  max-width: 90%;
  height: auto;
  display: block;
  margin: 0 auto 0.75rem auto;
  filter: drop-shadow(0 10px 22px rgba(160, 130, 180, 0.14));
  animation: gentleFloat 5s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Expanded side vines */
.vine {
  position: fixed;
  width: 180px;
  height: 320px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.24;
  filter: blur(0.2px);
}

.vine-left {
  left: 0;
  top: 0;
  background:
    radial-gradient(circle at 35% 18%, rgba(214, 234, 216, 0.95) 0 7px, transparent 8px),
    radial-gradient(circle at 48% 34%, rgba(214, 234, 216, 0.9) 0 6px, transparent 7px),
    radial-gradient(circle at 28% 48%, rgba(214, 234, 216, 0.92) 0 7px, transparent 8px),
    radial-gradient(circle at 56% 62%, rgba(214, 234, 216, 0.88) 0 6px, transparent 7px),
    radial-gradient(circle at 30% 78%, rgba(214, 234, 216, 0.9) 0 7px, transparent 8px),
    linear-gradient(115deg, transparent 0 42%, rgba(144, 178, 146, 0.7) 43%, rgba(144, 178, 146, 0.7) 45%, transparent 46%),
    linear-gradient(100deg, transparent 0 52%, rgba(144, 178, 146, 0.5) 53%, rgba(144, 178, 146, 0.5) 55%, transparent 56%);
  border-bottom-right-radius: 140px;
}

.vine-right {
  right: 0;
  top: 0;
  transform: scaleX(-1);
  background:
    radial-gradient(circle at 35% 18%, rgba(214, 234, 216, 0.95) 0 7px, transparent 8px),
    radial-gradient(circle at 48% 34%, rgba(214, 234, 216, 0.9) 0 6px, transparent 7px),
    radial-gradient(circle at 28% 48%, rgba(214, 234, 216, 0.92) 0 7px, transparent 8px),
    radial-gradient(circle at 56% 62%, rgba(214, 234, 216, 0.88) 0 6px, transparent 7px),
    radial-gradient(circle at 30% 78%, rgba(214, 234, 216, 0.9) 0 7px, transparent 8px),
    linear-gradient(115deg, transparent 0 42%, rgba(144, 178, 146, 0.7) 43%, rgba(144, 178, 146, 0.7) 45%, transparent 46%),
    linear-gradient(100deg, transparent 0 52%, rgba(144, 178, 146, 0.5) 53%, rgba(144, 178, 146, 0.5) 55%, transparent 56%);
  border-bottom-right-radius: 140px;
}

.vine-left-mid,
.vine-right-mid {
  top: 32%;
  opacity: 0.25;
  transform: scale(0.9);
}

.vine-left-lower,
.vine-right-lower {
  top: 62%;
  opacity: 0.25;
  transform: scale(0.8);
}

/* keep right-side mirrored even on additional vines */
.vine-right-mid,
.vine-right-lower {
  transform: scaleX(-1) scale(0.9);
}

.vine-right-lower {
  transform: scaleX(-1) scale(0.8);
}

.corner-palm-wrap {
  position: fixed;
  bottom: 0;
  width: clamp(120px, 15vw, 250px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
}

.corner-palm-wrap-left {
  left: 0;
}

.corner-palm-wrap-right {
  right: 0;
}

.corner-palm-img {
  position: absolute;
  bottom: 0;
  width: clamp(120px, 15vw, 250px);
  height: auto;
}

.corner-palm-img-left {
  left: 0;
  transform: scaleX(-1);
  transform-origin: center;
}

.corner-palm-img-right {
  right: 0;
}

.nav-logo {
  margin: 0;
  display: flex;
  align-items: center;
}

.nav-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo img {
  height: 56px;
  width: auto;
  display: block;
  transition: transform 0.2s ease;
}

.nav-logo img:hover {
  transform: scale(1.03);
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 4px 20px rgba(132, 112, 150, 0.08);
  padding: 1rem 2rem;
  transition:
    padding 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    backdrop-filter 0.25s ease;
}

header.nav-scrolled {
  padding: 0.55rem 2rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(132, 112, 150, 0.14);
}

header.nav-scrolled .nav-logo img {
  height: 42px;
}

header.nav-scrolled .navbar a {
  padding: 0.3rem 0.7rem;
  font-size: 0.95rem;
}

header.nav-scrolled .navbar {
  gap: 0.75rem;
}

.nav-logo img {
  height: 56px;
  width: auto;
  display: block;
  transition: transform 0.2s ease, height 0.25s ease;
}

header.nav-scrolled .navbar ul {
  gap: 0.75rem;
}

header.nav-scrolled .navbar h1,
header.nav-scrolled .nav-logo {
  margin: 0;
}

/* Final dropdown styling */
.inventory-card select,
.form-card select,
.meal-plan-card select,
.grocery-list-card select,
.edit-ingredient-row select,
.inventory-form-row select,
.sort-bar select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;

  width: 100%;
  min-width: 0;
  padding: 0.85rem 2.75rem 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-main);

  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  outline: none;
  cursor: pointer;

  background-color: rgba(255, 255, 255, 0.88) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #a58fba 50%),
    linear-gradient(135deg, #a58fba 50%, transparent 50%) !important;
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px) !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
}

.inventory-card select:focus,
.form-card select:focus,
.meal-plan-card select:focus,
.grocery-list-card select:focus,
.edit-ingredient-row select:focus,
.inventory-form-row select:focus,
.sort-bar select:focus {
  border-color: rgba(186, 154, 213, 0.75);
  box-shadow: 0 0 0 4px rgba(223, 202, 245, 0.38);
  background-color: rgba(255, 255, 255, 0.98) !important;
}

.inventory-card select::-ms-expand,
.form-card select::-ms-expand,
.meal-plan-card select::-ms-expand,
.grocery-list-card select::-ms-expand,
.edit-ingredient-row select::-ms-expand,
.inventory-form-row select::-ms-expand,
.sort-bar select::-ms-expand {
  display: none;
}

.inventory-form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.inventory-form-row > div {
  flex: 1;
  min-width: 0;
}

.inventory-form-row > div:last-child {
  max-width: 220px;
}

.styled-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding: 0.85rem 2.75rem 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  background-color: rgba(255, 255, 255, 0.88) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #a58fba 50%),
    linear-gradient(135deg, #a58fba 50%, transparent 50%) !important;
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px) !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
}

.inventory-form-row {
  display: grid;
  grid-template-columns: 2fr 220px;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.5rem;
}

.inventory-form-row > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.inventory-form-row label {
  margin-bottom: 0.45rem;
}

.ingredient-selector {
  position: relative;
}

.ingredient-search-wrapper {
  position: relative;
  width: 100%;
}

.suggestions-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  width: 100%;
  display: none;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
}

.ingredient-selector {
  position: relative;
}

.ingredient-search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 1rem;
}

#ingredientSearch {
  width: 100%;
}

#ingredientSuggestions.suggestions-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  width: 100%;
  display: none;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
}

.inventory-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1rem;
  align-items: start;
}

.inventory-form-field {
  display: flex;
  flex-direction: column;
}

.inventory-form-field label {
  margin-bottom: 0.45rem;
}

.inventory-unit-field select {
  width: 100%;
}

.inventory-help-text {
  margin-top: 0.4rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

/* Hamburger button */
.hamburger {
  display: none;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-main);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* Animated open state */
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Desktop nav */
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 2rem 1rem 2rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.mobile-nav a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--border-soft);
  box-shadow: 0 6px 14px rgba(132, 112, 150, 0.08);
}

.mobile-nav a:hover {
  background: rgba(240, 229, 255, 0.85);
}

.mobile-nav.open {
  display: flex;
}

@media (max-width: 900px) {
  .navbar {
    flex-direction: row;
    align-items: center;
  }

  .navbar ul {
    gap: 0.6rem;
  }
}

@media (max-width: 980px) {
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }

  .nav-links,
  #desktopNav {
    display: none !important;
  }

  .hamburger,
  #hamburgerBtn {
    display: inline-flex !important;
  }

  .nav-logo {
    flex: 0 1 auto;
  }

  .nav-logo a {
    display: flex;
    align-items: center;
  }

  .nav-logo img {
    height: 44px;
    width: auto;
  }
}

.navbar {
  flex-direction: column;
  align-items: flex-start;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.25rem 1.25rem;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft);
}

.mobile-nav.open {
  display: flex;
}

@media (max-width: 980px) {
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
  }

  .nav-links,
  #desktopNav {
    display: none !important;
  }

  .hamburger,
  #hamburgerBtn {
    display: inline-flex !important;
  }
}

#removeRecipeImageBtn {
  align-self: flex-start;
  margin-top: 0.75rem;
}

/* Desktop navbar layout */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row !important;
  flex-wrap: nowrap;
  gap: 1.5rem;
}

/* Logo stays left */
.nav-logo {
  flex: 0 0 auto;
  margin: 0;
}

/* Tabs stay right */
.nav-links,
#desktopNav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Prevent wrapping */
.nav-links li,
#desktopNav li {
  white-space: nowrap;
}