/* Global styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  max-width: 700px;
  margin: auto;
  background-color: #f0f2f5;
  color: #333;
}

/* Headings */
h1,
h3 {
  text-align: center;
  color: #222;
}

/* Section styling */
section {
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ESP Status */
#espStatus {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
}

/* Toggle Switch Style */
.switch {
  display: block;
  margin: 0 auto 10px auto;
  position: relative;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #4CAF50;
}

input:checked+.slider:before {
  transform: translateX(26px);
}

/* Inputs and output labels */
input[type="range"] {
  width: 100%;
  margin-top: 10px;
}

p {
  text-align: center;
  font-size: 16px;
}

/* Responsive tweaks */
@media (max-width: 900px) {
  body {
    max-width: 100%;
    padding: 10px;
  }

  section {
    margin-bottom: 15px;
    padding: 12px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 8px;
    font-size: 15px;
  }

  section {
    padding: 10px;
    border-radius: 8px;
  }

  h1 {
    font-size: 22px;
  }

  h3 {
    font-size: 16px;
  }

  #espStatus {
    font-size: 15px;
  }

  .switch {
    width: 48px;
    height: 28px;
  }

  .slider:before {
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
  }

  input:checked+.slider:before {
    transform: translateX(18px);
  }

  p {
    font-size: 14px;
  }
}

/* Extra small devices */
@media (max-width: 400px) {
  h1 {
    font-size: 18px;
  }

  h3 {
    font-size: 14px;
  }

  #espStatus {
    font-size: 13px;
  }

  .switch {
    width: 38px;
    height: 22px;
  }

  .slider:before {
    height: 14px;
    width: 14px;
    left: 4px;
    bottom: 4px;
  }

  input:checked+.slider:before {
    transform: translateX(10px);
  }
}