@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;500;700&display=swap');

:root{
    --green : #b1cb06;
    --blue : #009de1;
    --yellow : #efb416;

    --bg--primary: hsl(203, 7%, 92%);
    --bg--active: hsla(203, 86%, 93%, 0.7);
    --bg--hover: hsl(200, 7%, 84%);
    --bg--focus: hsl(203, 100%, 100%);
    --gray--primary: hsl(200, 10%, 50%);
    --gray--secondary: hsl(200, 14%, 30%);

    --dark--primary: hsl(203, 13%, 14%);
    --dark--secondary: hsl(203, 4%, 29%);

    --accent--primary: hsl(206, 90%, 56%);
    --accent--secondary: hsl(206, 79%, 58%);

    --expanded: 16.875rem;
    --collapsed: 3.25rem;
    --svg: 1.5rem;
    --item: 2.25rem;
    --brad-outer: 0.75rem;
    --frame-space: 0.5rem;
    --brad-inner: calc(var(--brad-outer) - var(--frame-space));
}

body, html{
    width: 100%;
    overflow: hidden;
    overflow-y: auto;
}

body{
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Ubuntu';
}

/*
 *
 * MENU
 *
*/

#menu{
    position: absolute;
    bottom : 28%;
    /*left: 50%;
    transform: translateX(-50%);*/
    left: 2rem;
    background-color: #fff;
    padding: .3rem .3rem;
    border-radius: 500px;
    z-index: 5;
}

#menu ul{
    display: flex;
    flex-direction: column;
    gap: .5rem;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#menu ul li{
    display: flex;
    justify-content: center;
    text-align: center;
    align-items: center;
    font-size: 1rem;
    width : 2rem;
    height: 2rem;
    border-radius: 500px;
    background-color: #fff;
}

#menu ul li a{
    color : #222222;
}

#menu ul li.active{
    -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
    box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
}

#menu ul li.active i{
    color : var(--green);
    filter: drop-shadow(0 0 5px rgba(177,203,6,0.4)) drop-shadow(0 0 7px rgba(177,203,6,0.4))
    drop-shadow(0 0 10px rgba(177,203,6,0.4));
}

#menu ul li:hover i, #menu ul li:active i{
    color : var(--green);
}

/*
*
* SOPHISTICATED MENU
*
*/

label,
button {
    cursor: pointer;
}

.vertical-sidebar input[type="checkbox"] {
    display: none;
}

.vertical-sidebar {
    display: flex;
    inline-size: var(--expanded);
    margin-block: 5vmin;
    position: absolute;
    left: 1rem;
    top: 25%;
    transform: translateY(-50%);
    z-index: 99;
}

nav {
    background: var(--bg--primary);
    display: flex;
    flex-flow: column;
    min-width: var(--collapsed);
    border-radius: var(--brad-outer);
    flex: 0 0 auto;
    transition: flex-basis 300ms ease-out;
    will-change: flex-basis;
    padding: var(--frame-space);
    box-shadow: 0 3px 5px #1233, 0 5px 17px #0003;
}

.vertical-sidebar :checked ~ nav {
    flex-basis: var(--expanded);
}

.vertical-sidebar :not(:checked) ~ nav {
    flex-basis: var(--collapsed);
}

header {
    display: flex;
    flex-flow: column;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar__toggle-container {
    block-size: var(--item);
    display: flex;
    justify-content: end;
}

.nav__toggle {
    block-size: 100%;
    background: none;
    transition: all 233ms ease-in;
    border-radius: var(--brad-inner);
    outline: 2px solid transparent;
    outline-offset: -2px;
    overflow: hidden;
}

.toggle--icons {
    block-size: inherit;
    aspect-ratio: 1;
    display: inline-grid;
    place-content: center;
    grid-template-areas: "svg";
    z-index: 10;
}

.toggle-svg-icon {
    grid-area: svg;
    fill: var(--gray--primary);
    transition: fill 233ms ease-in;
}

.nav__toggle:hover {
    outline: 2px solid var(--accent--primary);
}

.toggle--icons:hover .toggle-svg-icon {
    fill: var(--dark--primary);
}

figure {
    display: flex;
    flex-direction: column;
    justify-content: center;
    container-type: inline-size;
    gap: 0.375rem;
}

.codepen-logo {
    margin-inline: auto;
    display: block;
    min-inline-size: 2.25rem;
    max-inline-size: 65cqi;
    block-size: 100%;
    object-fit: contain;
    transition: width 100ms linear;
}

figcaption {
    text-align: center;
}

.user-id {
    font-size: 1.0625rem;
    font-weight: 500;
    margin-block-end: 0.25rem;
    color: var(--gray--secondary);
}

.user-role {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray--primary);
}

.sidebar__wrapper {
    --list-gap: 0.5rem;
    display: flex;
    flex-flow: column;
    gap: var(--list-gap);
}

.sidebar__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-flow: column;
    gap: 0.125rem;
    overflow: hidden;
}

.sidebar__item {
    block-size: var(--item);
    border-radius: var(--brad-inner);
}

.item--heading {
    display: flex;
    align-items: end;
}

.sidebar__item--heading {
    margin-block-end: 0.4rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    font-weight: 500;
    color: var(--gray--primary);
    transition: color 200ms ease-in;
}

.sidebar__list:has(.sidebar__link):hover .sidebar__item--heading {
    color: var(--gray--secondary);
}

.sidebar__link {
    display: flex;
    text-decoration: none;
    block-size: 100%;
    align-items: center;
    gap: 0.5rem;
    outline: 2px solid transparent;
    border-radius: inherit;
}

.icon {
    aspect-ratio: 1;
    block-size: 100%;
    display: inline-grid;
    svg {
        place-self: center;
        inline-size: var(--svg);
        block-size: var(--svg);
        fill: var(--gray--primary);
    }
}

.text {
    pointer-events: none;
    color: var(--gray--secondary);
    font-size: 0.875em;
    font-weight: 500;
    transition: color 266ms ease-out;
}

.sidebar__link:hover {
    background: var(--bg--hover);

}

.sidebar__link:hover .icon svg {
    fill: var(--green);
}
.sidebar__link:hover .text {
    color: var(--dark--primary);
}

.sidebar__link:focus {
    outline: 2px solid var(--accent--secondary);
    outline-offset: -2px;
    background: var(--bg--focus);
}

.sidebar__link:focus .icon svg {
    fill: var(--green);
}

.sidebar__link:active {
    background-color: var(--bg--active);
}

aside:not(:has(:checked)) .toggle--open,
aside:has(:checked) .toggle--close {
    opacity: 0;
}

aside:not(:has(:checked)) :where(figcaption, .item--heading) {
    opacity: 0;
}

aside:has(:checked) :where(figcaption, .item--heading) {
    transition: opacity 300ms ease-in 200ms;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: fixed;
    translate: calc(var(--item) * 1.5) calc(var(--item) * 0.125);
    border-radius: var(--brad-inner);
    padding: 0.5rem 0.75rem;
    color: #ddd;
    background-color: hsl(198 16 30);
    box-shadow: 0 6px 12px -6px #0003;
    opacity: 0;
    pointer-events: none;
    scale: 0 0;
    z-index: 999;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 350ms ease-out;
}

aside:not(:has(:checked))
    .sidebar__link:where(:hover, :focus-visible)[data-tooltip]::before {
    opacity: 1;
    scale: 1;
}

/*
 *
 * MAIN MODEL
 *
*/

#main-model{
    position: relative;
    height: 100%;
}

/* PAUSE BUTTON */
#main-model #pause-button{
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom : 10%;
    right: 2rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(90deg, #dcdc00 0%, #8dc11e 90%);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0px 0px 10px -3px #b1cb06;
    transition: box-shadow .3s ease;
}

#main-model #pause-button.active{
    padding-right: 1.1rem;
    box-shadow: 0px 0px 30px -3px #b1cb06;
}

#main-model #pause-button.active #pause{
    display: none;
}

#main-model #pause-button.active #play{
    display: inline-block;
}

#main-model #pause-button #play{
    display: none;
}

/* CAR BUTTON */
#main-model #car-button{
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom : 35%;
    right: 2rem;
    padding: .75rem 1.1rem .85rem;
    background: linear-gradient(90deg, #dcdc00 0%, #8dc11e 90%);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0px 0px 10px -3px #b1cb06;
    transition: box-shadow .3s ease;
}

#main-model #car-button.active{
    padding: 1rem 1.1rem;
    box-shadow: 0px 0px 30px -3px #b1cb06;
}

#main-model #car-button.active #remove{
    display: none;
}

#main-model #car-button.active #display{
    display: inline-block;
}

#main-model #car-button #remove .fa-car{

}

#main-model #car-button #display{
    display: none;
}

#main-model #car-button #remove{
    position: relative;
}

#main-model #car-button #remove .fa-ban{
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1.8rem;
    transform: translate(-6px, -1px);
}

#main-model canvas{
    /*width: 100%!important;
    height: 100%!important;*/
}

/* INFOBOX */
#main-model div.label{
    backdrop-filter: blur(2px);
}

#main-model div.label h2{
    display: block;
    width: 100%;
    text-transform: uppercase;
    text-align: center;
    font-size: 1rem;
    font-family: 'Ubuntu';
    font-weight: 700;
    color : #021c66;
    padding: 1rem;
    margin: 0;
}

#main-model div.label .value-wrapper{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0rem;
    min-width : 5rem;
    border-top : 1px solid rgba(0,0,0,0.1);
}

#main-model div.label.batiment-principal-bureau .value-wrapper{
    width : 14rem;
}

#main-model div.label p{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50%;
    margin-bottom: 0;
    font-weight: 300;
    font-size: .9rem;
    padding: .5rem 1rem;
}

#main-model div.label p i{
    font-size: 1.2rem;
    color : var(--icon-color);
    filter: drop-shadow(0 0 15px var(--icon-color)) drop-shadow(0 0 30px var(--icon-color))
    drop-shadow(0 0 50px var(--icon-color));
}

#main-model div.label p > span{
    display: flex;
    align-items: center;
    gap: .2rem;
}

#main-model div.label p .value-name{
    font-weight: 700;
    font-size: 1.5;
}

@media screen and (max-width: 768px) {
    #main-model div.label h2 {
        padding: 0 0 5px;
        font-size: 12px;
    }
    #main-model div.label p {
        width: 33%;
        flex-direction: row;
        padding: 10px 0 0;
        gap: 4px;
    }
    #main-model div.label .value-wrapper {
        min-width: auto;
    }
    #main-model div.label.batiment-principal-atelier p {
        width: 50%;
    }
}

#main-model div.label p span.value-unity{
    font-size: .7rem;
}

/* Timer */
#timer{
    position: absolute;
    top : 2rem;
    left : 2rem;
    font-family: "Ubuntu";
    font-size : 3rem;
    font-weight: 300;
    color : #021c66;
    /*padding: 1rem;
    border : 1px solid rgba(255,255,255,.5);
    backdrop-filter: blur(10px);
    border-radius: 10px;*/
    z-index : 10;
}

#timer .number{
    font-weight: 400;
}

#timer #seconds{
    font-family: "Ubuntu";
    font-size : 1.5rem;
    font-weight: 300;
    color : #021c66;
    margin-left : .2rem
}

/* Weather Forecast*/
#main-model #weather-forecast{
    position: absolute;
    top : 2rem;
    right : 2rem;
    display: flex;
    align-items: center;
    gap : 1rem;
    /*padding: 2rem;
    background-color : rgba(0,0,0,0.02);*/
    align-items: flex-start;
    z-index: 10;
}

#main-model #weather-forecast #weather-location{
    text-transform: uppercase;
    font-weight: 400;
    font-size : .7rem;
    margin-bottom: 0.2rem;
}

#main-model #weather-forecast #weather-icon{
    background-position: center;
}

#main-model #weather-forecast #weather-infos #weather-temperature{
    font-size: 3rem;
    font-weight: 600;
    color: #021c66;
    line-height: 1;
}

#main-model #weather-forecast #weather-infos #weather-status{
    text-transform: capitalize;
    font-weight: 300;
    font-size : .9rem;
}

@media screen and (max-width: 768px){

    #menu{
        bottom: 120px;
    }

    #main-model #pause-button{
        bottom: 120px;
    }

    #timer{
        font-size: 2rem;
        top : 1rem;
        left: 1rem;
    }

    #timer #seconds{
        font-size: 1rem;
    }

    #main-model #weather-forecast{
        top : 1rem;
        right: 1rem;
    }

    #main-model #weather-forecast #weather-location{
        font-size: .6rem;
    }

    #main-model #weather-forecast #weather-infos #weather-status{
        font-size: .8rem;
    }

    #main-model #weather-forecast #weather-infos #weather-temperature{
        font-size: 2rem;
    }

    #main-model #weather-forecast #weather-icon img{
        width : 70px;
    }

}

/*
 *
 * MAIN PANEL
 *
*/

#main-panel{
    display: flex;
    bottom: 0;
    left: 0;
    right: 0;
    position: absolute;
    flex-wrap: nowrap;
    justify-content: space-between;
    height: 25%;
    background-color: rgba(255,255,255,0.8);
    backdrop-filter: blur(5px);
    background : radial-gradient(circle, rgba(22,39,64,1) 0%, rgba(22,39,64,1) 22%, rgba(10,14,28,1) 81%, rgba(10,14,28,1) 100%);
    z-index: 999;
}

#main-panel #logo{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    height: 100%;
    /*background: rgb(22,39,64);
    background: radial-gradient(circle, rgba(22,39,64,1) 0%, rgba(22,39,64,1) 22%, rgba(10,14,28,1) 81%, rgba(10,14,28,1) 100%);*/
}

#main-panel #logo img{
    width : 15rem;
}

#main-panel #main-panel-general-infos{
    padding: 2rem 4rem;
}

#main-panel #main-panel-general-infos #global-energy{
    display: flex;
    flex-direction: column;
    align-items : center;
    gap : 0.5rem;
}

#main-panel #main-panel-general-infos #global-energy #icon{
    position: relative;
    margin-bottom : 1rem;
    margin-top: 1rem;
}

#main-panel #main-panel-general-infos #global-energy #icon i{
    position: relative;
    z-index: 2;
    color: #fff;
}

#main-panel #main-panel-general-infos #global-energy #icon:before{
    content:"";
    border-radius: 50%;
    overflow: hidden;
    width: 60px;
    height: 60px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(22,39,64,1) 0%, rgba(22,39,64,1) 22%, rgba(10,14,28,1) 81%, rgba(10,14,28,1) 100%);
}

#main-panel #main-panel-general-infos #global-energy #icon #icon-shadow{
    width: 60px;
    height: 60px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 100%;
    z-index: 1;
    box-shadow: 6px -4px 30px 7px #b1cb06, 24px -10px 47px 10px #b7d1ac, -14px -13px 51px 10px #5acee3, 2px 5px 20px 10px #009de1, 3px 2px 83px 10px #56f40c;
    animation: shadow-rotate 1.5s linear infinite;
    transform-origin: center;
}

#main-panel #main-panel-general-infos #global-energy i{
    font-size: 2.2rem;
}

#main-panel #main-panel-general-infos #global-energy .values{
    position: relative;
    z-index: 2;
    color: #fff;
}

@media screen and (min-width: 769px) and (max-width: 1024px){
    #main-panel #logo{
        padding-right: 0;
    }

    #main-panel #logo img {
        width: 6rem;
    }
}

@media screen and (max-width: 1024px){

    #main-panel #main-panel-general-infos{
        padding: 1rem 2rem;
    }

    #main-panel #main-panel-general-infos #global-energy #icon{
        margin-top: 1rem;
    }

    #main-panel #main-panel-general-infos #global-energy #icon:before{
        width: 40px;
        height: 40px;
    }

    #main-panel #main-panel-general-infos #global-energy #icon #icon-shadow{
        width: 50px;
        height: 50px;
        box-shadow: 3px -2px 20px 3px #b1cb06, 12px -5px 25px 5px #b7d1ac, -7px -9px 26px 5px #5acee3, 1px 3px 16px 5px #009de1, 3px 2px 30px 5px #56f40c;
    }

    #main-panel #main-panel-general-infos #global-energy .values{
        font-size: .9rem;
    }

    #main-panel #main-panel-general-infos #global-energy #icon i{
        font-size: 1.2rem;
    }
}

@media screen and (max-width: 768px){

    #main-panel{
        flex-direction: column;
        height: auto;
        align-items: center;
        bottom: auto;
        top: 100%;
        transform: translateY(-90px);
        transition: transform .3s ease;
    }

    #main-panel.active{
        transform: translateY(-100%);
    }

    #main-panel #logo{
        justify-content: space-between;
        border-bottom: 1px solid rgba(255, 255, 255, .2);
        padding: 1.5rem;
    }

    #main-panel #logo img{
        width : 10rem;
    }

    #main-panel #chart-toggler{
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        border-radius: 50%;
        transition: box-shadow .3s ease;
    }

    #main-panel #chart-toggler i{
        font-size: 2rem;
    }

    #main-panel #main-panel-general-infos{
        position: relative;
        padding: 2rem;
        padding-top: 10rem;
        flex-direction: column;
        gap : 2rem;

        overflow-y: scroll;
        max-height: 60vh;
    }

    #global-energy-wrapper{
        position: absolute;
        top: 3rem;
        left: 50%;
        transform: translateX(-50%);
    }

}

@keyframes shadow-rotate {
    from {
      transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
      transform: translate(-50%, -50%) rotate(360deg);
    }
}

#logo-eklipse-by-stemi {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    z-index: 10;
    font-family: "Ubuntu";
}
#logo-teds {
    position: absolute;
    bottom: 1rem;
    right: 2rem;
    z-index: 10;
    font-family: "Ubuntu";
}

#logo-ctp {
    position: absolute;
    top: 1rem;
    right: 2rem;
    z-index: 10;
}
.mesh-tag {
    position: relative;
    display: flex;
    align-items: center;
    pointer-events: none;
}
.mesh-tag .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    pointer-events: auto;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.mesh-tag .label {
    font-size: 12px;
    color: #222;
    background: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    box-shadow: 0 1px 4px #0001;
}
@media screen and (max-width: 768px) {
    .mesh-tag .label {
        opacity: 0;
    }
    #logo-ctp img {
        width: 80px;
    }
}
.loading-icon-3d {
    width: 69px;
    margin-bottom: 20px;
    animation: flipHorizontal 2s linear infinite;
    transform-style: preserve-3d;
    filter: drop-shadow(3px 3px 8px rgba(0, 0, 0, 0.2));
    position: absolute;
    top: 4px;
    right: 41px;
}

.loading-icon-3d::before {
    content: '';
    position: absolute;
    top: 45px;
    left: 8px;
    width: 45px;
    height: 8px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: shadowFlip 2s linear infinite;
}

@keyframes flipHorizontal {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

@keyframes shadowFlip {
    0% {
        transform: scaleX(1);
        opacity: 0.15;
    }
    50% {
        transform: scaleX(0.7);
        opacity: 0.1;
    }
    100% {
        transform: scaleX(1);
        opacity: 0.15;
    }
}

#fullscreen-button {
    position: absolute;
    bottom : 10%;
    right: 6rem;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: background 0.3s ease;
}

#fullscreen-button:hover {
    background: rgba(0, 0, 0, 0.8);
}

#fullscreen-button i {
    color: white;
    font-size: 20px;
}

#day-night-toggle {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#day-night-toggle:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

#day-night-toggle:active {
    transform: scale(0.95) !important;
}

