:root {
    --choice-color-dark: #333;
    --choice-color-light: #ddd;
    --choice-color-darker: #222;
    --choice-color-lighter: #eee;
    --choice-border-color: #666;
    --bg-color-dark: #333;
    --color-dark: #ddd;
    --bg-color-light: #ddd;
    --color-light: #333;
    --box-bg-dark: #444;
    --box-bg-light: #ccc;
    --light-blue: #4992ff;
    --tooltip-bg-dark: #334;
}

@font-face {
    font-family: 'Georama';
    font-style: normal;
    font-weight: 300;
    font-stretch: normal;
    src: url(assets/Georama.ttf) format('truetype');
}

body {
    background-color: var(--bg-color-dark);
    color: var(--color-dark);
    --choice-color: var(--choice-color-dark);
    --choice-color-stronger: var(--choice-color-darker);
    --choice-text-color: #aaa;
    --choice-hover-color: #4e4d43;
    --choice-hover-text-color: #aaa;
    --choice-active-color: #aaa;
    --choice-active-text-color: #333;
    font-family: 'Georama', sans-serif;
    margin: 0 20px 0 20px;
    padding: 0;
}

body.light {
    background-color: var(--bg-color-light);
    color: var(--color-light);
    --choice-color: var(--choice-color-light);
    --choice-color-stronger: var(--choice-color-lighter);
    --choice-text-color: var(--color-light);
    --choice-hover-color: #e0e0c3;
    --choice-hover-text-color: #333;
    --choice-active-color: #c06666;
    --choice-active-text-color: #222;
}

p {
    line-height: 1.5;
    font-size: 1.2rem;
}

.logo {
    background-image: url("../assets/iqib_logo_Darkmode.svg");
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    width: 110px;
    height: 25px;
    vertical-align: baseline;
}

body.light .logo {
    background-image: url("../assets/iqib_logo.svg ");
}

.flex-container {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
}

.flex-container-vertical {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
}

.flex-item {
    margin-right: 20px;
}

.flex-space-between {
    display: flex;
    justify-content: space-between;
}

.flex-start {
    display: flex;
    justify-content: start;
}

.box {
    border-radius: 10px;
    border: var(--color-dark) 1px solid;
    padding: 0 10px 10px 10px;
    margin: 0 10px 10px 0;
    width: 400px;
    height: 500px;
    background-color: var(--box-bg-dark);
    display: inline-block;
}

.high-box {
    height: 1350px;
}

.huge-box {
    width: 800px;
    height: 2050px;
}

.floating-box {
    position: absolute;
    cursor: move;
    top: 1100px;
    right: 10px;
}

.transparent-box {
    opacity: 0.5;
}

.screen-container {
    height: 997px;
    /* will be changed on window resize by JavaScript */
}

.screen {
    border-radius: 10px;
    border-color: var(--color-dark);
    border-width: 1px;
    border-style: solid;
    padding: 0 10px 20px 10px;
    height: 965px;
    /* will be changed on window resize by JavaScript */
    overflow-y: auto;
    background-color: var(--box-bg-dark);
    display: inline-block;
}

body.light .screen {
    border-color: var(--color-light);
    background-color: var(--box-bg-light);
}

.aside {
    width: 18%;
    padding-right: 10px;
    overflow-x: auto;
    overflow-y: auto;
}

.main {
    width: calc(82% - 20px);
    margin-left: 10px;
    margin-top: 20px;
    overflow-x: auto;
    overflow-y: auto;
}

/* Make h2 to h5 headings larger */
h2 {
    font-size: 1.7rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.3rem;
}

h5 {
    font-size: 1.1rem;
}

/* Better spacing around headings */
h2,
h3,
h4,
h5 {
    margin-top: 10px;
    margin-bottom: 10px;
}

.spacer {
    height: 2rem;
}

a {
    cursor: pointer;
    color: var(--light-blue);
    text-decoration: none;
}

a:hover {
    color: #0d6efd;
}

text {
    fill: var(--color-dark);
}

body.light text {
    fill: var(--color-light);
}

body.light .d3-legend text {
    fill: var(--color-dark);
}

.light-background svg text {
    fill: var(--color-light);
}

.pill-choice {
    fill: var(--choice-color);
    stroke: var(--choice-border-color);
    cursor: pointer;
}

.pill-choice+text {
    fill: var(--choice-text-color);
    pointer-events: none;
    /* so that the text does not break hover on rect */
    text-anchor: start;
    dominant-baseline: middle;
}

.pill-choice:hover {
    fill: var(--choice-hover-color);
}

.pill-choice:hover+text {
    fill: var(--choice-hover-text-color);
}

.pill-choice.active {
    fill: var(--choice-active-color);
}

.pill-choice.active+text {
    fill: var(--choice-active-text-color);
}

.pill-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
}

.pill-div {
    background-color: var(--choice-color);
    border-top: var(--choice-border-color) 4px solid;
    border-bottom: var(--choice-border-color) 4px solid;
    cursor: default;
    color: var(--choice-text-color);
    padding: 20px;
}

.pill-div:hover {
    background-color: var(--choice-hover-color);
    color: var(--choice-hover-text-color);
}

.pill-div-first {
    background-color: var(--choice-color-stronger);
    border-left: var(--choice-border-color) 4px solid;
    border-right: var(--choice-border-color) 4px solid;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.pill-div-last {
    border-right: var(--choice-border-color) 4px solid;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

.pill-table {
    cursor: default;
    color: var(--choice-text-color);
    border-spacing: 0;
}

.pill-table>tr:first-child>td:first-child {
    border-top-left-radius: 20px;
}

.pill-table>tr:first-child>td:last-child {
    border-top-right-radius: 20px;
}

.pill-table>tr:last-child>td:first-child {
    border-bottom-left-radius: 20px;
}

.pill-table>tr:last-child>td:last-child {
    border-bottom-right-radius: 20px;
}

.pill-table>tr>td {
    padding: 20px;
    margin: 0;
    background-color: var(--choice-color);
    border-right: 4px solid var(--choice-border-color);
    border-bottom: 4px solid var(--choice-border-color);
}

.pill-table>tr:first-child>td {
    border-top: 4px solid var(--choice-border-color);
}

.pill-table>tr>td:first-child {
    border-left: 4px solid var(--choice-border-color);
    background-color: var(--choice-color-stronger);
    font-weight: bold;
}

.pill-table>tr>td:hover {
    background-color: var(--choice-hover-color);
    color: var(--choice-hover-text-color);
}

.selector {
    display: flex;
    flex-direction: column;
    /* align-items: stretch; */
}

.selector>div {
    background-color: var(--choice-color);
    border-top: 4px solid var(--choice-border-color);
    border-left: 4px solid var(--choice-border-color);
    border-right: 4px solid var(--choice-border-color);
    color: var(--choice-text-color);
    cursor: pointer;
    padding: 10px;
    width: inherit;
    font-size: 1.2rem;
}

.selector>div:hover {
    background-color: var(--choice-hover-color);
    color: var(--choice-hover-text-color);
}

.selector>div:first-child {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.selector>div:last-child {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    border-bottom: 4px solid var(--choice-border-color);
}

.selector>div.active {
    background-color: var(--choice-active-color);
    color: var(--choice-active-text-color);
}

.slider-form {
    font: 12px var(--sans-serif);
    font-variant-numeric: tabular-nums;
    display: flex;
    height: 33px;
    align-items: center;
}

.slider-form>button {
    margin-right: 0.4em;
}

.slider-form>label {
    display: flex;
    align-items: center;
}

/* .slider-form > label > input {
    width: 180px;
} */

.land {
    /* fill: gray; */
    fill: #0000;
    /* transparent */
    stroke: #ccc;
    /* stroke-dasharray: 2,2; */
    stroke-linejoin: round;
}

.flood-point {
    fill: blue;
    /* stroke: #c00; */
    /* stroke-width: 2px; */
}

.grid {
    fill: #0000;
    /* transparent */
    stroke-width: 2px
}

.grid-green {
    stroke: #0e0;
}


.grid-extra {
    opacity: 0;
    stroke-width: 3px
}

.grid-red {
    stroke: #e00;
}


.grid-orange {
    stroke: #e70;
}

.grid-yellow {
    stroke: #ee0;
}

.gauge-text {
    fill: #ddd;
    font-size: 60px;
    text-anchor: end;
}

.tooltip {
    position: fixed;
    z-index: 1000;
    background-color: var(--tooltip-bg-dark);
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1.2rem;
}

#tooltip-icon-sources.tooltip {
    background-color: var(--box-bg-light);
    color: var(--color-light);
}

.tooltip-content {
    padding: 10px;
    margin-right: 15px;
    max-height: 550px;
    max-width: 800px;
    overflow-y: auto;
}

body.light .tooltip-content {
    color: var(--color-dark);
}

#tooltip-icon-sources>.tooltip-content {
    max-height: 500px;
}

.tooltip-content h4 {
    margin: 0;
}

.tooltip-content p {
    margin-top: 0;
    margin-bottom: 0;
}

.tooltip-content p.subsequent {
    margin-top: 10px;
}

.tabset>ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.tabset>ul>li {
    float: left;
}

.tabset>ul>li>a {
    display: block;
    text-align: center;
    padding: 10px 12px;
    margin: 0px 5px;
    text-decoration: none;
    background-color: var(--choice-color);
    border: var(--choice-border-color) solid;
    color: var(--choice-text-color);
    border-radius: 10px;
    user-select: none;
}

.tabset>ul>li>a:hover {
    background-color: var(--choice-hover-color);
    color: var(--choice-hover-text-color);
}

.tabset>ul>li>a.active {
    background-color: var(--choice-active-color);
    color: var(--choice-active-text-color);
}

.relative-container {
    position: relative;
}

.relative {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.invisible {
    transition:
        /* add 0.25s delay to visibility change so that it has time to fade out (opacity change) */
        visibility 0s linear 0.25s,
        opacity 0.25s linear;
    opacity: 0;
    /* need to change also visibility next to opaqueness so that user cannot interact with the element (e.g. via mouse click) */
    visibility: hidden;
}

.invisible-noblocking {
    height: 0;
    padding: 0;
    overflow: hidden;
    /* so that the element blocks no space in the UI */
}

.visible {
    transition:
        /* It shall become visible at once and fade in, so no delay here */
        visibility 0s linear,
        opacity 0.25s linear;
    opacity: 1;
    visibility: visible;
}

/******* Quarto documents ********/

.quarto-content {
    max-width: 800px;
}

.footnote-ref {
    text-decoration: none;
    color: #4992ff;
}

.footnote-back {
    text-decoration: underline;
    color: #4992ff;
}

.footnote-ref:hover,
.footnote-back:hover {
    color: #0d6efd;
}

.footnotes>ol>li,
.footnotes>ol>li>p {
    font-size: 1em;
}

/***********/
/* Leaflet */
/***********/

.map {
    height: 680px;
    max-width: 1400px;
    min-width: 700px;
}

.info {
    padding: 6px 8px;
    /* font: 14px/16px Arial, Helvetica, sans-serif; */
    background: white;
    background: rgba(255, 255, 255, 0.7);
    color: var(--choice-active-text-color);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.legend {
    line-height: 18px;
    color: #555;
}

.legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 8px;
}

/****************/
/* Icons        */
/****************/

.info-button {
    background-image: url("../assets/icons/information-button-light.svg");
    background-size: contain;
    display: inline-block;
    width: 22px;
    height: 22px;
    vertical-align: baseline;
    cursor: pointer;
    text-align: right;
}

body.light .info-button {
    background-image: url("../assets/icons/information-button.svg");
}

.info-button.info-button-small {
    width: 15px;
    height: 15px;
}

.icon-inline {
    height: 40px;
    margin-right: 10px;
    margin-bottom: 10px;
}

/************************/
/* Large square buttons */
/************************/

.square-button {
    background-color: var(--choice-color);
    border: var(--choice-border-color) solid;
    color: var(--choice-text-color);
    border-radius: 42px;
    padding: 10px 12px;
    margin: 0px 5px;
    text-align: center;
    vertical-align: center;
    cursor: pointer;
    user-select: none;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.square-button:hover {
    background-color: var(--choice-hover-color);
}

/*************************/

.back-link::before {
    content: "🠔";
    /* ← */
}

.back-link {
    width: 50px;
    line-height: 50px;
    text-align: center;
    background-color: var(--choice-color);
    border: var(--choice-border-color) solid;
    color: var(--choice-text-color);
    border-radius: 50px;
    font-size: 1.8em;
    margin-right: 20px;
    flex-shrink: 0;
}

.back-link:hover {
    text-decoration: none;
    background-color: var(--choice-hover-color);
    color: var(--choice-text-color);
    cursor: pointer;

}

.screen-heading {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 20px;
}

.screen-heading>img {
    height: 80px;
    margin-right: 20px;
}

/*****************************/
/* Cards (boxes for plots)   */
/*****************************/

.card {
    max-width: 650px;
    margin-right: 20px;
    margin-bottom: 20px;
    border: var(--choice-border-color) 4px solid;
    border-radius: 10px;
    padding: 20px;
    background-color: var(--choice-color);
}

.card-heading {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.card-icon {
    width: 60px;
    margin-right: 20px;
}

.card-titles {
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.3em;
    font-weight: bold;
}

.card-subtitle {
    font-size: 1.1em;
}


/*****************/
/* Big numbers   */
/*****************/

.big-numbers {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.big-number-box {
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-right: 20px;
    margin-bottom: 20px;
    border: var(--choice-border-color) 4px solid;
    border-radius: 10px;
    padding: 20px;
    background-color: var(--choice-color);
}

.big-number-heading {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.big-number-icon {
    width: 60px;
    margin-right: 10px;
}

.big-number-titles {
    display: flex;
    flex-direction: column;
}

.big-number-title {
    font-size: 1.3em;
    font-weight: bold;
}

.big-number-subtitle {
    font-size: 1.1em;
}

.big-number {
    font-size: 4em;
    color: var(--light-blue);
    align-self: center;
}

.big-number-unit {
    font-size: 1.3em;
    align-self: center;
    text-align: center;
}

.box-100px {
    width: 100px;
    height: 100px;
}
.box-150px {
    width: 150px;
    height: 150px;
}
.box-250px {
    width: 250px;
    height: 250px;
}
.box-300px {
    width: 300px;
    height: 300px;
}
.box-400px {
    width: 400px;
    height: 400px;
}
.box-500px {
    width: 500px;
    height: 500px;
}
.box-600px {
    width: 600px;
    height: 600px;
}

.plotly-plot {
    width: calc(100% - 20px);
}

.heading-follows {
    margin-top: 3rem;
}

.d3-grid {
    shape-rendering: geometricPrecision;
    stroke-width: "1px";
}

/*****************/
/* Toggle switch */
/*****************/
/* From from https://www.w3schools.com/howto/howto_css_switch.asp */

 /* The switch - the box around the slider */
 .toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
  }
  
  /* Hide default HTML checkbox */
  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  /* The slider */
  .toggle-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
  }
  
  .toggle-switch-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
  }
  
  input:checked + .toggle-switch-slider {
    background-color: #2196F3;
  }
  
  input:focus + .toggle-switch-slider {
    box-shadow: 0 0 1px #2196F3;
  }
  
  input:checked + .toggle-switch-slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
  }
  
  /* Rounded sliders */
  .toggle-switch-slider.round {
    border-radius: 34px;
  }
  
  .toggle-switch-slider.round:before {
    border-radius: 50%;
  } 