:root {
  --brand: hsl(34, 47%, 50%);
  --brand-hover: hsl(34, 47%, 60%);
  --background-color: hsl(60, 100%, 97%);
  --gray: hsl(34, 47%, 40%);

  /* Added elevation shadows and card backgrounds */
  --card-bg: #ffffff;
  --shadow-sm:
    0 4px 6px -1px rgba(115, 87, 40, 0.08),
    0 2px 4px -1px rgba(115, 87, 40, 0.04);
  --shadow-md:
    0 10px 15px -3px rgba(115, 87, 40, 0.12),
    0 4px 6px -2px rgba(115, 87, 40, 0.05);
  --shadow-btn: 0 4px 14px 0 rgba(187, 134, 68, 0.39);
  --error-color: #d9534f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Montserrat", sans-serif; /* Recommended for readability on main UI text */
  font-weight: 400;
  font-style: normal;
  line-height: 1.7;
  text-align: center;
  background-color: var(--background-color);
  color: var(--gray);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Nav Improvements */
header {
  padding: 1.5rem 2rem;
  background-color: var(--background-color);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto 1.5rem auto;
}

nav img {
  width: 70px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav li a {
  text-decoration: none;
  color: var(--brand);
  font-weight: 600;
  transition: color 0.2s ease;
}

nav li a:hover {
  color: var(--brand-hover);
}

h1 {
  font-family: "Monoton", display;
  color: var(--brand);
  font-size: 2.2rem;
  letter-spacing: 1px;
  margin-top: 1rem;
}

h2 {
  color: var(--gray);
  margin-bottom: 1rem;
  font-family: "Montserrat", sans-serif;
}

/* Modernized Button Styling */
.btn {
  background-color: var(--brand);
  color: var(--background-color);
  padding: 0.75rem 1.8rem;
  border: none;
  border-radius: 998px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background-color: var(--brand-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(187, 134, 68, 0.54);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.tab-btn span {
  pointer-events: none;
}

/* Form & Input Section */
#add-form,
#search-form {
  display: flex;
  gap: 10px;
  max-width: 500px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

#add-form input,
#search-form input,
.field-group input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid transparent;
  border-radius: 998px;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: all 0.2s ease;
  font-family: "Montserrat", sans-serif;
}

#add-form input:focus,
#search-form input:focus,
.field-group input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(187, 134, 68, 0.2);
}

/* Shopping List & Items Container */
main {
  flex: 1;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

#list {
  list-style: none;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#list li {
  background-color: var(--card-bg);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--brand);
  transition: all 0.2s ease;
  cursor: pointer;
}

#list li:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
}

.api-card {
  background-color: var(--card-bg);
  border: 1px solid var(--brand);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 500px;
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
  color: var(--gray);
  text-align: left;
}

/* Requirement: Bought state toggle styling */
#list li.bought {
  text-decoration: line-through;
  opacity: 0.55;
  border-left-color: var(--gray);
  background-color: rgba(255, 255, 255, 0.5);
}

.del {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.del:hover {
  background-color: #c0392b;
}

/* Total Section */
.total-container {
  background-color: var(--card-bg);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-top: 1rem;
}

/* Signup Form Layout */
.card-form {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-group label {
  font-weight: 600;
  font-size: 0.85rem;
}

.error-box {
  background-color: #f8d7da;
  color: var(--error-color);
  border: 1px solid #f5c6cb;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  max-width: 500px;
  margin: 0 auto 1rem auto;
  font-weight: 600;
  font-size: 0.9rem;
}

.country-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.8rem;
}

.flag-img {
  width: 40px;
  border-radius: 4px;
}

/* Footer Improvements */
footer {
  margin-top: auto;
  padding: 2rem 1rem;
}

footer ul {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 1rem;
  margin-top: 0.5rem;
}

footer li a {
  text-decoration: none;
  font-size: 1.4rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

footer li a:hover {
  transform: translateY(-3px);
}
