@import url("./theme_tonelab_tokens.css");
@import url("./theme_profile.css");

/* ==========================================================
   LUTHERIELAB DARK THEME (Color-blind safe • Okabe & Ito)
   ========================================================== */
/* ==========================================================
   BASE ELEMENTS
   ========================================================== */
* { box-sizing: border-box; }

body {
  position: relative;
  margin: 0;
  font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
  background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--tl-canvas-blue, var(--blue)) 16%, transparent), transparent 35%),
    radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--tl-canvas-gold, var(--orange)) 16%, transparent), transparent 32%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -12%;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background:
    radial-gradient(circle at 25% 14%, var(--atmo-nebula-blue), transparent 48%),
    radial-gradient(circle at 52% 46%, var(--atmo-nebula-gold), transparent 44%),
    radial-gradient(circle at 76% 30%, var(--atmo-nebula-cyan), transparent 46%);
  filter: blur(24px);
}

body::after {
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tl-canvas-blue, var(--blue)) 18%, transparent), transparent 48%),
    radial-gradient(circle at 49% 52%, color-mix(in srgb, var(--tl-canvas-gold, var(--orange)) 13%, transparent), transparent 40%),
    radial-gradient(circle at 73% 56%, color-mix(in srgb, var(--tl-canvas-green, var(--green)) 10%, transparent), transparent 38%);
  filter: blur(40px);
}

/* ---------- Header ---------- */
header {
  padding: 14px 18px;
  border-bottom: 1px solid #1c2130;
  background: var(--panel);
}
header h1 {
  margin: 0 0 6px 0;
  font-size: 17px;
  letter-spacing: 0.2px;
}
header .muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* ---------- Grid layout ---------- */
main {
  display: grid;
  gap: 16px;
  padding: 16px;
  grid-template-columns: 360px 1fr;
}
@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
}

/* ---------- Card panels ---------- */
.card {
  background: var(--panel);
  border: 1px solid #1c2230;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}
.card:hover { background: var(--panel-hover); }

.pad { padding: 14px; }

/* ==========================================================
   TYPOGRAPHY
   ========================================================== */
h3.section {
  border-bottom: 1px solid #222a3a;
  padding-bottom: 6px;
  margin: 14px 0 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
label { color: var(--muted); }
.val {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ==========================================================
   CONTROLS
   ========================================================== */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
}
input[type=range] {
  width: 100%;
  cursor: pointer;
}
select,
input[type="range"]#model_order {
  width: 100%;
}

button {
  border: 1px solid #2a3245;
  background: var(--panel-hover);
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}
button:hover {
  background: var(--orange);
  color: #000;
}
button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ==========================================================
   CANVAS + LEGEND
   ========================================================== */
canvas {
  display: block;
  width: 100%;
  height: 440px;
  background: #0b0f16;
  border-radius: var(--radius);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 12px;
  color: var(--muted);
  align-items: center;
  font-size: 16px;
}
.legend > div {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.sw {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 6px;
}
.sw.total  { background: var(--orange); }
.sw.top    { background: var(--blue); }
.sw.back   { background: var(--green); }
.sw.air    { background: var(--purple); }
.sw.sides  { background: var(--yellow); }
.sw.dipole { background: #fdae36; }
.sw.tripole{ background: #a855f7; }
.sw.muted  { opacity: 0.3; }
.sw.current { background: #61a8ff; }
.sw.whatif  { background: #ff9a5c; }

/* ==========================================================
   BADGES + PEAK LIST
   ========================================================== */
.badge {
  display: inline-block;
  background: #1f2636;
  border: 1px solid #2a3245;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}

#peak_list {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}
#peak_list .pl-item {
  margin: 0;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ==========================================================
   SCROLLBAR (optional polish)
   ========================================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}
.per-tab-session-reset-confirmation {
  position: fixed;
  z-index: 10000;
  top: 1rem;
  right: 1rem;
  max-width: min(24rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--accent, #e8a83a);
  border-radius: 0.5rem;
  background: var(--panel, #161b27);
  color: var(--text, #f5f7fa);
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 28%);
}

.per-tab-session-reset-confirmation p {
  margin: 0 0 0.65rem;
}

.per-tab-session-reset-confirmation button + button {
  margin-left: 0.5rem;
}
