:root {
  --bg-color: #121212;
  --text-color: white;
  --input-bg: #1e1e1e;
  --input-text: white;
  --button-bg: #00ffcc;
  --button-text: #121212;
  --preview-border: #00ffcc;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: Arial, sans-serif;
  text-align: center;
  padding: 2rem 1rem;
  transition: background-color 0.3s, color 0.3s;
}

.converter {
  background-color: var(--input-bg);
  padding: 1.5rem;
  border-radius: 10px;
  display: inline-block;
  box-shadow: 0 0 20px var(--button-bg);
  width: 95%;
  max-width: 400px;
  transition: background-color 0.3s;
}

input {
  padding: 0.7rem;
  width: 90%;
  margin: 0.5rem 0;
  border: 1px solid var(--input-text);
  border-radius: 5px;
  font-size: 1rem;
  background-color: var(--input-bg);
  color: var(--input-text);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Light theme input border */
body[data-theme="light"] input {
  border-color: #aaa;
}

input[readonly] {
  background-color: #333;
  color: var(--button-bg);
}

.colorPreview {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  margin: 1.5rem auto;
  background-color: transparent;
  border: 2px solid var(--preview-border);
  transition: border-color 0.3s;
}

button {
  margin: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  background-color: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

#themeToggleBtn {
  width: 80%;
  margin-bottom: 1.5rem;
  font-weight: bold;
  font-size: 1.2rem;
}

h1 {
  color: var(--button-bg);
  font-size: 2rem;
}

hr {
  margin: 1.5rem 0;
  border: 1px dashed #555;
}

/* Mobile responsive tweaks */
@media (max-width: 480px) {
  .converter {
    padding: 1.5rem 1rem;
  }

  .colorPreview {
    width: 80px;
    height: 80px;
  }

  button {
    width: 100%;
    margin: 0.5rem 0;
  }

  #themeToggleBtn {
    width: 100%;
  }
}