:root {
  --background-color: #f0f2f5;
  --primary-color: #007bff;
  --primary-hover-color: #0056b3;
  --text-color: #333;
  --white-color: #fff;
  --border-color: #ccc;
  --shadow-color: rgba(0,0,0,0.1);
  --glow-color: rgba(0, 123, 255, 0.5);
}

body.dark-mode {
  --background-color: #282c36;
  --primary-color: #61afef;
  --primary-hover-color: #3e8ace;
  --text-color: #abb2bf;
  --white-color: #282c36; /* Dark background for elements that were white */
  --border-color: #444;
  --shadow-color: rgba(0,0,0,0.3);
  --glow-color: rgba(97, 175, 239, 0.5);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: grid;
  place-content: center;
  min-height: 100vh;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

/* Theme Switcher Styles */
.theme-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.theme-toggle {
  display: none;
}

.theme-toggle-label {
  display: block;
  width: 50px;
  height: 25px;
  background-color: #ccc;
  border-radius: 25px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s;
}

.theme-toggle-label::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.theme-toggle:checked + .theme-toggle-label {
  background-color: var(--primary-color);
}

.theme-toggle:checked + .theme-toggle-label::after {
  transform: translateX(25px);
}

/* Custom Element Styles Adaptation for Dark Mode */
toto-generator {
  --toto-bg: var(--white-color);
  --toto-border: var(--border-color);
  --toto-text: var(--text-color);
  --toto-button-bg: var(--primary-color);
  --toto-button-hover-bg: var(--primary-hover-color);
  --toto-button-shadow: var(--glow-color);
}

body.dark-mode toto-generator {
  --toto-bg: var(--white-color); /* This will be the dark background color for the card */
  --toto-border: var(--border-color);
  --toto-text: var(--text-color);
  --toto-button-bg: var(--primary-color);
  --toto-button-hover-bg: var(--primary-hover-color);
  --toto-button-shadow: var(--glow-color);
}

/* Update the custom element's internal styles to use these new variables */
/* This will be handled in main.js by injecting updated style into shadow DOM */

