:root {
  --leftwidth: 58px;
}

* {box-sizing: border-box;}
html, body { min-height: 100vh; }
html { overscroll-behavior: none; }
body {
  display: flex;
  margin: 0;
  font-family: Roboto, Noto, sans-serif;
  background-color: #efefef;
  overscroll-behavior-y: contain;
}
body.login { background-color: #393A38; color: white; }
/* center horiz and vert */
body.login .container {
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}
body.login button { padding: 12px 20px; }
body.test #left-pane, body.test #inventory-choice-div {
  background: repeating-linear-gradient(
    45deg,
    #393A38,
    #393A38 20px,
    #915252 20px,
    #915252 23px
  );
}

.hidden { display: none; }
.inactive { opacity: 0.4; }
.flex { display: flex; }
.btn { font-size: 110%; padding: 0.2em 1em; cursor: pointer; }
.bg-dark { background-color: #393A38; }
table.collapse { border-collapse: collapse; }

div#inventory-choice-div {
  position: absolute; left: 0; top: 0; min-height: 100vh; width: 100%;
  z-index: 1000;
  background-color: #393A38;
  text-align: center;
  padding-top: 15%;
  font-size: 200%;
  color: white;
}
div#inventory-choice-div button { font-size: 180%; padding: 0.1em 1em; }
div#inventory-choice-div input[type="radio"] { width: 2em; height: 2em; }
div#inventory-choice-div select { font-size: 100%; }

#main-wrapper { display: flex; flex-direction: column; min-height: 100vh; width: 100%; margin-left: var(--leftwidth); }
#main-container { display: flex; flex-grow: 4 }
#map-container { display: flex; flex-direction: column; }
#map-container.focused #undermap-div { display: block; }
#map-div { height: 100%; min-height: 340px; width: 100%; }
#undermap-div { display: none; padding: 0.6em; }
#infos-div { padding: 0.6em; }

@media all and (orientation:landscape) and (min-width:401px) {
   #main-container { flex-direction: row; }
   #map-container { flex-basis: 60%; flex-grow: 1; }
   #infos-div { flex-basis: 40%; flex-grow: 1; }
}

@media all and (orientation:portrait), (max-width:400px) {
   #main-container { flex-direction: column; }
}

body.force-landscape #main-container { flex-direction: row; }
body.force-landscape #map-container { flex-basis: 60%; flex-grow: 1; }
body.force-landscape #infos-div { flex-basis: 40%; flex-grow: 1; }

body.force-portrait #main-container { flex-direction: column; }

.icon-blue, .icon-orange, .icon-green, .icon-green-red {
  border: 1px solid #666;
  border-radius: 8px;
  opacity: 0.8;
}
div.icon-blue { background: #216AFF; }
div.icon-orange { background: #FFA500; }
div.icon-green { background: #2ABF2A; }
div.icon-green-red { background: #2ABF2A; border: 2px solid red; }

#left-pane { position: fixed; left: 0; top: 0; height: 100vh; width: var(--leftwidth); background-color: #393A38; }
#layer-icons { margin-top: 10px; text-align: center; line-height: 2em; }
#layer-icons img.pane-icon { cursor: pointer; }
#layer-icons #force-orient { background-color: #dedede; border-radius: 10px; padding: 4px; }
#pane-icons { position: absolute; bottom: 5px; left: 7px; text-align: center; }
#unsync-counter { font-size: 150%; font-weight: bold; margin-bottom: 5px; color: #bebebe; }
#unsync-counter.nonempty { color: red; }
#unsync_num_li { color: red; }
img.pane-icon { width: 3vw; min-width: 35px; }
img#sync-unsync { cursor: pointer; }

div#debug-pane {
  position: fixed;
  bottom: 0;
  height: 15%;
  font-size: 80%;
  width: 100%;
  background-color: white;
  z-index: 1001; /* 1000 is the initial screen */
  padding: 0.5em;
  overflow: scroll;
}
div#debug-buttons { position: fixed; right: 1.2em; }
img#debug-reload { width: 26px; opacity: 0.6; margin: 7px; cursor: pointer; }

#undermap-back { float: right; }
button#gemeinde-back img { height: 2.5em; width: 2.5em; }
#undermap-coords {
    display: grid;
    grid-template-columns: auto auto;
    grid-column-gap: 10px;
    margin-left: 0.5em;
}

#progress { position: absolute; left: 6vw; bottom: 10vw; width: 48vw; height: 2.5vw; border: 1px solid gray; z-index: 1000; opacity: 0.8; background-color: white; display: none;}

#inventory-title { font-size: 110%; font-weight: bold; }
#plot-creation { margin-top: 5em; text-align: center; }
#plot-creation button { font-size: 120%; padding: 0.5em 1em; }
#error { display: none; margin: 1em 0; padding: 1em 0.5em; color: red; border: 1px solid red; }
#infos-footer { display: flex; align-items: flex-end; flex-grow: 1; padding: 0.5em; font-size: 80%; color: #999; width: 100%; }
#infos-footer > div { width: 100%; text-align: right; z-index: 1001; }
#infos-footer > div > div { display: inline-block; }
#plot-data {
  display: grid;
  grid-template-columns: 1fr 3fr 1fr 3fr;
  width: 100%;
  border: 1px solid #aaa;
  margin: 0.5em 0;
  padding: 5px;
}
.label { font-weight: bold; padding-right: 5px; }
input[type=checkbox] { transform: scale(1.5); }

#obs-data { display: none; }
#obs-input { display: none; overflow-x: hidden; }
form#allsteps, form.input-form { display: none; }
#year-buttons { text-align: right; }
#year-buttons button { font-size: 18px; padding: 2px 4px; }
#obs-infos-trees { max-height: 70vh; overflow-y: scroll; }
#tree_list_container { max-height: 50vh; overflow-y: scroll; }
#tree_list_container thead th { position: sticky; top: 0; vertical-align: bottom; }
.olddiameter { display: none; } /* or table-cell if customized */

#step0 {
    display: none;
    text-align: center;
    margin-top: 20%;
}
#step0 p { font-size: 24px; }
#input-start, #input-end { font-size: 18px; }
div.cancel { float: right;  margin-top: 1em; }
div.weiter { text-align: center; margin-top: 1em; }
div.weiter button, div.cancel button { padding: 4px 3em; margin: 3px; vertical-align: bottom; }
div.weiter button.weiter img, div.cancel button.cancel img { height: 3em; }
div.weiter button.newtree img { height: 3em; width: 4em; }
span.bigplus { font-size: 250%; line-height: 0.8em; }
img.form-help { cursor: pointer; width: 1.2em; }
#allstepsselect { font-size: 22px; width: 100%; margin-bottom: 5px; }

table.form-table { }
.step1-input { font-size: 1.3em; margin: 0.5em 0 0.5em 3em; }
.step1-input label { padding: 2px 5px; }
#step1-verification #id_remarks { height: 4em; }
#step6 .form-table { width: 100%; }
.input-form input, .input-form textarea { font-size: 120%; max-width: 100%; }
.input-form select { font-size: 120%; max-width: 22rem; }
.input-form input[type="number"] { max-width: 5em; }
.input-form input#id_exact_long, .input-form input#id_exact_lat { max-width: 7em; }
.input-form th { text-align: left; vertical-align: top; padding-top: 0.4em; }
.input-form textarea { width: 100%; }
.input-form img.locked-input { height: 1.2em; width: 1.2em; }
.input-form div.radioselect > div { float: left; min-width: 24%; }
.input-form div.radioselect label {
    display: inline-block; padding: 0.4em; margin: 3px;
    border: 1px solid #aaa; border-radius: 0.8em;
    background: linear-gradient(rgb(224,224,224),rgb(200,200,200));
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    color: #444;
}
.input-form input[type="radio"]:checked + label {
    background: #396b9e linear-gradient(#5f9cc5, #396b9e) repeat scroll 0 0;
    color: white;
    font-weight: bold;
}
.dbh, .forest_edgef { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0.5em; }
.dbh input, .forest_edgef input { width: 3.5em; }

span.help-text { font-size: small; font-style: italic; }
.warning { color: red; }
#id_stand_devel_stage { width: 100%; }
table#regenobs-table thead th { text-align: center; }
table#regenobs-table tbody td { padding: 0.5em 0; text-align: center; }
table#regenobs-table select { font-size: 90%; max-width: 110px; }
form#steptree #id_remarks { height: 3em; }
form#steptree #id_vita { width: 100%; }
form#steptree #id_spec { max-width: 30rem; }
form#stepfinal { text-align: center; }
form#stepfinal:not(.ready) #ready-message { display: none; }

#trees_summary th { text-align: left; border: 1px solid #ccc; padding: 4px; }
#trees_summary td { border: 1px solid #ccc; padding: 4px; }
#trees_summary td:nth-child(1) { text-align: right; }
#trees_summary td.essence { text-align: right; }
#trees_summary td.diameter { text-align: right; }
#trees_summary td.diameter:empty { background-color: #ff6d6d; }
#trees_summary tbody tr:hover { cursor: pointer; background-color: #aaa; }
#trees_summary tr.new td { background-color: #c0ff73; }
#trees_summary td.delete { border: 0; display: none; }
#trees_summary tr.new td.delete { display: table-cell; background-color: transparent; }
#trees_summary tr.new td.delete img { height: 24px; cursor: pointer; }
#trees_summary tr.marked td:nth-child(1)::before { content: '*'; color: red; }

#currentLong, #currentLat, #currentAlt { display: inline-block; }
button#keepthis, button#btn-fixpunkt { margin: 0 0.5em; padding: 0.5em 1em; font-size: 100%; font-weight: bold; }
label[for="id_sealevel"] { white-space: nowrap; }
#fixpunkt-data th { text-align: right; font-style: italic; font-weight: normal; font-size: small; }

tr.separator { background-color: gray; height: 4px; }
#input-end { padding: 4px 3em; }

div.caliper {
  text-align: center;
  padding: 1em;
  font-size: small;
  font-style: italic;
}

button { font-family: Roboto, Noto, sans-serif; }
button:hover { cursor: pointer; }
button.current { font-weight: bold; }
button.new { color: red; }
button.editing { color: orange; }

#obs-infos-general-table { width: 100%; }
#obs-infos-general-table td, #obs-infos-trees-table td {
  vertical-align: top;
  padding: 2px;
}
#obs-infos-trees-table tr:hover { background-color: #ccc; cursor: pointer; }
#obs-infos-trees-table tr.current td {
  background-color: #EAC6C6;
}
#obs-infos-trees-table tr.marked td { background-color: #ffc0cb; }
#obs-infos-trees-table tr.genutzt { font-style: italic; opacity: 0.6; }
#obs-infos-trees-table tr.genutzt td.vita { color: red; }

ul.tabs {
  list-style: none;
  padding: 0;
  margin: 0.25em 0;
}
ul.tabs li {
  display: inline;
  padding: 5px;
  margin-right: 2px;
  background-color: #ccc;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}
ul.tabs li.active { font-weight: bold; }

ul.tabs li:hover {
  cursor: pointer;
}
div.tab-child {
  border: 1px solid gray;
  overflow: auto;
}

.leaflet-marker-icon {
  border: none;
  background: none;
}
.leaflet-marker-icon > * {
  position: absolute;
  left: 0;
  right: 0;
}
.leaflet-marker-icon.marked text {
  fill: red;
  font-weight: bold;
}
.icon-tree svg { height: 100%; width: 100%; }
.icon-tree.nonumber text { display: none; }
.icon-tree.highlight circle { stroke: rgb(255, 0, 0) !important; stroke-width: 8 !important; }

table.border { border-collapse: collapse; }
table.border td, table.border th { border: 1px solid black; padding: 4px; text-align: center; }
table.radius td:first-child { text-align: left; width: 40%; }

/* Modal styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.4);
}
.modal-content {
  background-color: #fefefe;
  margin: 15% auto; /* 15% from the top and centered */
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
}
.modal.narrow .modal-content {
  max-width: 100%;
  width: 500px;
}
#modal-confirm .message {
  padding: 0.3em;
  font-size: large;
}
#modal-confirm .buttons {
  padding: 0.3em;
  font-size: large;
  text-align: right;
}
#modal-confirm .buttons button {
  padding: 0.5em 1em;
  font-size: 100%;
  border: 0;
  border-radius: 8px;
}
#modal-confirm #confirm-ok, #modal-confirm #alert-ok { background-color: #4AC5FF; }
#modal-confirm #confirm-ok:hover, #modal-confirm #alert-ok:hover { background-color: #94D4F3; }
#modal-confirm #confirm-cancel:hover { background-color: #ddd; }

.close {
  color: #aaa;
  float: right;
  font-size: 34px;
  font-weight: bold;
  margin-top: -8px;
}
.close:hover, .close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}
#loading { text-align: center; font-size: large; }
