body {
  font-family: sans-serif;
  background-color: #f4f4f4;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  width: 80%;
  max-width: 800px;
}

.container h2 {
  text-align: left;
  color: #333;
   margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

h1 {
  text-align: center;
  color: #333;
}

#latestData {
  text-align: center;
  margin-bottom: 20px;
}

#latestData p {
  font-size: 1.2em;
  color: #555;
  margin: 5px 0;
}

#chartContainer, #humidityChartContainer, #dewPointChartContainer {
  width: 100%;
  margin-top: 20px;
}

nav {
  background-color: #333;
  padding: 10px 0;
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-block;
}

nav ul li {
  display: inline;
  margin: 0 15px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 10px 15px;
  border-radius: 4px;
  transition: background-color 0.3s;
  display: inline-block;
}

nav ul li a:hover {
  background-color: #555;
  text-decoration: none;
}

/* Mobile styles */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #333;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    text-align: left;
  }
  
  nav ul.active {
    display: block;
  }
  
  nav ul li {
    display: block;
    margin: 0;
    border-bottom: 1px solid #555;
  }
  
  nav ul li:last-child {
    border-bottom: none;
  }
  
  nav ul li a {
    padding: 15px 20px;
    display: block;
  }
  
  /* Hamburger animation */
  .nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }
}

/* Styles for table on "All Measurements" page */
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}

table th, table td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}

table th {
background-color: #f2f2f2;
font-weight: bold;
}

/* Light blue background for manually triggered measurements */
table tr.manual-fetch {
background-color: #e6f3ff;
}

/* Styles for buttons and date selector on "Settings" page */
button {
  background-color: black;
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 4px;
   transition: background-color 0.3s;
}

button:hover {
  background-color: darkgray;
opacity: 1;
}

input[type="datetime-local"] {
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
margin-right: 10px;
}

/* Highlight rows with exceeded dew point */
.dew-point-exceeded {
  background-color: #ffebee;
}

.dew-point-exceeded p {
   color: #d32f2f;
   text-align: center;
   font-weight: bold;
}

/* Styles for login page */

.login-form {
width: 400px;
}

.login-form input {
   display: block;
   margin-bottom: 10px;
   padding: 10px;
   border: 1px solid #ddd;
   border-radius: 4px;
   width: 100%;
   box-sizing: border-box; /* Ensure padding doesn't make input wider */
}
.login-error {
 color: #d32f2f;
 text-align: center;
}
label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

/* Ensure checkbox controls stack with labels above and proper spacing */
.settings-option input[type="checkbox"],
.delete-option input[type="checkbox"] {
  margin-top: 6px;
}

.settings-option input[type="number"],
.delete-option input[type="datetime-local"],
.delete-option input[type="date"],
.settings-option button,
.delete-option button {
  width: 100%;
}

/* Styling for settings page*/
.delete-records-container {
    display: flex;
    flex-direction: column;
   justify-content: flex-start;
     align-items: stretch; /* Stack options vertically */
    gap: 12px;
}

.delete-option {
      width: 100%;
      padding-right: 0;
      padding-top: 10px;
      box-sizing: border-box;
   display: flex;
  flex-direction: column;
   align-items: flex-start;
}

.settings-form-container {
      display: flex;
    flex-direction: column;
    align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
}
.settings-option {
       width: 100%;
       box-sizing: border-box;
      display: flex;
     flex-direction: column;
     align-items: flex-start;

}

.settings-fetched-ok {
  color: green;
  font-weight: bold;
}

.settings-not-fetched {
  color: red;
  font-weight: bold;
}

/* Notification page styles */
.notification-section {
  margin-bottom: 30px;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f9f9f9;
}

.notification-section h2 {
  margin-top: 0;
  color: #333;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
}

.notification-option {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background-color: white;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
}

.notification-option label {
  display: flex;
  align-items: center;
  flex: 1;
  margin-right: 15px;
  font-weight: 500;
}

.notification-option input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
}

.notification-option input[type="number"] {
  width: 80px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-right: 5px;
}

.notification-option input[type="number"]:disabled {
  background-color: #f5f5f5;
  color: #999;
}

.form-actions {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.btn-primary, .btn-secondary {
  padding: 12px 24px;
  margin: 0 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
}

/* Navigation controls styles */
.navigation-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
}

.nav-button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s;
}

.nav-button:hover:not(:disabled) {
  background-color: #0056b3;
}

.nav-button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.range-info {
  text-align: center;
  color: #555;
  font-size: 14px;
}

.range-info p {
  margin: 5px 0;
}

/* Responsive adjustments for Settings page */
@media (max-width: 768px) {
  .settings-form-container,
  .delete-records-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .settings-option,
  .delete-option {
    width: 100%;
    padding-right: 0;
  }

  /* Make form controls easier to use on mobile */
  .settings-option input[type="number"],
  .delete-option input[type="datetime-local"],
  .delete-option input[type="date"],
  .settings-option button,
  .delete-option button {
    width: 100%;
  }

  /* Improve spacing between label and control */
  .settings-option label,
  .delete-option label {
    margin-bottom: 8px;
  }
}