body {
  font-family: "Roboto", "Helvetica", "Arial", sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

body.light-mode {
  background-color: #f5f5f5;
  color: #333;
}

body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

.container {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  box-sizing: border-box;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.dark-mode .container {
  background-color: #424242;
  box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

h1 {
  text-align: center;
  color: #3f51b5;
  margin-bottom: 30px;
}

.dark-mode h1 {
  color: #7986cb;
}

.toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin-bottom: 20px;
}

.toggle-item {
  display: flex;
  align-items: center;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #2196f3;
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-label {
  margin-left: 8px;
  font-size: 14px;
}

#connectButton {
  display: block;
  margin: 20px auto;
  font-size: 16px;
  padding: 10px 20px;
}

.mdl-textfield {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 20px;
}

.button-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}

.button-container button {
  min-width: 120px;
}

#feeDisplay {
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
}

#output {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
  word-wrap: break-word;
  transition: background-color 0.3s, border-color 0.3s;
}

.dark-mode #output {
  background-color: #616161;
  border-color: #757575;
}

.qr-code {
  text-align: center;
  margin-bottom: 20px;
}

#qrcode img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  background-color: #fff;
  transition: border-color 0.3s, background-color 0.3s;
}

.dark-mode #qrcode img {
  border-color: #757575;
  background-color: #616161;
}

#ownerControls {
  background-color: #e8eaf6;
  border-radius: 4px;
  padding: 20px;
  margin-top: 30px;
  transition: background-color 0.3s;
}

.dark-mode #ownerControls {
  background-color: #3f4252;
}

#contactDataView {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
  transition: background-color 0.3s, border-color 0.3s;
}

.dark-mode #contactDataView {
  background-color: #424242;
  border-color: #757575;
}

.contact-data-content {
  white-space: pre-wrap;
  word-wrap: break-word;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.dark-mode .contact-data-content {
  background-color: #616161;
}

@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  h1 {
    font-size: 24px;
  }

  .mdl-textfield {
    max-width: 100%;
  }

  .button-container {
    flex-direction: column;
  }

  .button-container button {
    width: 100%;
  }
}

/* Dark mode styles */
.dark-mode .mdl-textfield__input {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.dark-mode .mdl-textfield__label {
  color: rgba(255, 255, 255, 0.6);
}

.dark-mode .mdl-textfield--floating-label.is-focused .mdl-textfield__label,
.dark-mode .mdl-textfield--floating-label.is-dirty .mdl-textfield__label {
  color: #64b5f6; /* Light blue color for better visibility */
}

.dark-mode .mdl-textfield__label:after {
  background-color: #64b5f6;
}

/* Loader styles */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#loaderMessage {
  color: white;
  margin-top: 10px;
  text-align: center;
}

.dark-mode #loader {
  background-color: rgba(0, 0, 0, 0.7);
}

.dark-mode #loaderMessage {
  color: #e0e0e0;
}

.mdl-dialog {
  border: none;
  box-shadow: 0 9px 46px 8px rgba(0, 0, 0, 0.14),
    0 11px 15px -7px rgba(0, 0, 0, 0.12), 0 24px 38px 3px rgba(0, 0, 0, 0.2);
}

.dark-mode .mdl-dialog {
  background-color: #424242;
  color: #ffffff;
}

.dark-mode .mdl-dialog__title {
  color: #ffffff;
}

.dark-mode .mdl-button {
  color: #64b5f6;
}
