/* The min-height/width is for flex box wierdness, in which
   (say) horizontal scrolling doesn't work properly until you give a min-width: 0;*/
* { box-sizing: border-box; min-height: 0; min-width: 0; }
a, a:visited { color: blue; text-decoration: none; }
a:hover { color: #6666dd;  text-decoration: underline; }
html, body { font-family: arial; margin: 0; padding: 0; width: 100%; height: 100%; font-size: 11pt;
	overflow: auto; /*Prevents margin collapsing*/ }
th { text-align: left; }

h1 { padding-left: 18px; }
h2 { margin-bottom: 0.5em; font-size: 20px; }
h3 { margin-bottom: 0.2em; }
h2:first-child { margin-top: 0; }
h3:first-child { margin-top: 0; }

ul { margin: 4px 0; }

ul.frontMenu { margin: 0; padding: 0; }
ul.frontMenu li { list-style-type: none; margin: 0 10px; padding: 0; display: inline-block; }
ul.frontMenu a { display: inline-flex; align-items: center; justify-content: space-around; padding: 10px; width: 100px; background: rgb(91, 155, 213);
	text-decoration: none; text-align: center; height: 60px; vertical-align: top;
	color: white; border-radius: 5px; box-shadow: 3px 3px 3px #ccc; }
	
/* List separators are a general concept, but I fear it will be forgotten this exists. */
li.sep { list-style-type: none; margin: 0.5em 0; border-top: solid 1px #ccc; }

.main { display: flex; flex-direction: column; align-self: stretch; width: 100%; height: 100%; }
.main .appToolbar { padding: 8px 20px 0 0px; margin-left: -7px; }
.main > .content { flex: 1; min-height: 0; max-height: 100%; display: flex; flex-direction: column; }

.trail li { display: inline-block; }
.trail li::after { content: ">"; margin: 0 10px; }
.trail li:last-child::after { display: none; }
.trail a { display: inline-block; }
.trail a::after { content: ">"; display: inline-block; color: black; margin-left: 0.5em; }
.trail a:last-child { color: black; }
.trail a:last-child::after { display: none; }

.officialIcon { min-width: 14px; height: 14px; display: inline-block; background-size: 12px; background-position: 0 2px; background-repeat: no-repeat; }
.officialIcon.official { background-image: url(/_/images/official.png); }
.officialIcon.unofficial { background-image: url(/_/images/unofficial.png); }
button .officialIcon::after { display: inline-block; margin-left: 16px; }
button .officialIcon.unofficial::after { content: "Mark all official"; }
button .officialIcon.official::after { content: "Mark all unofficial"; }

/*.runStatus { font-size: 10pt; }*/
.runStatus th { text-align: left; }
.runStatus td, .runStatus th { padding-right: 1em; max-width: 300px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

.pageBody { width: 100%; height: 100%; padding: 20px; overflow: auto; }
.frontPage { width: 100%; height: 100%; display: flex; flex-direction: column; flex-wrap: wrap;
  padding: 20px; }
.frontPage > section { width: 48.5%; height: 48.5%; overflow: auto; border: solid 1px #ccc; margin-bottom: 0; }
.frontPage > .recentRuns { margin-bottom: 1.5%; }
section.pathways { height: 100%; overflow: auto; margin-right: 1.5% }
section { padding: 7px; }

section.pathways ul { margin-left: 0; padding-left: 1em; }
section.pathways li { list-style-type: none; margin-left: 0; padding-left: 0; }

section h2:first-child { margin-top: 0; margin-bottom: 2px; }

.panel { border: solid 1px #ccc; box-shadow: 1px 1px 2px #ddd6; padding: 5px 10px; }
.contentPanel { padding: 20px; }
/* sidePanel and mainPanel go together */
.sidePanel { width: 230px; padding: 5px }
.mainPanel { overflow: auto; position: relative; }

.sidePanel.run { position: absolute; z-index: 5; }
.mapPanel { width: 100%; height: 100%; overflow: auto; padding: 0px; }
.runPage { width: 100%; height: 100%; display: flex; flex-direction: column; flex: 1; }
.runMain { flex: 1; display: flex; }
.runMain .mainPanel { flex: 1; border: solid 1px #ccc; border-bottom: 0; border-right: 0; }

.currentRunInfo { margin: 0 20px; }
.consoleOutputParent { flex: 1; padding: 4%; position: relative; }
.consoleOutput { white-space: pre-wrap; font-family: courier; overflow: auto;
	width: 100%; height: 90%; border: solid 1px #ccc; }

.pathwayPage { display: flex; flex-direction: column; height: 100%; padding: 20px; flex: 1; }
.pathwayPage .toolbar { margin-bottom: 10px; }
.pathwayPage .tabSet { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pathwayPage .tabSheets { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pathwayPage .tabSheet { flex: 1; overflow: auto; }

.customCombo { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0 20px 20px 20px; }
.customCombo .pathwayOverview { border: solid 1px #ccc; }
.pathwayPage .pathwayOverview, .customCombo .pathwayOverview { display: flex; height: 100%; }
.pathwayPage .pathwayOverview .mainPanel, .customCombo .pathwayOverview .mainPanel { flex: 1; position: relative; max-height: 100%; overflow: auto; border-left: solid 1px #ccc; }


.resultsPanel { width: 100%; height: 100%; overflow: hidden; }
.mapControls { position: absolute; z-index: 20; }
.mapControls > * { display: inline-block; vertical-align: middle; }
.mapViewParent { width: 100%; height: 100%; overflow: hidden; }
.mapView { transform-origin: 0 0; cursor: grab; position: relative; }

.scale { background: linear-gradient(red, white); height: 200px;
	width: 10px; border: solid 1px #ccc; position: relative; position: absolute;
	top: 35px; left: 15px; }
.scaleMark { font-size: 8pt; position: absolute;
	left: calc(100% + 0.3em); }
.scaleLabel { font-size: 8pt; position: absolute; top: calc(100% + 1em);
	left: -1.2em; }

.runMain > .sidePanel { display: flex; flex-direction: column; }
.runMain > .sidePanel .pathwaysBox { overflow: auto; }
.runMain > .sidePanel .runBox { min-height: auto; }
.runMain > .sidePanel .extraRunInfo { min-height: auto; }

.sidePanel .selected { font-weight: bold; background: #ccf; }

/** Dialogs **/
.dialog { background: rgb(255,255,255); background: rgba(255,255,255,0.95);
	border: solid 1px black; box-shadow: 2px 2px 2px #888; padding: 1.2em; min-width: 150px;
	max-width: 80vw; }
.dialog.page { width: 80%; height: 70%; }
.dialog h2 { margin: 0; margin-bottom: 8px; }
.dialog .controls { margin-top: 8px; text-align: right; display: block; }
.veil { position: fixed; z-index: 1000; background: rgba(255,255,255,0.7); opacity: 0; top: 0; left: 0;
	display: flex; width: 100vw; height: 100vh; justify-content: center; align-items: center;
	transition: opacity 0.3s; }
	
.hide {display: none}
	
.scenarios .isBase td:first-child::after { content: "(base scenario)"; margin-left: 1em; }

/** Simple handler for editing isolated fields (like names/titles) **/
*[data-field-edit] .value { border: solid 1px transparent; }
*[data-field-edit] .value:hover { border: solid 1px #ccc; }
*[data-field-edit] .value:focus { border: solid 1px #ccc; }

.content { padding: 10px 20px 20px 30px; }
.controls { margin-bottom: 1em; }
.controls button { font-size: 1.1em; margin-left: 0.3em; }
.controls button:first-of-type { margin-left: 0; }
.projects + .controls, .scenarios + .controls { margin-top: 1em; }
.projects > div, .scenarios > div, .controls { margin: 4px 0; font-size: 1.1em; }

.projects { display: grid; grid-template-rows: auto 1fr auto;  }
.mainPage > .projects { padding-right: 0; }
.projectsList {display: grid;grid-template-columns: max-content auto;grid-gap: 5px;align-self: start;overflow: auto;max-height: 100%;}
.projectsList .project { display: contents; }
.projects .runStatus { margin-left: 1em; font-size: 90%; vertical-align: middle; color: #777; }

.scenariosPanel { border: solid 1px #ccc; padding: 10px; flex: 1; display: flex; flex-direction: column; }
.scenariosPanel .scenarios { flex: 1; }
.scenarioList { display: grid; grid-template-columns: minmax(15em, max-content) max-content max-content; grid-gap: 5px; }
.scenario { display: contents; }
.scenario .name { padding-right: 1em; }
.scenario.isBase .name::after { content: " (Base)"; color: #777; }
.scenario .status { color: #777; }


.items { display: grid; grid-template-rows: auto 1fr auto;  }

.config { border: solid 1px #ccc; padding: 10px; flex: 1; display: flex; flex-direction: column; }
.config .settingsPanel { flex: 1; }

.spreadsheet { border-collapse: collapse; margin: 5px; flex: 1; }
.spreadsheet tr:first-child td { background: #eee; }
.spreadsheet td { border: solid 1px #ccc; padding: 3px; }

.spreadsheet *[data-diff] { background: #99f; }
.spreadsheet .error { background: rgb(255,128,128); }

.floatingGraph { position: absolute; z-index: 20; background: white; border: solid 1px #aaa; box-shadow: 2px 2px 2px #7777;
	padding: 4px 2px 2px 2px; }
.floatingGraph canvas { width: 400px; height: 300px; }

form.grid { display: grid; grid-template-columns: minmax(10em,max-content) max-content; grid-gap: 5px 5px; }
form.grid .field { display: contents; }


.mainPage { display: grid; grid-template-columns: 1fr; grid-gap: 1em; flex: 1; }
.mainPage > * { border: solid 1px #ccc; box-shadow: 1px 1px 2px #ddd6;
  padding: 5px 10px; }

  
.scenariosPage { display: grid; grid-template-columns: 2fr 1fr; grid-gap: 1em; flex: 1; }

.notes { display: grid; grid-template-rows: 1fr auto; }
.notes .text { width: 100%; height: 100%;}

.outputPanels { display: grid; grid-template-columns: 230px 1fr; border: solid 1px #ccc; flex: 1; }
.outputPanels .sideBar { padding: 5px; border-right: solid 1px #ccc;}
.sideBar section { padding: 0; }
.sideBar section + section { margin-top: 1em; }

.resultsPanel { width: 100%; height: 100%; overflow: hidden; position: relative; }
.mapControls { position: absolute; z-index: 20; vertical-align: middle; }
.mapViewParent { width: 100%; height: 100%; overflow: hidden; }
.mapControls.bottom { bottom: 0; }
.mapView { transform-origin: 0 0; cursor: grab; position: relative; }

/** If changing these parameters, also change colorPolys in _server.py **/
.scale { background: linear-gradient(hsl(0,100%,50%), hsl(40,100%,50%) 45%, hsl(40,100%,100%)); height: 200px;
	width: 10px; border: solid 1px #ccc; position: relative; position: absolute;
	top: 35px; left: 15px; }
.diffScale { background: linear-gradient(rgb(255,0,0), rgb(255,250,250) 50%, rgb(0,0,255)); height: 200px;
	width: 10px; border: solid 1px #ccc; position: relative; position: absolute;
	top: 35px; left: 15px; }
	
.scaleMark { font-size: 8pt; position: absolute;
	left: calc(100% + 0.3em); }
.scaleLabel { font-size: 8pt; position: absolute; top: calc(100% + 1em);
	left: -1.2em; }
	
.main .graph { display: grid; grid-template-rows: auto auto 1fr; height: 100%; }
.graphControls { margin-bottom: 8px; }
.graph .location { padding: 5px; }
.graph .location input { font-size: inherit; border: solid 1px transparent; width: 30em; }
.graph .location input:hover, .graph .location input:focus { border: solid 1px black; }

.main.scrollable { overflow:auto; }

ul.displayValues { list-style-type: none; margin-left: 0; padding-left: 0; }
ul.displayValues li { margin-left: 0; padding-left: 0; }
ul.displayValues ul { list-style-type: none; margin-left: 1.3em; padding-left: 0; }
ul.nestedSelections input[type=checkbox].mixed { opacity: 0.5; }

.dateSlider { width: 500px; font-size: 8pt; --months: 12; }
.dateSlider [type="range"] { width: calc(100% - 1/var(--months)*100%*0.5); margin: 0 calc(1/var(--months)*100%/2*0.5); }
.dateSlider datalist { display: block; margin-top: -2px; }
.dateSlider datalist option { display: inline-block; width: calc(1/var(--months)*100%); overflow: hidden;
	text-align: center; }
.dateSlider .selected { font-weight: bold; background: rgb(0,128,255); color: white; border-radius: 3px; }




/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
  //border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
 
  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 21;
  
  top: -100%;
  left: 105%;
}

/* .tooltip .tooltiptext {
  width: 120px;
  top: 100%;
  left: 50%;
  margin-left: -60px; /* Use half of the width (120/2 = 60), to center the tooltip */
/*}

/*.tooltip .tooltiptext {
  top: -100%;
  left: 105%;
}*/


/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
}