﻿@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@700&display=swap");

:root {
  --bg: #121319;
  --bg-soft: #1a1e27;
  --panel: #202634;
  --line: #2f3748;
  --text: #ecf0ff;
  --muted: #aeb6c9;
  --accent: #47b883;
  --accent-2: #2f8a63;
  --danger: #b84343;
  --danger-2: #943232;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, #273047 0%, transparent 35%),
    radial-gradient(circle at 85% 15%, #273d31 0%, transparent 30%),
    linear-gradient(170deg, #0f1218, #151b25 45%, #0e1117);
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: "Space Grotesk", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 16px 36px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  align-items: stretch;
}

.output-panel {
  margin-top: 14px;
  position: static;
  align-self: stretch;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-family: "Space Grotesk", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  letter-spacing: 0.01em;
  background: linear-gradient(
    90deg,
    #ff4d4d,
    #ff9f40,
    #ffe24d,
    #7dff4d,
    #4dfff3,
    #4d8dff,
    #b84dff,
    #ff4da6,
    #ff4d4d
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px #000;
  animation: rainbowShift 4s linear infinite;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: linear-gradient(165deg, #1e2431, #1a202b);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.grid {
  display: grid;
  gap: 10px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

input,
textarea,
button {
  font: inherit;
}

input[type="text"],
select,
textarea {
  width: 100%;
  border: 1px solid #3a465d;
  background: #0f141d;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}

.styles-wrap {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
}

.preview-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid #4a5873;
  background: #0f141d;
  position: relative;
}

.preview-toggle input:checked + .checkmark {
  border-color: #4fbe8b;
  background: #1f6247;
}

.preview-toggle input:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #d9ffe9;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.preview-toggle-compact {
  font-size: 0.8rem;
  font-weight: 500;
  gap: 6px;
}

.preview-toggle-compact .checkmark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.preview-toggle-compact input:checked + .checkmark::after {
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
}

.colors {
  display: grid;
  gap: 8px;
}

.color-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: center;
}

.picker {
  width: 52px;
  height: 34px;
  padding: 0;
  border: 1px solid #3a465d;
  border-radius: 8px;
  background: #0f141d;
}

.preview {
  min-height: 66px;
  border: 1px solid #364055;
  border-radius: 8px;
  padding: 12px;
  background: #0f141d;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.22rem;
  line-height: 1.6;
  word-break: break-word;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: pre-wrap;
}

.outputs {
  display: grid;
  gap: 10px;
}

.cmd-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 8px;
  align-items: stretch;
}

.cmd-row input[type="text"] {
  height: 42px;
}

.cmd-separator {
  height: 1px;
  margin-top: 10px;
  background: linear-gradient(90deg, transparent, #4fbe8b, #6b8cff, transparent);
  opacity: 0.75;
}

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

.btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
}

.btn.small {
  padding: 6px 9px;
  font-size: 0.84rem;
}

button[data-action="add-color"] {
  width: 66px;
}

.btn.square {
  width: 62px;
  height: 100%;
  padding: 0;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.btn.danger {
  background: linear-gradient(180deg, var(--danger), var(--danger-2));
}

.btn.danger-soft {
  background: linear-gradient(180deg, #5d2f2f, #4d2525);
}

#resetDefaults {
  font-weight: 700;
}

.status {
  min-height: 1.2em;
  color: #9bd3b8;
  margin: 8px 0 0;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .output-panel {
    position: static;
  }
}

@keyframes rainbowShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 300% 50%;
  }
}
