/* stroke-recorder.css - styles for the stroke recorder tool */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, sans-serif;
  background: #f8f7fc;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 3rem;
  gap: 1rem;
}

h1 {
  font-size: 1.1rem;
  color: #6d28d9;
  letter-spacing: 0.01em;
}

h1 .h1-sub {
  font-size: 0.85rem;
  font-weight: 400;
  color: #6b6591;
}

p.sub {
  font-size: 0.82rem;
  color: #6b6591;
  text-align: center;
  max-width: 560px;
}

code {
  background: #ede9f7;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ── Drop zone ── */

#drop-zone {
  border: 2px dashed #c4b5e8;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  background: white;
  width: 100%;
  max-width: 580px;
  transition: border-color 0.15s;
}

#drop-zone:hover,
#drop-zone.over {
  border-color: #6d28d9;
}

#drop-zone p {
  color: #6b6591;
  line-height: 1.7;
  font-size: 0.9rem;
}

#drop-zone.hidden {
  display: none;
}

/* ── Recorder panel ── */

#recorder {
  display: none;
  width: 100%;
  max-width: 580px;
}

#recorder.active {
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

#glyph-label {
  font-size: 0.85rem;
  color: #6b6591;
  text-align: center;
  flex: 1;
}

#glyph-label strong {
  color: #1a1a2e;
  font-size: 1rem;
}

.status-recorded {
  color: #059669;
  font-weight: 500;
}

.status-missing {
  color: #b45309;
  font-weight: 600;
}

#canvas-wrap {
  border: 1px solid #e0daf5;
  border-radius: 12px;
  background: white;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  overflow: hidden;
}

#canvas-wrap svg {
  display: block;
  width: 100%;
  max-height: 300px;
}

.hint {
  font-size: 0.78rem;
  color: #9d8ec7;
  text-align: center;
  margin-top: 0.4rem;
}

.controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

#stroke-count {
  font-size: 0.82rem;
  color: #6b6591;
  margin-left: auto;
}

/* ── Buttons ── */

button {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #c4b5e8;
  background: white;
  color: #1a1a2e;
  cursor: pointer;
  transition: background 0.1s;
}

button:hover:not(:disabled) {
  background: #f3f0fb;
}

button.primary {
  background: #6d28d9;
  color: white;
  border-color: #6d28d9;
}

button.primary:hover:not(:disabled) {
  background: #5b21b6;
}

button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ── Export area ── */

#export-area {
  width: 100%;
  max-width: 580px;
  display: none;
}

#export-area h2 {
  font-size: 0.9rem;
  color: #6d28d9;
  margin-bottom: 0.5rem;
}

#export-area p.sub {
  text-align: left;
  margin-bottom: 0.5rem;
}

textarea {
  width: 100%;
  height: 220px;
  font: 0.75rem/1.5 monospace;
  border: 1px solid #e0daf5;
  border-radius: 8px;
  padding: 0.75rem;
  resize: vertical;
  background: #f8f7fc;
  color: #1a1a2e;
}

.export-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ── Jump-to dropdown ── */

.nav-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

#glyph-select {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #c4b5e8;
  background: white;
  color: #1a1a2e;
  max-width: 220px;
  width: 100%;
  cursor: pointer;
}

/* ── Danger button (Remove) ── */

button.danger {
  color: #b91c1c;
  border-color: #fca5a5;
}

button.danger:hover:not(:disabled) {
  background: #fff1f2;
}

/* ── Eraser button ── */

button#eraser-btn.active {
  background: #fef2f2;
  border-color: #e53e3e;
  color: #e53e3e;
}

#canvas-wrap.eraser-active {
  cursor: cell !important;
  border-color: #fca5a5;
}

/* ── Add custom cluster row ── */

.add-cluster {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: center;
}

#add-input {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.32rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #c4b5e8;
  flex: 1;
  min-width: 0;
}

#add-input:focus {
  outline: 2px solid #6d28d9;
  border-color: transparent;
}

/* ── Merge section (export area) ── */

.merge-section {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #6b6591;
}

/* ── Load section (recorder panel) ── */

.load-section {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #6b6591;
}

#merge-status {
  font-size: 0.8rem;
  color: #059669;
  font-weight: 500;
}

/* ── Reduced-set filter row ── */

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  color: #6b6591;
  flex-wrap: wrap;
}

.filter-row label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

#filter-status {
  font-weight: 500;
  white-space: nowrap;
}
