:root
{
    --primary  : #4e7fa8;
    --secondary: #82a5c1;
    --gray     : #d3dae0;

    --visualization-width : 1000px;
    --visualization-height:  500px;

    --legend-size: 196px;
}

/* ---------- */
/* -- Base -- */
/* ---------- */

body
{
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
}

h1 { color: var( --primary   ); font-size: 2.5rem; margin: 56px 0 32px 0; }
h2 { color: var( --secondary ); }
h3 { color: var( --secondary ); margin-top: 0; }
h4 { color: var( --secondary ); }
h5 { color: var( --secondary ); }
h6 { color: var( --secondary ); }

.loading
{
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading svg
{
    color: var( --primary );
    margin-top: calc( -80px / 2 );

    width : 32px;
    height: 32px;

    animation: spin 2s infinite linear;
}

@keyframes spin 
{
    from {transform:rotate(  0deg);}
    to   {transform:rotate(360deg);}
}

select
{
    background-color: white;
    outline: none;
    
    border: none;
    border: solid 1px var( --gray );

    border-radius: 4px;

    height: 32px;

    padding: 0 12px;

    transition: border-color 250ms;
}

select:focus
{
    border-color: var( --primary );
}


/* ------------ */
/* -- Header -- */
/* ------------ */

header, nav
{
    height: 80px;
    z-index: 10;
}

nav
{
    position: fixed;

    background-color: var( --primary );
    color: white;

    box-sizing: border-box;
    width: 100%;

    padding: 16px calc( ( 100vw - var( --visualization-width ) ) / 2 );
}

nav > ul
{
    margin: 0;
    padding: 0;
    list-style: none;

    display: flex;
    align-items: center;
    gap: 32px;

    height: 100%;
}

nav > ul, nav > ul > li, nav > ul > li > a
{
    height: 100%;
}

nav > ul > li > a
{
    display: flex;
    flex-direction: column;
    justify-content: center;

    color: white;
    text-decoration: none;

    transition: opacity 250ms;
}

nav > ul > li:not(.fixed) > a:hover
{
    opacity: 1;
}

nav > ul > li > a.active
{
    font-weight: bold;
}

nav > ul > li:not(.fixed) > a:not(.active)
{
    opacity: .6;
}

nav > ul > li:not(.fixed) > a:not(.active):hover
{
    opacity: .8;
}

nav > ul > li > a > :not(.subtitle)
{
    font-size: large;
    font-weight: bold;
}

nav > ul > li > a > .subtitle
{
    font-size: small;
    font-weight: lighter;
}

[data-href]:not(.active) { display: none !important; }


/* -- Tab -- */

.tab
{
    list-style: none;

    display: flex;
    gap: 16px;

    padding: 0;

    margin: 0;
    margin-bottom: 16px;

    font-size: .85rem;

    border-bottom: solid 1px var( --gray );

    width: 100%;
}

.tab li a
{
    display: flex;
    justify-content: center;
    align-items: center;

    font-weight: lighter;

    height: 32px;

    padding: 0 8px;

    margin-bottom: -1px;
}

.tab li a.active
{
    border-bottom: solid 2px var( --primary );
}

.tab li a:not(.active)
{
    opacity: .6;
}

.tab li a:not(.active):hover
{
    opacity: .8;
}

.tab a, .tab a:hover
{
    color: black;
    text-decoration: none;
}


/* ---------- */
/* -- Main -- */
/* ---------- */

main
{
    margin: 32px auto;
}

main.report 
{
    width: 720px;

    text-align: justify;
    font-family: sans-serif;
}

main.report p, main.report ul
{
    font-size: 1.05em;
    color: #393939;
}

main.report b { color: var( --primary ); }

main.report h1
{
    text-align: center;
}

main.report h4
{
    font-size: .8rem;
    opacity: .9;
    margin-top: -16px;
}

main.report section
{
    border-radius: 4px;

    overflow: hidden;
}

main.report section > h2
{
    border-bottom: solid 1px var( --gray );

    height: 64px;

    display: flex;
    align-items: center;

    padding: 0 16px;
    margin: 0;
}

main.report section:not(:last-child) { margin-bottom: 32px; }

main.report article
{
    padding: 32px 16px;
}

main.report article > :first-child { margin-top   : 0; }
main.report article > :last-child  { margin-bottom: 0; }

main.report article:not(:last-child)
{
    padding-bottom: 0;
}

main.report figure 
{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

main.report figure img
{
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

main.report figcaption 
{
    font-size: .9rem;
    margin-top: 8px;
    opacity: .75;
}



main.visualizations
{
    width: var( --visualization-width );
}

.viz-header
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 64px;
}

.viz-container
{
    display: flex;
    gap: 16px;

    position: relative;
    top: 0; left: 0;

    width : var( --visualization-width  );
    height: var( --visualization-height );
}

.viz-container > *
{
    width : 100%;
    height: 100%;
}

.legend
{
    flex-shrink: 0;
    width: var( --legend-size );
    height: 100%;
    user-select: none;
}

.legend p
{
    font-size: .65rem;
    line-height: 12px;
}

.legend > div > .prototype
{
    display: none;
}

.legend > div > .content > *
{
    display: flex;
    gap: 12px;

    opacity: .5;
}

.legend > div > .content > .active
{
    opacity: .85;
}

.legend > div > .content > :hover
{
    cursor: pointer;
}

.legend > div > .content > .active:hover
{
    opacity: 1;
}

.legend > div > .content > :not(:last-child)
{
    margin-bottom: 8px;
}

.legend > div > .content > * > *
{
    margin: 0;
}

.legend > div > .content > * > svg
{
    flex-shrink: 0;
}

.tooltip
{
    position: absolute;
    bottom: 56px;
    left: 52px;

    padding: 8px;

    box-sizing: border-box;
    width: 196px;
    height: auto;

    background-color: white;

    border: solid 1px var( --gray );
    border-radius: 4px;

    font-size: .65rem;
}
.tooltip.hidden
{
    display: none;
}

.tooltip > ul
{
    margin: 0;
    padding: 0;
    list-style: none;
}

.tooltip > ul > li
{
    padding: 4px;

    display: flex;
    gap: 8px;
}

.tooltip .text
{
    line-height: 12px;
}

.tooltip .icon
{
    width: 12px;
    height: 12px;
    flex-shrink: 0;

    text-align: center;

    display: flex;
    justify-content: center;
    align-items: center;
}



/* ------------ */
/* -- Footer -- */
/* ------------ */

footer
{
    text-align: center;
    padding: 32px;
}

footer > *
{
    margin: 0;
}

footer > :not(:last-child)
{
    margin-bottom: 16px;
}

footer img
{
    height: 56px;
}

footer ul
{
    margin: 0;
    padding: 0;
    list-style-type: none;

    display: flex;
    justify-content: center;
    gap: 32px;
}

footer li
{
    position: relative;
    top: 0; left: 0;
}

footer li:not(:last-child)::after
{
    display: block;
    content: '-';

    position: absolute;
    top: 50%; right: calc( -.5 * 32px );

    transform: translate( 50%, -50% );
}


/* ------------------- */
/* -- Visualization -- */
/* ------------------- */

.bottom-controller
{
    height: 80px;

    margin-top: 16px;
    margin-right: calc( var( --legend-size ) + 16px );

    display: flex;
    gap: 16px;
}

.bottom-controller :disabled
{
    opacity: .3 !important;
}

.bottom-controller > button
{
    background: none;
    border: none;

    border-radius: 1000px;
    border: solid 2px var( --primary );

    padding: 0;

    width: 32px;
    height: 32px;

    flex-shrink: 0;

    background-color: var( --primary );
    color: white;

    cursor: pointer;

    display: flex;
    justify-content: center;
    align-items: center;

    transition: background-color 250ms, color 250ms;
}

.bottom-controller > button > svg
{
    width: 16px;
    height: 16px;
}

.bottom-controller > button.small
{
    background-color: transparent;
    color: var( --primary );
    border-color: transparent;
}

.time-button-controller.active       > .on  { display: none !important; }
.time-button-controller:not(.active) > .off { display: none !important; }

.time-button-controller > .on { margin-left: 2px; }

.time-button-controller.active
{
    background-color: white;
    color: var( --primary );
}

.repeat-button-controller:not(.active)
{
    background-color: white;
    color: var( --primary );
}

.range-container
{
    width: 100%;
}

.range-container input
{
    appearance: none;
    -webkit-appearance: none;

    display: block;
    width: 100%;
    height: 32px;

    margin: 0;
    padding: 0;

}

/* Firefox */
.range-container input::-moz-range-track
{
    height: 6px;
    border-radius: 100px;
    background: var( --gray );
}  
/* Chrome : i don't understand why but "selector1, selector2" doesn't work, so i have to copy paste these lines */
.range-container input::-webkit-slider-runnable-track
{
    height: 6px;
    border-radius: 100px;
    background: var( --gray );
}

/* Firefox */
.range-container input::-webkit-slider-thumb 
{
    -webkit-appearance: none;

    box-sizing: content-box;

    height: 18px;
    width: 18px;
    
    border: solid 2px white;
    border-radius: 1000px;
    
    background-color: var( --primary );

    cursor: pointer;

    transform: translate( 0, -8px );
}

/* Chrome : same problem */
.range-container input::-moz-range-thumb 
{
    height: 18px;
    width: 18px;
    
    border: solid 2px white;
    border-radius: 1000px;
    
    background-color: var( --primary );

    cursor: pointer;
}

.range-container datalist 
{
    display: flex;
    justify-content: space-between;

    font-size: .75rem;

    margin-top: 8px;

    width: 100%;
}

.range-container option
{
    padding: 0;
    padding-top: 6px;

    position: relative;
    top: 0; left: 0;

    color: var( --primary );

    width: 22px;
}

.range-container option::before
{
    position: absolute;
    top: 4px;
    left: 50%;

    transform: translate( -50%, 0 );
}

.range-container option::after
{
    display: block;
    content: "";

    width: 2px;
    height: 8px;

    position: absolute;
    top: 0;
    left: 50%;

    background-color: var( --secondary );
    border-radius: 100px;

    z-index: -1;

    transform: translate( -50%, -100% );
}


/* ---------------- */
/* -- Responsive -- */
/* ---------------- */

@media (max-width: 1100px)
{
    :root
    {
        --visualization-width : 800px;
        --visualization-height: 400px;
    }
}

@media (max-width: 900px)
{
    :root
    {
        --visualization-width : calc( 100vw - 2 * 24px );
        --visualization-height: 300px;
    }

    h1 { text-align: center; }
}

