/* =========================================
   Template Editor — Visual Redesign
   ========================================= */

#template_page {
  position: absolute;
  background-color: #0d1117;
  height: 100%;
  overflow: auto;
}

/* ── Contenedor principal ── */
#stringTool {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #161b22;
  color: #c9d1d9;
  border: 1px solid #30363d !important;
  border-radius: 10px !important;
  padding: 1.25rem !important;
}

/* ── Bloques de sección ── */
#stringTool .border.rounded.p-2 {
  background: #0d1117;
  border: 1px solid #30363d !important;
  border-radius: 8px !important;
  padding: 0.9rem 1rem !important;
  transition: border-color 0.15s;
}

#stringTool .border.rounded.p-2:hover {
  border-color: #58a6ff !important;
}

/* ── Labels ── */
#stringTool label {
  color: #8b949e;
  font-size: 0.78rem;
  margin-right: 0;
  margin-bottom: 0.5rem;
}

#stringTool label.fw-bold {
  color: #e6edf3;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.55rem;
}

/* Label del file input */
#stringTool label[for="fileInput"] {
  color: #8b949e;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
  vertical-align: middle;
}

/* ── Inputs de texto ── */
#stringTool input.form-control,
#stringTool select.form-select {
  background: #161b22;
  border: 1px solid #30363d;
  color: #c9d1d9;
  border-radius: 6px;
  font-size: 0.83rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#stringTool input.form-control:focus,
#stringTool select.form-select:focus {
  background: #161b22;
  border-color: #58a6ff;
  color: #e6edf3;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

#stringTool input.form-control::placeholder {
  color: #484f58;
}

/* ── File input ── */
#stringTool input[type="file"].form-control {
  background: #161b22;
  border-color: #30363d;
  color: #8b949e;
  cursor: pointer;
  font-size: 0.8rem;
}

#stringTool input[type="file"].form-control::file-selector-button {
  background: #21262d;
  border: none;
  border-right: 1px solid #30363d;
  color: #c9d1d9;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

#stringTool input[type="file"].form-control::file-selector-button:hover {
  background: #30363d;
}

/* ── Select ── */
#stringTool select.form-select option {
  background: #161b22;
  color: #c9d1d9;
}

/* ── Botones ── */
#stringTool .btn {
  font-size: 0.82rem;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

#stringTool .btn:active {
  transform: scale(0.97);
}

#stringTool .btn-secondary {
  background: #21262d;
  border-color: #30363d;
  color: #c9d1d9;
}

#stringTool .btn-secondary:hover {
  background: #30363d;
  border-color: #8b949e;
  color: #e6edf3;
}

#stringTool .btn-primary {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
}

#stringTool .btn-primary:hover {
  background: #388bfd;
  border-color: #388bfd;
}

#stringTool .btn-success {
  background: #238636;
  border-color: #2ea043;
  color: #fff;
}

#stringTool .btn-success:hover {
  background: #2ea043;
  border-color: #3fb950;
}

/* ── Viewer — inputs de edición ── */
#stringTool .codeLine {
  background: #0d1117 !important;
  border: 1px solid #21262d !important;
  border-bottom: none !important;
  color: #c9d1d9 !important;
  font-family: 'Consolas', 'Fira Code', 'Courier New', monospace !important;
  font-size: 0.8rem !important;
  border-radius: 6px 6px 0 0 !important;
}

#stringTool .codeLine:focus {
  border-color: #58a6ff !important;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.1) !important;
  z-index: 1;
  position: relative;
}

/* ── Viewer — línea de preview de colores ── */
#stringTool .viewerLine {
  background: #010409 !important;
  border: 1px solid #21262d !important;
  border-top: 1px solid #30363d !important;
  color: #e6edf3 !important;
  font-family: 'Consolas', 'Fira Code', 'Courier New', monospace !important;
  font-size: 0.8rem !important;
  border-radius: 0 0 6px 6px !important;
  padding: 0.3rem 0.6rem !important;
  min-height: 1.8rem;
  white-space: pre-wrap;
}

/* ── Contenedor del viewer (lista de líneas) ── */
#viewer {
  border-top: 1px solid #30363d;
  padding-top: 0.85rem;
  margin-top: 0.5rem !important;
}

#viewer .mb-2 {
  margin-bottom: 0.6rem !important;
}

/* ── Separador de secciones ── */
#stringTool .mb-2 {
  margin-bottom: 0.6rem !important;
}

#stringTool .mt-2 {
  margin-top: 0.6rem !important;
}
