* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
  background: linear-gradient(90deg, #0b0018, #003082);
  margin: 0;
  padding: 0;
  color: white;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  margin: 30px auto;
  width: 95%;
  max-width: 1200px;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

h1 {
  text-transform: uppercase;
}

.controls {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  align-items: center;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

label,
select,
input {
  font-size: 16px;
  padding: 8px;
  border-radius: 5px;
  border: none;
}

button {
  padding: 15px 30px;
  font-size: 22px;
  border: none;
  background: #ff4081;
  color: white;
  cursor: pointer;
  border-radius: 20px;
  transition: 0.3s;
  font-weight: bold;
  margin-top: 20px;

  /* FIX: This line stops the button from stretching and centers it. */
  align-self: center;
}

button:hover {
  background: #d81b60;
}

.palette {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.color-box {
  flex: 1 1 150px;
  aspect-ratio: 1 / 1;
  max-width: 200px;
  margin: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.color-box:hover {
  transform: scale(1.05);
}

.copy-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, #0b0018eb, #0b0018eb);
  color: white;
  padding: 30px 40px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  z-index: 1000;
  animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
}

#gradientOptions,
#mixOptions,
#mixGradientOptions {
  background: rgba(255, 255, 255, 0.07);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin: 10px auto 0;
  display: flex;
  gap: 15px;
  align-items: center;
  transition: background 0.3s;
}

#gradientOptions label,
#mixOptions label,
#mixGradientOptions label {
  color: #ffd6e0;
  font-weight: bold;
  margin-right: 5px;
  font-size: 1.2rem;
}

#gradientOptions input[type="number"],
#mixOptions input[type="color"],
#mixGradientOptions input[type="color"] {
  border: 1px solid #ff4081;
  background: #1a1a2e;
  color: #fff;
  padding: 4px 8px;
  border-radius: 5px;
  margin-right: 8px;
}

#gradientOptions select,
#mixOptions select,
#mixGradientOptions select {
  background: #1a1a2e;
  color: #fff;
  border: 1px solid #ff4081;
  border-radius: 5px;
  padding: 4px 8px;
}

input[type="color"] {
  border: none;
  background: none;
  width: 60px;
  height: 60px;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.2s;
}

input[type="color"]:hover {
  box-shadow: 0 4px 12px rgba(255, 64, 129, 0.25);
}

.footer {
  margin-top: auto;
  padding: 20px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.footer p {
  margin: 0;
}

.footer a {
  color: #ffeb3b;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px #ffeb3b;
}

/* --- MOBILE VIEWS --- */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .color-box {
    flex: none;
    width: 120px;
    height: 120px;
    font-size: 14px;
  }

  .controls {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  #gradientOptions,
  #mixOptions,
  #mixGradientOptions {
    flex-direction: column;
    width: 90%;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .container {
    padding: 15px;
    margin: 15px auto;
  }

  .color-box {
    flex: none;
    width: 100px;
    height: 100px;
    font-size: 12px;
  }

  button {
    width: 90%;
    font-size: 18px;
  }
}
