:root {
  --background-color: #f4f4f4;
  --text-color: #333;
  --card-background: #ffffff;
  --button-background: #4285F4;
  --button-text: #ffffff;
}

[data-theme='dark'] {
  --background-color: #121212;
  --text-color: #e0e0e0;
  --card-background: #1e1e1e;
  --button-background: #bb86fc;
  --button-text: #121212;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  text-align: center;
  padding: 2rem;
  background-color: var(--card-background);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
  width: 90%;
  max-width: 500px;
  position: relative;
}

/* Theme toggle switch */
.theme-switch-wrapper {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
}

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

.theme-switch input {
  display:none;
}

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

.slider:before {
  background-color: #fff;
  bottom: 2px;
  content: "";
  height: 20px;
  left: 2px;
  position: absolute;
  transition: .4s;
  width: 20px;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--button-background);
}

input:checked + .slider:before {
  transform: translateX(24px);
}


.title {
  margin-bottom: 2rem;
  color: var(--text-color);
  user-select: none;
  -webkit-user-select: none;
}

.generator-button {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  border-radius: 8px;
  border: none;
  background-color: var(--button-background);
  color: var(--button-text);
  cursor: pointer;
  transition: background-color 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  user-select: none;
  -webkit-user-select: none;
}

.generator-button:hover {
  opacity: 0.9;
}

.numbers-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: 70px; /* To prevent layout shift */
}

@keyframes draw {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.number-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 0; /* Start hidden */
  transform: scale(0);
  animation: draw 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@media (max-width: 600px) {
  .container {
    padding: 1.5rem;
    padding-top: 4rem; /* Make space for the switch */
  }

  .title {
    font-size: 1.8rem;
  }

  .generator-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  .number-circle {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }
}
