/* Match screenplay page layout exactly */
.lined-script-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}


.lined-tools .btn {
  min-width: 80px;
}

.lined-overlay line {
  pointer-events: stroke;
}

.lined-overlay line:hover {
  stroke-width: 4;
}

/* Lined Script Line States */

.lined-overlay line {
  pointer-events: stroke;
  stroke-linecap: round;
}

.line-drawing {
  stroke: #e74c3c;
  stroke-width: 4;
}

.line-normal {
  stroke: #3498db;
}

.line-selected {
  stroke: #2ecc71;
}

.line-armed {
  stroke: #e74c3c;
  stroke-dasharray: 4 2;
}

/* Snap toggle polish */
.snap-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  opacity: 0.85;
}
/* Ensure overlay is always above the screenplay text */
.lined-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: all;
}

/* Prevent text selection in the lined script tool */
.lined-script-page,
.lined-script-page * {
  -webkit-user-select: none;
  user-select: none;
}

/* But allow inputs to still be selectable/typable if you add any later */
.lined-script-page input,
.lined-script-page textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Make sure the line strokes capture input reliably */
.lined-overlay line {
  pointer-events: stroke;
  stroke-linecap: round;
}

.lined-overlay {
  touch-action: none;
}


/* ============================= */
/* Lina-style Toggle Switch */
/* ============================= */

.snap-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  opacity: 0.9;
}

/* Label text */
.snap-label {
  user-select: none;
}

/* Toggle container */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  margin-right: 2vw;
  display: inline-block;
}

/* Hide native checkbox */
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Track */
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #3a3a3a; /* Lina dark UI neutral */
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

/* Knob */
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  background-color: #e5e5e5;
  border-radius: 50%;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

/* ON state */
.toggle-switch input:checked + .toggle-slider {
  background-color: #a36a2a; /* Lina accent blue */
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background-color: #ffffff;
}

/* Hover polish */
.toggle-switch:hover .toggle-slider {
  filter: brightness(1.1);
}

/* ===============================
   LINED SCRIPT — SQUIGGLES
   =============================== */

.lined-squiggle {
  fill: none;
  stroke: #000;
  stroke-width: 2.2px;
  stroke-linecap: round;
  pointer-events: stroke;
}

/* Tool cursor hints */
.lined-canvas[data-tool="squiggle"] {
  cursor: crosshair;
}

.lined-canvas[data-tool="eraser"] {
  cursor: cell;
}

/* ===============================
   Tool Buttons (Icons)
   =============================== */

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 32px;
  padding: 0;
}

.tool-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===============================
   Tool Cursors (Lined Script)
   =============================== */

.lined-canvas[data-tool="line"] .screenplay-paper {
  cursor: copy;
}

.lined-canvas[data-tool="squiggle"] .screenplay-paper {
  cursor: row-resize;
}

.lined-canvas[data-tool="eraser"] .screenplay-paper {
  cursor: vertical-text;
}

.lined-canvas[data-tool="squiggle"] .lined-overlay:hover,
.lined-canvas[data-tool="eraser"] .lined-overlay:hover {
  cursor: inherit;
}

.snap-toggle,
.scene-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  opacity: 0.9;
}


.scene-number {
  font-weight: bold;
  font-size: 16px;
  line-height: 12pt;
  position: absolute;
  left: 1in;
  font-family: "Courier Prime", "Courier New", Courier, monospace;
  opacity: 0.75;
  user-select: none;
  pointer-events: none;
}

.screenplay-header-right {
  display: flex;
  align-items: center;
}

#zoomLabel {
  display: flex;
  align-items: center;
  height: 32px;
  line-height: 1;
}

.scene-jump-container {
  flex: 1;
  display: flex;
  justify-content: center;
}

.scene-jump-select {
  min-width: 280px;
  max-width: 420px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #1f1f1f;
  color: #fff;
}
