* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f8f5ef;
  color: #222;
}

body.modal-open {
  overflow: hidden;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(122, 62, 29, 0.96);
  backdrop-filter: blur(12px);
  color: white;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.nav-container {
  width: 92%;
  max-width: 1180px;
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
  padding: 5px;
}

.nav-brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.nav-brand span {
  font-size: 13px;
  opacity: 0.9;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  opacity: 0.92;
}

.nav-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: white;
  color: #7a3e1d;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.auth-button:hover {
  transform: translateY(-1px);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  padding: 6px 12px;
  border-radius: 999px;
}

.user-profile span {
  display: block;
  font-size: 12px;
  color: #666;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 25px auto;
}

.hero-section {
  background:
    linear-gradient(rgba(122, 62, 29, 0.86), rgba(122, 62, 29, 0.72)),
    url("../images/Savanna Spoon logo.png");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: contain;
  padding: 55px 28px;
  border-radius: 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
  color: white;
}

.hero-content {
  max-width: 650px;
}

.hero-badge {
  display: inline-block;
  background: #fff7ef;
  color: #7a3e1d;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-section h2 {
  margin: 0 0 12px;
  color: white;
  font-size: 42px;
}

.hero-section p {
  margin: 0;
  color: #fff7ef;
  font-size: 18px;
  line-height: 1.6;
}

.search-section {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.search-section input {
  flex: 1;
  min-width: 230px;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #bbb;
  border-radius: 10px;
}

.search-section button {
  padding: 12px 18px;
  background: #7a3e1d;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.search-section button:hover {
  background: #5c2e15;
}

.status-section {
  margin-bottom: 20px;
  color: #555;
}

.recipe-types-section {
  background: white;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0 0 5px;
  color: #7a3e1d;
}

.section-heading p {
  margin: 0;
  color: #666;
}

.recipe-types-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.recipe-type-pill {
  border: 1px solid #d2b59c;
  background: #fff7ef;
  color: #7a3e1d;
  padding: 9px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.recipe-type-pill:hover {
  background: #7a3e1d;
  color: white;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.recipe-card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.recipe-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #fff7ef;
}

.recipe-card-content {
  padding: 15px;
}

.recipe-card h2 {
  margin: 0 0 8px;
  color: #7a3e1d;
  font-size: 20px;
}

.recipe-card p {
  margin: 6px 0;
}

.card-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.recipe-card button {
  width: 100%;
  padding: 10px;
  background: #222;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.recipe-card button:hover {
  background: #444;
}

.recipe-card .favorite-button {
  background: #b56b32;
}

.recipe-card .favorite-button:hover {
  background: #8d4f22;
}

.nutrition-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.nutrition-item {
  background: #fff7ef;
  border: 1px solid #ead4bf;
  border-radius: 10px;
  padding: 12px;
}

.nutrition-item strong {
  display: block;
  color: #7a3e1d;
}

.source-link {
  display: inline-block;
  margin-top: 15px;
  background: #7a3e1d;
  color: white;
  padding: 10px 14px;
  text-decoration: none;
  border-radius: 8px;
}

.source-link:hover {
  background: #5c2e15;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.modal-content {
  position: relative;
  width: 92%;
  max-width: 860px;
  max-height: 88vh;
  overflow-y: auto;
  margin: 45px auto;
  background: white;
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  animation: modalIn 0.22s ease-out;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #7a3e1d;
  color: white;
  font-size: 26px;
  cursor: pointer;
  z-index: 2;
}

.modal-close:hover {
  background: #5c2e15;
}

.modal-recipe-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #fff7ef;
  border-radius: 16px;
  margin: 14px 0;
}

.modal-title {
  color: #7a3e1d;
  margin: 0 0 8px;
  font-size: 30px;
}

.modal-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.modal-chip {
  background: #fff7ef;
  color: #7a3e1d;
  border: 1px solid #ead4bf;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.modal-section {
  margin-top: 20px;
}

.modal-section h3 {
  color: #7a3e1d;
  margin-bottom: 8px;
}

.modal-section ul,
.modal-section ol {
  padding-left: 25px;
}

.hidden {
  display: none;
}

.footer {
  margin-top: 40px;
  text-align: center;
  background: #222;
  color: white;
  padding: 18px;
}

.footer a {
  color: #f4c38b;
  text-decoration: none;
  font-weight: 700;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 850px) {
  .nav-container {
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    order: 3;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-auth {
    justify-content: center;
  }

  .hero-section {
    text-align: center;
    background-position: center;
  }

  .hero-section h2 {
    font-size: 32px;
  }
}

@media (max-width: 600px) {
  .nav-brand {
    justify-content: center;
    text-align: center;
  }

  .nav-brand h1 {
    font-size: 22px;
  }

  .nav-links {
    gap: 13px;
  }

  .search-section {
    flex-direction: column;
  }

  .search-section button {
    width: 100%;
  }

  .hero-section h2 {
    font-size: 28px;
  }

  .modal-content {
    width: 94%;
    margin: 24px auto;
    padding: 18px;
  }

  .modal-title {
    font-size: 24px;
  }
}