* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #e0eafc, #cfdef3);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
  color: #333;
}

.container {
  background: #fff;
  max-width: 480px;
  width: 100%;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(100, 100, 111, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

h1 {
  text-align: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 2.8rem;
  margin: 0 0 1rem 0;
  color: #2c3e50;
  letter-spacing: 1.5px;
}

input[type="text"] {
  width: 100%;
  padding: 1rem 1.2rem;
  font-size: 1.1rem;
  border-radius: 12px;
  border: 1.8px solid #d1d9e6;
  outline: none;
  transition: border-color 0.3s ease;
  color: #2c3e50;
  background-color: #fafafa;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}
input[type="text"]::placeholder {
  color: #a0aec0;
  font-style: italic;
}
input[type="text"]:focus {
  border-color: #667eea;
  background-color: #fff;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

button {
  padding: 1rem;
  font-size: 1.1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(45deg, #667eea, #764ba2);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.2s ease;
  user-select: none;
  filter: drop-shadow(0 2px 4px rgba(118, 75, 162, 0.5));
}
button:hover {
  background: linear-gradient(45deg, #5a67d8, #6b46c1);
  box-shadow: 0 8px 25px rgba(107, 70, 193, 0.7);
  transform: translateY(-3px);
}
button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.5);
}
#resetBtn {
  background: linear-gradient(45deg, #e53e3e, #9b2c2c);
  box-shadow: 0 5px 15px rgba(229, 62, 62, 0.4);
  filter: drop-shadow(0 2px 4px rgba(155, 44, 44, 0.5));
}
#resetBtn:hover {
  background: linear-gradient(45deg, #c53030, #7b1a1a);
  box-shadow: 0 8px 25px rgba(123, 26, 26, 0.7);
}
#resetBtn:active {
  box-shadow: 0 4px 12px rgba(123, 26, 26, 0.5);
}

h2, h3 {
  text-align: center;
  margin: 0;
  font-weight: 600;
  color: #2c3e50;
}

#totalCalories {
  font-weight: 700;
  font-size: 2rem;
  color: #4a69bd;
}

#history {
  max-height: 200px;
  overflow-y: auto;
  background: #f5f7fa;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: inset 0 0 10px #d1d9e6;
  color: #4a4a4a;
  font-size: 1rem;
}

#history div {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #d1d9e6;
  user-select: none;
}

#history div:last-child {
  border-bottom: none;
}

/* Scrollbar styling */
#history::-webkit-scrollbar {
  width: 8px;
}
#history::-webkit-scrollbar-track {
  background: #f5f7fa;
}
#history::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 10px;
}

@media (max-width: 520px) {
  .container {
    padding: 1.5rem 1.8rem;
  }
  h1 {
    font-size: 2.4rem;
  }
  input[type="text"], button {
    font-size: 1rem;
    padding: 0.8rem 1rem;
  }
}
