/* Level Coefficients — Activation Function Visualizer */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.page-title {
  margin-top: 2em;
  margin-bottom: 0;
}

.section-hr {
  border: none;
  border-top: 2px solid #ccc;
  margin-top: 1.2em;
  margin-bottom: 0.3em;
}

.section-label {
  font-size: 12px;
  color: #888;
  letter-spacing: 1px;
  margin-top: 0;
  margin-bottom: 0.7em;
}

/* Add-function row */
.add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.add-label {
  font-size: 1.15em;
  white-space: nowrap;
  color: #333;
  min-width: max-content;
}

.func-input {
  flex: 1;
  max-width: 400px;
  font-size: 0.97em;
  font-family: Monaco, Consolas, "Courier New", monospace;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s;
}
.func-input:focus { border-color: #888; }
.func-input.error { border-color: #c00; }

.parse-error {
  font-size: 0.85em;
  color: #c00;
  min-height: 1.3em;
  font-family: Monaco, Consolas, "Courier New", monospace;
  margin-bottom: 4px;
}

/* Function pill list (horizontal wrapping row) */
.fn-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1em;
  min-height: 36px;
  align-items: center;
}

.fn-list-empty {
  font-size: 0.88em;
  color: #aaa;
  font-style: italic;
  margin-bottom: 1em;
}

.fn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1.5px solid #ddd;
  background: #fafafa;
  font-size: 0.9em;
  font-family: Monaco, Consolas, "Courier New", monospace;
  white-space: nowrap;
}

.fn-pill-swatch {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.fn-pill-label {
  color: #222;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fn-pill-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 0.9em;
  padding: 1px 2px;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.fn-pill-btn:hover { color: #333; background: #eee; }
.fn-pill-btn.delete-btn:hover { color: #c00; background: #fee; }

/* Edit-in-place input inside pill */
.fn-pill-edit {
  font-size: 0.97em;
  font-family: Monaco, Consolas, "Courier New", monospace;
  padding: 1px 6px;
  border: 1px solid #aaa;
  border-radius: 3px;
  outline: none;
  width: 160px;
}
.fn-pill-edit.error { border-color: #c00; }

/* Two plots side by side */
.plots-row {
  display: flex;
  gap: 20px;
}

.plot-cell {
  position: relative;
  flex: 1;
  min-width: 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: #fff;
  padding: 28px 14px 14px 14px;
  height: 380px;
  box-sizing: border-box;
}

.plot-title {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.05em;
  color: #555;
  pointer-events: none;
}

.plot-cell canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Gear button */
.plot-gear {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  background: rgba(255,255,255,0.85);
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  color: #555;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}
.plot-cell:hover > .plot-gear { opacity: 1; }
.plot-gear:hover { background: #fff; border-color: #999; color: #222; }

/* Gear popup menu */
.gear-menu {
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1000;
  min-width: 140px;
  font-size: 0.88em;
}
.gear-menu-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  white-space: nowrap;
}
.gear-menu-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: 100%;
  padding: 2px 3px;
  border-radius: 3px;
}
.gear-menu-row label:hover { background: #f4f4f4; }
.gear-menu-sep {
  border: none;
  border-top: 1px solid #eee;
  margin: 4px 0;
}
.gear-menu-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  white-space: nowrap;
  color: #333;
}
.gear-menu-select-row span { min-width: 60px; }
.gear-menu-select-row select {
  font-size: 0.92em;
  padding: 1px 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

/* Restore defaults button */
.restore-btn {
  font-size: 11px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  letter-spacing: 0.3px;
}
.restore-btn:hover { color: #555; }

/* Buttons */
.sim-button {
  padding: 7px 18px;
  font-size: 14px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}
.sim-button:hover  { background-color: #e0e0e0; }
.sim-button:active { background-color: #d0d0d0; }

input[type="range"] { accent-color: #555; cursor: pointer; }

/* Selected pill */
.fn-pill-selected {
  border-color: #888;
  background: #f0f0f0;
}

/* Method legend inside coeffs plot */
.coeffs-method-legend {
  position: absolute;
  bottom: 22px;
  right: 16px;
  display: flex;
  gap: 10px;
  font-size: 0.78em;
  color: #888;
  font-family: Monaco, Consolas, "Courier New", monospace;
  pointer-events: none;
}
.method-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Coefficient detail panel */
.coeff-detail {
  margin-top: 1.2em;
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
}

.coeff-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: #f7f7f7;
  border-bottom: 1px solid #ddd;
  font-size: 0.92em;
  font-family: Monaco, Consolas, "Courier New", monospace;
  font-weight: 600;
}

.coeff-detail-pre {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.88em;
  font-family: Monaco, Consolas, "Courier New", monospace;
  line-height: 1.7;
  color: #333;
  background: #fff;
  white-space: pre;
  overflow-x: auto;
  user-select: text;
}
