/*  Global Styles  */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f7fa;
  color: #333;
}

h1, h2, h3 {
  text-align: center;
  color: #2d6a4f;
}

h1 {
  margin-top: 20px;
}

.container {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/*  Navigation  */
nav {
  display: flex;
  justify-content: center;
  background: #2d6a4f;
  padding: 12px 0;
  gap: 10px;
}


nav button {
  background: transparent;
  border: none;
  color: white;
  margin: 0 15px;
  font-size: 16px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.3s ease;
}

nav button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/*  Screens  */
.screen {
  display: none;
  max-width: 700px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/*  Inputs & Buttons  */
input {
  width: 100%;
  padding: 10px;
  margin: 8px 0 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}

button {
  background: #52b788;
  color: white;
  border: none;
  padding: 10px 16px;
  margin-top: 5px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #40916c;
}

/*  Food & History Entries  */
.food-entry, .history-entry {
  background: #f8f9fa;
  margin: 8px 0;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  border: 1px solid #e9ecef;
}

.food-entry button {
  background: #d9534f;
  padding: 6px 12px;
  font-size: 14px;
}

.food-entry button:hover {
  background: #c9302c;
}

/*  Toast Notification  */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2d6a4f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  font-size: 14px;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

/*  Responsive design for sizing */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
  }
  nav button {
    margin: 5px 0;
  }
  .container {
    margin: 10px;
    padding: 15px;
  }
}

/*  Dashboard Styles  */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.dashboard-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card span {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 10px;
}

.dashboard-card h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #2d6a4f;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  background: #f0fdf4;
}

/*  Dark Mode Theme  */
body.dark-mode {
  background: #181a1b;
  color: #f0f0f0;
}

body.dark-mode .screen {
  background: #202225;
  color: #eaeaea;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

body.dark-mode nav {
  background: #1f352d;
}

body.dark-mode .dashboard-card {
  background: #2a2d30;
}

body.dark-mode button {
  background: #37966f; 
}

body.dark-mode .food-entry,
body.dark-mode .history-entry {
  background: #292c30;
  border: 1px solid #444;
}

body.dark-mode input {
  background: #2d3034;
  color: #fff;
  border: 1px solid #555;
}


.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  margin-left: 10px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  border-radius: 50%;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #2d6a4f; 
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.slider.round {
  border-radius: 26px;
}

.progress-container {
  background: #ddd;
  border-radius: 10px;
  height: 20px;
  width: 100%;
  margin: 15px 0;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: #52b788;
  border-radius: 10px;
  transition: width 0.4s ease;
}

.screen {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.screen.active {
  opacity: 1;
}

/* Stats Section */
.stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
}

.stat-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 15px 25px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-size: 1rem;
  color: #2d6a4f;
  min-width: 150px;
}

.stat-card strong {
  display: block;
  font-size: 1.4rem;
  margin-top: 5px;
  color: #333;
}

/* Dark Mode Support */
body.dark-mode .stat-card {
  background: #2a2d30;
  color: #eaeaea;
}

body.dark-mode .stat-card strong {
  color: #f5f5f5;
}
