/* Hair Color Studio — light dashboard theme */

:root {
  --bg: #f8f9fa;
  --card: #ffffff;
  --border: #e2e2e8;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --placeholder: #999999;
  --muted: #666666;
  --accent: #7c3aed;
  --accent-2: #db2777;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

label { color: var(--text); }

.hint { color: var(--text-secondary); font-weight: 400; font-size: .82rem; }

::placeholder { color: var(--placeholder); opacity: 1; }

input[type="text"], input[type="number"] { color: var(--text); }

details.advanced summary { color: var(--text); }

.sidebar .nav-item { color: #2d2d2d; }
.sidebar .nav-item.active { color: #1a1a1a; }

.hero {
  padding: 2rem 1.5rem 1rem;
  text-align: center;
  background: transparent;
}

.hero h1 { margin: 0 0 .3rem; font-size: 1.9rem; }
.hero p { margin: 0; color: var(--muted); }

main {
  flex: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}

.card h2 { margin-top: 0; }

label {
  display: block;
  margin: .9rem 0 .25rem;
  font-weight: 600;
  font-size: .92rem;
}


input[type="text"],
input[type="file"],
input[type="number"],
select {
  width: 100%;
  padding: .55rem .7rem;
  background: #12121a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
}

input[type="color"] {
  width: 100%;
  height: 2.6rem;
  padding: .2rem;
  background: #12121a;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1rem 0;
  padding: .75rem 1rem;
}

legend { padding: 0 .4rem; color: var(--muted); font-size: .85rem; }

label.radio {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .4rem 0;
  font-weight: 400;
}

button {
  width: 100%;
  margin-top: 1.2rem;
  padding: .8rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter .15s ease;
}

button:hover { filter: brightness(1.15); }

.swatches { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .35rem; }

.swatch {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: inline-block;
}

.dot {
  width: .9rem;
  height: .9rem;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid var(--border);
}

.dot.big { width: 1.6rem; height: 1.6rem; vertical-align: middle; }

.flashes { max-width: 560px; margin: 0 auto 1rem; }

.flash {
  background: #3a1d1d;
  border: 1px solid #6b2a2a;
  color: #ffd9d9;
  padding: .6rem .9rem;
  border-radius: 8px;
  margin-bottom: .4rem;
  font-size: .92rem;
}

/* Result page */

.meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  justify-content: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

figure { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

figure img { width: 100%; display: block; }

figcaption {
  padding: .6rem .8rem;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}

.back {
  display: inline-block;
  margin: 1.4rem 0 2rem;
  color: var(--accent-2);
  text-decoration: none;
}

.back:hover { text-decoration: underline; }

/* History strip */

.history h2 { font-size: 1.2rem; }

.runs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .8rem;
}

.run-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.run-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }

.run-meta {
  padding: .5rem .6rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  font-size: .8rem;
}

.run-meta .dot { width: .7rem; height: .7rem; }

footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
}

/* Segmented style control */
.segmented {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.seg-option {
  flex: 1;
  text-align: center;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.seg-option + .seg-option { border-left: 1px solid var(--border); }
.seg-option:has(input:checked) {
  background: #7c3aed;
  color: #fff;
  font-weight: 600;
}
.seg-option input { position: absolute; opacity: 0; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  margin: 1rem 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragging {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  outline: none;
}
.dropzone p { margin: 0.4rem 0 0; }

/* Advanced accordion */
.advanced summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.advanced[open] summary { margin-bottom: 1rem; }

/* Recolor button */
.recolor-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.recolor-btn:hover {
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
}

/* Download button: white text on accent background */
#download-btn {
  color: #ffffff;
  font-weight: 600;
}

/* Sound toggle */
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .recolor-btn, .seg-option, .dropzone { transition: none; }
}

/* Compact studio dashboard */
.hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.hero-bar h1 { margin: 0; }
.hero-bar p { margin: 0.25rem 0 0; }

.controls-card {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 1.5rem;
}

.controls-card label { font-size: 0.85rem; }

.controls-card input[type="text"],
.controls-card input[type="number"] {
  height: 40px;
}

.controls-card .segmented { height: 40px; margin: 1rem 0; }

.dropzone {
  padding: 0.75rem;
  margin: 0.9rem 0;
}
.dropzone svg { width: 24px; height: 24px; }
.dropzone p { margin: 0.15rem 0; font-size: 0.85rem; }

.recolor-btn {
  padding: 0;
  height: 48px;
  margin-top: 0.75rem;
}

.advanced input[type="number"] { margin-bottom: 0.5rem; }
