/* Ensure the page takes up the entire viewport and prevents scrolling */
html, body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1a1a;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }

  /* Container to fill full width and height */
  .container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  /* Control panel centered within container */
  .control-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
  }

  /* Button styles with arrows and color transition */
  .btn-toggle {
    width: 100%;
    padding: 30px;
    font-size: 2em;
    margin-bottom: 20px;
    max-width: 400px; /* Limit max width for larger screens */
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s;
  }

  .btn-toggle.up .arrow {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: white;
  }

  .btn-toggle.down .arrow {
    font-size: 1.5em;
    margin-top: 10px;
    color: white;
  }

  .btn-toggle.up .arrow.pressed {
    color: #28a745; /* Green color when pressed */
  }
  .btn-toggle.down .arrow.pressed {
    color: #28a745; /* Green color when pressed */
  }
  /* Status indicator styling */
  .status-indicator {
    font-size: 1.2em;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    max-width: 400px;
    width: 100%;
    text-align: center;
  }

  .status-connected {
    background-color: #28a745;
  }

  .status-disconnected {
    background-color: #dc3545;
  }

  .status-unknown {
    background-color: #6c757d;
  }

  /* Hide the MQTT config form initially */
  #mqttConfigForm {
    display: none;
    margin-top: 30px;
    padding: 20px;
    border-radius: 10px;
    background-color: #333;
    text-align: left;
    width: 90%;
    max-width: 400px;
  }
  /* QR button styling */
  .btn-qr {
    display: flex;
    align-items: center;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    justify-content: center;
    float: right;
  }
  .btn img {
    margin-left: 8px;
    width: 20px;
    height: 20px;
  }

  #qrScannerContainer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
  }
  #cameraPreview {
    width: 100%;
    max-width: 400px;
    border: 2px solid #fff;
  }