/* styles.css */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 0;
  background: #fefefe;
  color: #222;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: #00796b;
  color: white;
  /* padding: 1rem; */
  text-align: center;
}

header h1 {
  font-size: 1.5rem;
}

main {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.controls {
  flex: 1 1 320px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: 0 0 6px rgb(0 0 0 / 0.1);
}

.controls h2 {
  margin-top: 0;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.form-group label {
  min-width: 140px;
  font-weight: 600;
}

.form-group input[type="color"],
.form-group input[type="number"],
.form-group select,
.form-group input[type="range"] {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 0.25rem 0.3rem;
  border: 1px solid #aaa;
  border-radius: 4px;
  font-size: 1rem;
}

fieldset.form-group {
  border: 1px solid #ccc;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

fieldset.form-group legend {
  font-weight: 700;
  padding: 0 0.5rem;
}

fieldset.form-group label {
  font-weight: normal;
  min-width: auto;
}

#opacityValue {
  min-width: 30px;
  text-align: right;
  font-family: monospace;
}

.output {
  flex: 1 1 400px;
  padding: 1rem 1.5rem;
  background: #fefefe;
  border-radius: 8px;
  box-shadow: 0 0 6px rgb(0 0 0 / 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
}

.output h2 {
  margin: 0 0 0.25rem 0;
}

#previewWrapper {
  position: relative;
  height: 150px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #e9e9e9;
  overflow: visible;
}

/* We will apply positioning styles dynamically on the a tag inside #previewWrapper */

#generatedCode {
  background: #222;
  color: #f8f8f8;
  border-radius: 6px;
  padding: 1rem;
  white-space: pre;
  overflow-x: auto;
  max-height: 250px;
  font-family: Consolas, Monaco, 'Courier New', monospace;
  user-select: all;
}

/* Copy button styling */
#copyButton {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  background-color: #00796b;
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}

#copyButton:hover,
#copyButton:focus {
  background-color: #004d40;
  outline: none;
}

footer {
  background: #00796b;
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

footer a {
  color: #b2dfdb;
  text-decoration: underline;
}