* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Lucida Sans', Geneva, Verdana, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.content {
  position: relative;
}

.background-image {
  position: fixed;
  left: 0;
  top: 60px; 
  width: 100vw;
  height: calc(100vh - 60px);
  z-index: -1;
  
  /* Improved image display */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  
  /* Better opacity handling */
  opacity: 0.6;
  
  /* Prevent distortion on mobile */
  object-fit: cover;
  
  /* Performance optimization */
  image-rendering: -webkit-optimize-contrast; /* Safari */
  image-rendering: crisp-edges; /* Standard */
  will-change: transform; /* Helps with performance */
}

nav {
  width: 100%;
  position: fixed;
  top: 0;
  z-index: 1000;
}

nav ul {
  list-style-type: none;
  background-color: #56c0ee;
  display: flex;
  padding: 0;
  height: 60px;
  align-items: center;
}

nav ul li {
  margin: 0 10px;
}

.nav-my-thermostat {
  display: flex;
  flex-grow: 1;
  justify-content: flex-end;
}

nav ul li a {
  display: block;
  color: white;
  padding: 14px 16px;
  text-decoration: none;
}

nav ul li a:hover {
  border-radius: 5px;
  background-color: rgb(47, 158, 255);
}


/* ========== MOBILE NAVBAR ========== */

/* Fix HTML structure issue - make div behave like flex container */
nav ul .nav-my-thermostat {
  display: flex;
  margin-left: auto;
}

/* Hamburger button - hidden on desktop */
.hamburger {
  display: none;
  cursor: pointer;
  padding: 18px 20px;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 5px 0;
  transition: 0.3s;
}

/* Mobile styles */
@media (max-width: 768px) {
  /* Show hamburger on mobile */
  .hamburger {
    display: block;
  }
  
  /* Hide regular menu on mobile by default */
  nav ul {
    display: none;
    flex-direction: column;
    height: auto;
    width: 100%;
    position: absolute;
    top: 60px;
    left: 0;
    padding: 20px 0;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
  }
  
  /* Show menu when active */
  nav ul.active {
    display: flex;
  }
  
  /* Stack items vertically */
  nav ul li,
  .nav-my-thermostat {
    width: 100%;
    margin: 0;
    text-align: center;
  }
  
  .nav-my-thermostat {
    flex-direction: column;
    margin-left: 0;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 10px;
    margin-top: 10px;
  }
  
  /* Remove the flex-grow on mobile */
  .nav-my-thermostat {
    flex-grow: 0;
  }
  
  /* Adjust link padding */
  nav ul li a {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  /* Hamburger animation */
  .hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }
}

.top {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 100px 20px 60px;
  gap: 40px;
  flex-wrap: wrap;
}

.section {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
}

.instruction {
  text-align: center;
  padding: 20px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.instruction h2 {
  font-size: 30px;
  margin-bottom: 20px;
}

.instruction h1 {
  font-size: 25px;
  margin-bottom: 20px;
}

.instruction h4 {
  font-size: 15px;
  margin-bottom: 20px;
}

.instruction p {
  font-size: 16px;
  margin: 10px 0;
}

.instruction ul {
  padding-left: 20px;
  text-align: left;
}

.instruction ul li {
  display: list-item;
  list-style-type: disc;
  margin: 20px 0;
}

.login {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.login form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 400px;
}

.login input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.login button {
  background: #14a1ff;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
}

.login button:hover {
  background-color: rgb(0, 247, 255);
}

.card {
  background: #ffffff;
  padding: 30px;
  margin: 40px auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 600px;
  width: 90%;
}

.card h2 {
  font-size: 30px;
  margin-bottom: 20px;
}

.card h3 {
  margin-bottom: 20px;
}

.card p {
  font-size: 16px;
  color: #333;
  margin: 8px 0;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.actions button {
  background: #14a1ff;
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 15px;
  border-radius: 6px;
}

.actions button:hover {
  background: rgb(0, 247, 255);
}

.history-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-card {
  display: flex;
  flex-direction: column;
  gap: 30px;
  background: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 700px; /* narrower card */
  width: 90%;
  margin: 40px auto;
  text-align: left;
}

.history-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  align-items: left;
  gap: 15px;
}

.history-row button {
  flex: 1;
  max-width: 50%;
  background: #14a1ff;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.history-row button:hover {
  background: rgb(0, 247, 255);
}

#hideButton {
  display: block;
  margin: 10px auto;
  max-width: 200px;
  background: #ffffff;
  color: black;
  border: black 1.5px solid;
  padding: 5px 10px;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
}

#hideButton:hover {
  background: rgb(224, 255, 252);
} 

.styled-select {
  flex-shrink: 0;
  min-width: 25%;
  background-color: #ffffff;
  color: rgb(0, 0, 0);
  border-color: #333;
  padding: 10px 15px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
}

.styled-select:focus {
  outline: none;
  background-color: #e9f6ff;
}

.description {
  font-size: 10px;
  color: #444;
  margin-left: 4px;
}

.chart {
  background: #ffffff;
  padding: 50px;
  margin: 40px auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 900px; /* increased from 600px */
  width: 90%;
}

.settings {
  background: #ffffff;
  padding: 30px;
  margin: 40px auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 800px;
}

.settings button {
  background: #14a1ff;
  color: white;
  padding: 7px 20px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
}

.settings button:hover {
  background: rgb(0, 247, 255);
}

.rules {
  display: inline-block;
  width: 70%;
  background: #f9f9f9;
  border: 2px solid #000000;
  padding: 20px;
  border-radius: 10px;
  margin-top: 20px;
  margin-bottom: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  align-items: normal;
  text-align: left;
}

.rules h4 {
  font-size: 18px;
  margin-bottom: 0;
}

.rules ul {
  list-style-type: disc;
  text-align: left;
  padding: 10px;
  margin: 0 0;
}

.rules ul li {
  align-items: normal;
}

.rules ul p {
  font-size: 15px;
}

#new_temp {
  width: 30%;
  padding: 10px;
  margin-right: 20px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}

.logo {
  width: 10px;
  float: right;
}

.documentation {
  max-width: 800px;
}

.documentation h1 {
  font-size: 25px;
  margin-bottom: 20px;
}

.documentation h4 {
  font-size: 15px;
  margin-bottom: 20px;
}

.documentation ul {
  padding-left: 20px;
  text-align: left;
}

.documentation ul li {
  display: list-item;
  list-style-type: disc;
  margin: 20px 0;
}

.documentation .rules {
  text-align: center;
  margin-top: 20px;
  padding: 5px 10px;
  width: 80%;
}

.documentation .rules p {
  font-size: 15px;
}

.documentation a {
  color: rgb(102, 171, 255);
}

.wifi-image {
  border-color: #333;
  border-style: solid;
  border-width: 1px;
  border-radius: 6px;
  width: 600px;
}

p {
  font-size: 20px;
}

button {
  transition: background 0.3s ease;
}