/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

@font-face {
    font-family: 'Fredoka';
    src: url('fonts/Fredoka-VariableFont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  transform: translate(200px, 50px);
}

}

/* Hide the default checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider background */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

/* The slider circle */
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

/* When checked */
input:checked + .slider {
  background-color: #2196F3;
}

/* Move the circle when checked */
input:checked + .slider:before {
  transform: translateX(22px);
}

/* Optional rounded corners */
.slider.round {
  border-radius: 34px;
}


html, body {
    height: 100%;
    overflow: hidden;  /* Prevents scrolling */
    margin: 0;         /* Removes default margin */
}


/* Light Theme Variables */
:root {
    --bg-color: #D7E8F7;
    --card-color: #F7F7F7;
    --text-color: #424242;
}

/* Dark Theme Variables */
body.dark-theme {
    --bg-color: #1e1e1e;
    --card-color: #2c2c2c;
    --text-color: #f0f0f0;
}

/* Layout Styles */
body {
    font-family: 'Fredoka', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-bottom: 60px;
}

h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.card {
    background-color: var(--card-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    margin-top: -10px;  /* move UP */
    /* margin-top: 20px;  move DOWN */
}

/*.card p, .card h2 {
    margin-top: -50px;  /* move UP */
    /* margin-top: 20px;  move DOWN */
}


}

nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    background-color: var(--card-color);
    padding: 10px 0;
    border-top: 1px solid #ccc;
    transition: background-color 0.3s;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #ccc;
  z-index: 1000;
}

.bottom-nav a {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.icon {
  width: 28px;
  height: 28px;
}

/* Light Mode: Hide white icons */
.light-mode {
  display: inline;
}

.dark-mode {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .bottom-nav {
    background-color: #121212;
    border-top-color: #444;
  }

  .light-mode {
    display: none;
  }

  .dark-mode {
    display: inline;
  }
}



.scale-container {
    position: relative;
    display: flex;
    justify-content: center; /* Horizontally center */
    align-items: center;     /* Vertically center (if needed) */
    max-width: 400px;
    width: 90%;
    margin: 0 auto;          /* Center container itself */
}


#scaleIcon {
    width: 100%;
    height: auto;
    display: block;
}

.calorie-overlay {
    position: absolute;
      backdrop-filter: blur(3px);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    top: 70%; /* Adjust vertical position */
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 12px;
    border-radius: 12px;
    width: 80%; /* optional */
}


[Bowl Image (light/dark depending on mode)]
   ⬇
[Meal Name — centered over the image]
   ⬇
[Calories Input Section]
   ⬇
[“Save Meal” Button]
.meal-log-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
        width: 300px; /* or maybe height: 300px; */

}

.bowl-image.light-mode {
  display: block;
}

.bowl-image.dark-mode {
  display: none;
}

/* When dark mode is active (via class) */
body.dark-theme .bowl-image.light-mode {
  display: none;
}

body.dark-theme .bowl-image.dark-mode {
  display: block;
}


.light-mode {
  display: block;
}

.dark-mode {
  display: none;
}

/* Automatically switch based on theme using media query */
@media (prefers-color-scheme: dark) {
  .light-mode {
    display: none;
  }
  .dark-mode {
    display: block;
  }
}

.meal-name-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  color: white;
  font-size: 1.2rem;
  text-align: center;
  pointer-events: none;
}

.calorie-section {
  margin-top: 20px;
  text-align: center;
}

.save-meal-btn {
  margin-top: 16px;
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
    
}


@media (prefers-color-scheme: dark) {
  .light-mode { display: none; }
  .dark-mode { display: block; }
}

.meal-name-input {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  font-size: 1.2rem;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  width: 50%;
  backdrop-filter: blur(4px);
}

.meal-name-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

body.dark-theme .meal-name-input {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}




.nav-image-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;  /* Adjust this as needed */
    z-index: 2;  /* Ensure the button stays above other elements */
}

.save-meal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 60px; /* Increase this to move the Save Meal button down */
    gap: 12px;
}



.nav-img {
  width: 450px;
  max-width: 100%; /* keeps it responsive on smaller screens */
  height: auto;
  display: none;
}

.nav-img-2 {
  width: 850px;
  max-width: 100%; /* keeps it responsive on smaller screens */
  height: auto;
  display: none;
}

body:not(.dark-theme) .nav-img.light-mode {
  display: block;
}

body.dark-theme .nav-img.dark-mode {
  display: block;
}


.nav-btn {
  position: absolute;
  top: 73%;
  left: 50.5%;
  transform: translate(-50%, -50%);
  background-color: #000;
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 25px;
  cursor: pointer;
  z-index: 1;
}

.nav-btn-2 {
  position: absolute;
  top: 86%;
  left: 50.5%;
  transform: translate(-50%, -50%);
  background-color: #000;
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 25px;
  cursor: pointer;
  z-index: 1;
}


.dark-mode .nav-btn {
  background-color: #fff;
  color: #000;
}


.log-meal-wrapper {
  margin-top: 20px; /* change this to move button up/down */
  text-align: center;
}

.log-meal-btn {
  /* If this already exists, just update or keep it */
  padding: 10px 25px;
  font-size: 16px;
  background-color: #2196F3;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.save-meal-wrapper {
  margin-top: 35px; /* change this to adjust vertical spacing */
  text-align: center;
}




.log-meal-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px; /* adjust to move up or down */
}

.log-meal-wrapper .nav-btn {
  background-color: #444;
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

/* Optional: For light/dark mode icons inside */
.log-meal-wrapper img {
  width: 24px;
  margin-right: 10px;
}

/* Save Meal Button */
.save-meal-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 40px; /* adjust as needed */
}

.save-meal-wrapper .nav-btn {
  background-color: #444;
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.save-meal-wrapper img {
  width: 450px;
  margin-right: 10px;

}


/* Hide both images by default */
.light-only, .dark-only {
  display: none;
}

/* Show black image in light mode */
@media (prefers-color-scheme: light) {
  .light-only {
    display: inline;
  }
}

/* Show white image in dark mode */
@media (prefers-color-scheme: dark) {
  .dark-only {
    display: inline;
  }
}


/* Fix scale icon visibility based on theme */
.scale-img.light-mode {
  display: block;
}

.scale-img.dark-mode {
  display: none;
}

body.dark-theme .scale-img.light-mode {
  display: none;
}

body.dark-theme .scale-img.dark-mode {
  display: block;
}

.scale-img {
    width: 100%;
    height: auto;
    display: block;
}


.save-meal-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
  gap: 12px;
}

.nav-img_2 {
  width: 50px;
  height: auto;
}

body.dark-theme .nav-img_2.light-mode {
  display: none;
}

body:not(.dark-theme) .nav-img_2.dark-mode {
  display: none;
}



body.dark-theme .save-meal-btn {
  background-color: #fff;
  color: #000;
}

.save-meal-wrapper {
  position: relative;
  z-index: 2;
}

.meal-name-input {
  z-index: 1;
}

.nav-image-button {
  margin-top: -190px; /* Move image UP more */
}


body:not(.dark-theme) .nav-img-2.light-mode {
  display: block;
}

body.dark-theme .nav-img-2.dark-mode {
  display: block;
}

/* Inside design.css */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f4f4f4;
    font-weight: bold;
}

tr:hover {
    background-color: #f9f9f9;
}

#totalCalories {
    font-weight: bold;
    color: #333;
}

/* Make the history section flexible */
.history-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    padding: 0 15px;
}

table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
    margin-bottom: 10px;
}

th, td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ccc;
    word-break: break-word;
}

@media screen and (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    table, th, td {
        font-size: 0.9rem;
    }

    .bottom-nav {
        font-size: 20px;
    }

    .container {
        padding: 0 10px;
    }
}

/* Default (light mode) */
.theme-button, .nav-btn-2 {
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

/* Dark mode override */
body.dark-theme .theme-button,
body.dark-theme .nav-btn-2 {
    background-color: white;
    color: black;
}


.calorie-section {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.calorie-label {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
    white-space: nowrap;
}

.calorie-input {
    font-size: 1.1rem;
    padding: 6px 10px;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 8px;
    width: 150px;
    text-align: center;
    backdrop-filter: blur(4px);
}

.calorie-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

body.dark-theme .calorie-input {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}


.bowl-image-container {
  display: flex;
  justify-content: center; /* change to flex-start or flex-end to move left/right */
  margin: 20px 0;
}

.bowl-image-container img {
  width: 475px;
  height: auto;
  margin-left: 31px; /* positive moves right, negative moves left */
}


body.dark-theme .history-content table,
body.dark-theme .history-content p,
body.dark-theme .history-content span {
    color: white!important;
}


/* Keep table headers black in both light and dark mode */
th {
    color: black;
}

body.dark-theme td {
    color: black;
}


/* Default table cell text color (for light mode) */
td {
  color: #333;
}

/* Force table cell text to be black when in dark mode */
.dark-mode td {
  color: black;
}

.dark-mode th {
  color: black;
}

/* Override text color for meal history table items in dark mode */
body.dark-theme .history-content table td {
    color: black; /* Sets the text color to black */
}

/* Adjust for meal name and calorie count if needed */
body.dark-theme .history-content table th, 
body.dark-theme .history-content table td {
    color: black;  /* Override default white text color */
}

/* If you have specific meal name or calorie sections that need adjustments */
body.dark-theme .meal-name, 
body.dark-theme .calories {
    color: black;  /* Ensure meal names and calories appear in black */
}
