/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1f1f1f, #2c2c2c);
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
.header {
  width: 100%;
  background: linear-gradient(135deg, #536976, #292e49);
  padding: 20px 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-content img {
  height: 50px;
  margin-right: 15px;
}

.header-content h1 {
  font-size: 28px;
  font-weight: 300;
}

/* Main Container */
.container {
  max-width: 800px;
  width: 90%;
  background: #262626;
  padding: 30px;
  margin: 20px 0;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.container h1 {
  margin-top: 0;
  margin-bottom: 20px;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #b0b0b0;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: #333;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  box-shadow: 0 0 5px rgba(255, 255, 255, 1); /* Changed to white */
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Color Field */
.color-field {
  display: flex;
  align-items: center;
}

.color-field input {
  flex: 1;
}

.color-link {
  margin-left: 15px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #ff0037, #8800ff);
  color: #fff;
  border-radius: 30px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s;
}

.color-link:hover {
  background: linear-gradient(150deg, #ff004c, #7700ff);
}

/* Buttons */
button {
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

button.primary {
  background-color: #7289da;
  color: #fff;
  width: 100%;
  margin-top: 30px; /* Adjusted for better spacing */
}

button.primary:hover {
  background-color: #5b6dcd;
}

button.secondary {
  background-color: #f44336;
  color: #fff;
  margin-top: 10px; /* Reduced from 20px to bring closer to "Fields:" */
}

button.secondary:hover {
  background-color: #d32f2f;
}

/* Fields Container */
.fields-container {
  margin-top: 30px;
}

.fields-container h2 {
  margin-top: 0;
  margin-bottom: 0; /* Set to 0 to reduce space below "Fields:" */
  font-size: 20px;
  color: #fff;
}

/* Field Item */
.field-item {
  background: #2b2b2b;
  border: 1px solid #3a3a3a;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.field-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.field-input label {
  font-size: 14px;
  color: #b0b0b0;
  margin-bottom: 4px;
}

.field-input input,
.field-input textarea {
  width: 100%;
  padding: 10px;
  background: #333;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
}

.field-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.toggle-switch {
  display: flex;
  align-items: center;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch label {
  position: relative;
  display: block;
  width: 40px;
  height: 24px;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.3s;
  margin-right: 8px;
}

.toggle-switch label::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch input:checked + label {
  background: #4caf50;
}

.toggle-switch input:checked + label::before {
  transform: translateX(16px);
}

.toggle-text {
  font-size: 14px;
  color: #b0b0b0;
}

.remove-field {
  background-color: #f44336;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.remove-field:hover {
  background-color: #d32f2f;
}

/* Toggle Switch (Repeated Section) */
.toggle-switch {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch label {
  position: relative;
  display: block;
  width: 50px;
  height: 28px;
  background: #ccc;
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-switch label::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch input:checked + label {
  background: #4caf50;
}

.toggle-switch input:checked + label::before {
  transform: translateX(22px);
}

.speech-bubble-container {
  position: relative;
  margin-left: 10px;
}

.speech-bubble {
  visibility: hidden;
  width: 80px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #555 transparent transparent transparent;
}

.speech-bubble-container:hover .speech-bubble {
  visibility: visible;
  opacity: 1;
}

/* Output */
#output {
  background: #333;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 20px;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-top: 20px;
  cursor: pointer;
  font-size: 14px;
}

/* Copied Animation */
#output.copied {
  background: #2a2a2a;
}

#notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #66bb6a, #43a047); /* A pleasant green gradient */
  color: #fff;
  padding: 15px 25px;
  border-radius: 8px;
  display: none;
  z-index: 1000;
  font-size: 15px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: opacity 0.6s ease;
}

#notification a {
  color: #e0f2f1;  /* A light accent that stands out on the green background */
  text-decoration: underline;
}

#notification a:hover {
  color: #b2dfdb;
}

.header-text-container {
  display: inline-block;
  text-align: left;
}

.header-subtext {
  display: block;
  font-size: 14px; /* Adjust size as needed */
  font-weight: 300;
  color: #d0d0d0; /* Lighter shade than the main header */
  margin-top: 5px; /* Space between the main text and subtext */
  max-width: 100%; /* Ensures it doesn't exceed the width of the header content */
}

/* Additional spacing for Generated JSON heading */
.container > h2 {
  margin-top: 30px;
  margin-bottom: 10px;
}

/* make the “Generate Color” label sit beneath the picker */
.color-picker-wrapper {
  position: relative;
  display: inline-block;
}

/* invisible full-size picker overlay */
#colorPicker {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0; margin: 0;
}

/* force the label text white */
label.color-link {
  color: #fff !important;
}

