/* General Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #f4f4f9; /* Light mode background */
  color: #333; /* Light mode text color */
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

body.dark-mode {
  background-color: #121212; /* Dark mode background */
  color: #e0e0e0; /* Dark mode text color */
}

.container {
  background: #ffffff; /* Light mode container background */
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 400px;
  text-align: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.container.dark-mode {
  background: #090909; /* Light mode container background */
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 400px;
  text-align: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.container.dark-mode {
  background: #000; /* Black background for dark mode */
  box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1); /* Subtle glow for dark mode */
}

h1 {
  margin-bottom: 20px;
  font-size: 24px;
  transition: color 0.3s ease;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
  transition: color 0.3s ease;
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 2px solid #ccc;
  border-radius: 8px;
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

input[type="text"].dark-mode {
  background-color: #333; /* Dark mode input background */
  color: #e0e0e0; /* Dark mode input text */
  border-color: #555; /* Dark mode input border */
}

.button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap; /* Ensures buttons wrap on smaller screens */
}

.animated-button {
  flex: 1; /* Ensure buttons take equal width */
  padding: 12px 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: transform 0.2s ease, background 0.3s ease, color 0.3s ease;
}

#qrCodeButton {
  background: linear-gradient(145deg, #007bff, #0056b3); /* Gradient for QR Code button */
  color: white;
}

#barCodeButton {
  background: linear-gradient(145deg, #28a745, #1e7e34); /* Gradient for Barcode button */
  color: white;
}

.animated-button:hover {
  transform: scale(1.05);
}

.theme-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 12px; /* Smaller size */
  border: none;
  border-radius: 8px;
  background-color: #007bff;
  color: white;
  font-size: 12px; /* Smaller font size */
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.theme-toggle:hover {
  background-color: #0056b3;
}

#output {
  margin-top: 20px;
}

canvas {
  margin: 10px auto;
  display: block;
  border: 2px solid #ccc;
  border-radius: 8px;
  transition: border-color 0.3s ease;
}

canvas.dark-mode {
  border-color: #555; /* Dark mode canvas border */
}

a {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  background-color: #dc3545;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

a:hover {
  transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) { /* Tablets */
  h1 {
    font-size: 22px;
  }

  input[type="text"],
  .animated-button,
  a {
    font-size: 14px;
    padding: 10px;
  }
}

@media (max-width: 480px) { /* Mobile Phones */
  h1 {
    font-size: 20px;
  }

  input[type="text"],
  .animated-button,
  a {
    font-size: 12px;
    padding: 8px;
  }

  .container {
    padding: 15px;
  }

  canvas {
    width: 100%;
    height: auto;
  }

  .button-group {
    flex-direction: column;
    gap: 10px;
  }
}