@import url(./accordion.css);
@import url(./select.css);
@import url(./inputs.css);

@font-face {
  font-family: 'barlow-bold';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/barlow/v13/7cHqv4kjgoGqM7E30-8s51ostz0rdg.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/barlow/v13/7cHpv4kjgoGqM7E_DMs5ynghnQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color--asi-red:  hsl(3, 65%, 52%);
  --color--asi-blue: hsl(231, 47%, 17%);
  --color--asi-blue--hover:  hsl(231, 45%, 23%);
  --color--asi-blue--active: hsl(231, 43%, 32%);
  --color--asi-blue--focus:  hsla(231, 60%, 50%, .4);
  --color--asi-blue--alpha:  hsla(231, 60%, 50%, .07);
  --color--asi-blue--alpha--hover: hsla(231, 70%, 50%, .14);

  --color--primary: var(--color--asi-blue);
  --color--primary--hover: var(--color--asi-blue--hover);
  --color--primary--active: var(--color--asi-blue--active);
  --color--primary--focus: var(--color--asi-blue--focus);
  --color--primary--alpha: var(--color--asi-blue--alpha);
  --color--primary--alpha--hover: var(--color--asi-blue--alpha--hover);

  --color--electricity--training:  hsl(250, 51%, 32%);
  --color--electricity--inference: hsl(250, 50%, 78%);

  --color--warming--training:  hsl(165, 98%, 18%);
  --color--warming--inference: hsl(166, 40%, 74%);

  --color--water--training:  hsl(200, 100%, 20%);
  --color--water--inference: hsl(205,  50%, 76%);

  --color--gpu:       hsl(165, 98%, 35%);
  --color--server:    hsl(165, 98%, 18%);
  --color--equipment: hsl( 30,  9%, 22%);
  --color--infra:     hsl(166, 40%, 74%);

  --color--ai:     hsl(166,  80%,  25%);
  --color--calcul: hsl(280,  60%,  32%);
  --color--data:   hsl(180, 100%,  25%);
  --color--infra-pyramid:  hsl(  5, 100%,  24%);

  --height--header: 64px;

  --font-size: 14px;

  font-family: 'barlow', sans-serif;
  font-size: var(--font-size);
  color: black;
}

/* ====== RESET TYPO ====== */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-size: var(--font-size);
  line-height: calc(var(--font-size) + (var(--font-size) / 4));
  margin-bottom: calc(var(--font-size) / 2);
  font-family: 'barlow-bold', sans-serif;
}

h1 { --font-size: 32px; }
h2 { --font-size: 24px; }
h3 { --font-size: 20px; }
h4 { --font-size: 18px; }
h5 { --font-size: 16px; }
h6 { --font-size: 14px; }

p, ul {
  margin-top: 0;
}

/* ----------------------------------------------------- */
/* GLOBAL */
/* ----------------------------------------------------- */

* {
  scroll-behavior: smooth;
  box-sizing: border-box;
}
button, select, a {
  cursor: pointer;
}

html, body {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  min-width: 100svw !important; width: 100svw !important; max-width: 100svw !important;
  height: 100svh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background-color: white;
}

strong {
  font-family: 'barlow-bold', sans-serif;
}

/* ----------------------------------------------------- */
/* BUTTONS */
/* ----------------------------------------------------- */

.button {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 8px;
  letter-spacing: 1px;
  border: none;

  transition: background-color .15s linear;
}

.button.dark {
  background-color: var(--color--primary);
  color: white;
}
.button.dark:hover {
  background-color: var(--color--primary--hover);
}
.button.dark:active {
  background-color: var(--color--primary--active);
}

/* ----------------------------------------------------- */
/* ASIDE */
/* ----------------------------------------------------- */
aside {
  min-width: 160px; width: 160px; max-width: 160px;
  height: 100svh;
  padding: 12px;
  border-right: 1px solid grey;
}
nav {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  height: 100%;
}
nav > a {
  padding: 6px 12px;
  border-radius: 6px;
  width: 100%;
  text-decoration: none;
  color: black;
}
nav > a:hover {
  background-color: var(--color--primary--alpha);
}
nav > a:active {
  background-color: var(--color--primary--alpha--hover);
}

/* ----------------------------------------------------- */
/* HEADER */
/* ----------------------------------------------------- */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: var(--height--header);
  padding: 12px;
  background-color: white;
  border-bottom: 1px solid grey;
}

#asiDisplay {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  height: 100%;
  font-size: 24px;
  color: var(--color--primary);
}

#asiLogo {
  height: 100%;
}

header p {
  font-size: 14px;
  margin: 0;
}







main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  height: calc(100svh - var(--height--header));
  background-color: hsl(0, 0%, 97%);
  overflow-x: hidden;
  overflow-y: scroll;
  margin: 0;
  padding: 8px 16px;
}

.introduction {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}
.introduction p, .introduction h2 {
  margin-top: 0;
}

.sub-page {
  width: 100%;
}
.sub-page > h2 {
  margin-top: 0;
}



/* ----------------------------------------------------- */


.master-block {
  width: 100%;
  background-color: white;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  margin-bottom: 24px;
}

fieldset {
  width: 100%;
  border-radius: 6px;
  border-color: hsl(0, 0%, 90%);
}
fieldset:not(:last-of-type) {
  margin-bottom: 24px;
}

fieldset > legend {
  font-family: 'barlow-bold';
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.row-between:not(:last-of-type) {
  margin-bottom: 8px;
}

fieldset > .row-between > span > label {
  cursor: pointer;
}

#customInferenceValueArea {
  display: flex;
  align-items: center;
  gap: 8px;
}

.submit-form-button {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 24px auto;
  padding: 12px 24px;
  background-color: var(--color--primary);
  color: white;
  text-transform: uppercase;
  border-radius: 12px;
  border: none;
  font-family: 'barlow-bold', sans-serif;
}
.submit-form-button:hover {
  background-color: var(--color--primary--hover);
}
.submit-form-button:active {
  background-color: var(--color--primary--active);
}



/* ----------------------------------------------------- */


.result-section {
  background-color: white;
  border: 1px solid var(--color--primary);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  border-radius: 8px;
}
.result-section {
  margin-bottom: 24px;
}

.result-section > h3 {
  margin: 0;
  padding: 16px;
  width: 100%;
  background-color: var(--color--primary--alpha);
  border-radius: 6px 6px 0 0;
  text-align: center;
  border-bottom: 1px solid var(--color--primary);
  font-family: 'barlow-bold';
}

/* .result-section h4 {
  color: var(--color--primary);
} */

.result-content {
  width: 100%;
  padding: 16px;
}
.result-content > h4:first-child,
.result-content > p:first-child {
  margin-top: 0 !important;
}
.result-content.centered {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.model-block {
  display: flex;
  justify-content: center;
  align-items: baseline;
  width: 100%;
  gap: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  
  th, td {
    border: 1px solid gray;
    padding: 4px 8px;
  }
}

.equivalence-table {
  th, td {
    width: calc(100% / 3);
    text-align: center;
  }
}

.comparison-table {
  --col-count: 4;
  /* background-color: salmon; */
  width: 100%;

  &:not(:last-of-type) {
    margin-bottom: 12px;
  }

  th, td {
    width: calc(100% / var(--col-count));
    &:not(:last-of-type) {
      border-right: 1px solid black;
    }
  }

  td {
    text-align: end;
  }
}

.comparison-select-cell {
  padding: 16px;
}
.comparison-select-cell > select {
  /* display: block;
  width: 75%;
  margin: 0 auto; */

  &:not(:last-of-type) {
    margin-bottom: 4px;
  }
}

.chosen-model-cell {
  background-color: var(--color--primary--alpha);
}

td.good, td.same, td.acceptable, td.medium, td.bad {
  font-family: 'barlow-bold';
  padding-top: 8px;
  padding-bottom: 8px;
}

td.good {
  background-color: hsla(84, 80%, 40%, 30%);
}
td.same {
  background-color: transparent;
}
td.acceptable {
  background-color: hsla(45, 100%, 50%, 35%);
}
td.medium {
  background-color: hsla(30, 100%, 50%, 35%);
}
td.bad {
  background-color: hsla(0, 100%, 70%, 40%);
}

.yearly-usage-container {
  /* background-color: peachpuff; */
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.yu-results {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.yu-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 450px;
}
.yu-value {
  --width: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: var(--width); width: var(--width); max-width: var(--width);
}
.yu-label {
  width: 100%;
  /* background-color: pink; */
  display: flex;
  justify-content: flex-start;
  text-align: start;
  padding: 0px 8px;
  /* text-transform: uppercase; */
}

.value-box {
  background-color: white;
  font-size: 16px;
  font-weight: 800;
  /* color: var(--color--primary); */
  padding: 8px 16px;
  /* box-shadow: 0px 4px 8px 0px hsla(0, 0%, 0%, .33); */
  border-radius: 8px;
  border: 1px solid hsl(0, 0%, 50%, 50%);
}

.electric-mix-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}
.electric-mix-half {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-width: 240px;
  gap: 8px;
}

.row-tri-card {
  --gap: 24px;
  /* background-color: peachpuff; */
  display: flex;
  justify-content: center;
  gap: var(--gap);
  width: 100%;

  .tri-card-container {
    /* background-color: aliceblue; */
    width: calc((100% - calc(2 * var(--gap)) / 3));
    /* border: 1px solid black; */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;

    .value-box {
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
}

.impact-title {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  font-size: 16px;
  font-weight: 800;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  text-align: center;
  
  &.electricity {
    background-color: var(--color--electricity--training);
  }
  &.warming {
    background-color: var(--color--warming--training);
  }
  &.water {
    background-color: var(--color--water--training);
  }
}

.stages-graphs-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  /* background-color: bisque; */
  width: 100%;
  gap: 32px;
}
.stages-graph-half {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 50%;
  /* background-color: aqua; */
}

.stages-title {
  width: 100%;
  text-align: center;
  padding: 8px 16px;
  margin-top: 8px;
  text-transform: uppercase;
  font-size: 16px;

  &.training {
    background-color: black;
    color: white;
  }
  &.inference {
    background-color: hsl(30, 10%, 84%);
    color: black;
  }
}
.stages-graph-block {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  text-align: center;
}
.stages-graph-column {
  /* background-color: aliceblue; */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 33%;
  height: 100%;
  /* border: 1px solid black; */
}
.stages-graph-lines-container {
  width: 100%;
  height: 320px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  padding: 0 16px;
}
.stages-graph-line-container {
  width: 33%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;

  &.training {
    &.electricity {
      span { color: var(--color--electricity--training);}
      .stages-graph-line {background-color: var(--color--electricity--training);}
    }
    &.warming {
      span { color: var(--color--warming--training);}
      .stages-graph-line {background-color: var(--color--warming--training);}
    }
    &.water {
      span { color: var(--color--water--training);}
      .stages-graph-line {background-color: var(--color--water--training);}
    }
  }

  &.inference {
    &.electricity {
      span { color: var(--color--electricity--training);}
      .stages-graph-line {background-color: var(--color--electricity--inference);}
    }
    &.warming {
      span { color: var(--color--warming--training);}
      .stages-graph-line {background-color: var(--color--warming--inference);}
    }
    &.water {
      span { color: var(--color--water--training);}
      .stages-graph-line {background-color: var(--color--water--inference);}
    }
  }
}
.stages-graph-line {
  --percentage: 10%;
  width: 80%;
  height: var(--percentage);

}

.graph-baseline {
  display: flex;
  height: 1px;
  min-width: 100%;
  background-color: gray;
  margin-bottom: 8px;
}

.phases-donuts-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  /* background-color: aqua; */
  flex-wrap: wrap;
  gap: 16px;
  margin: 32px 0;
}

.donut-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;

  &.row {
    flex-direction: row;
    gap: 32px;
  }
}

.donut-container {
  --size: 250px;
  --percentage1: 25%; 
  --percentage2: 75%; 
  --color1: blue; 
  --color2: cyan;
  position: relative;
  /* background-color: peachpuff; */
  aspect-ratio: 1/1;
  width: var(--size);
  height: var(--size);
  display: flex;
  justify-content: center;
  align-items: center;

  &.four-colors {
  --percentage3: 25%; 
  --percentage4: 75%; 
  --color3: blue; 
  --color4: cyan;
  }
}

.donut-container.four-colors .donut-background {
  --gap: 0%;

  background: conic-gradient(
    from 0deg, 
    var(--color1) 0%, 
    var(--color1) var(--percentage1), 
    var(--color2) var(--percentage1), 
    var(--color2) calc(var(--percentage1) + var(--percentage2)), 
    var(--color3) calc(var(--percentage1) + var(--percentage2)), 
    var(--color3) calc(var(--percentage1) + var(--percentage2) + var(--percentage3)), 
    var(--color4) calc(var(--percentage1) + var(--percentage2) + var(--percentage3)), 
    var(--color4) 100%
  );
  /* box-shadow: 0px 4px 8px 0px hsla(0, 0%, 0%, .33); */
}
.donut-container.four-colors .donut-mask {
  /* box-shadow: inset 0px 4px 8px 0px hsla(0, 0%, 0%, .33); */
}

.donut-background {
  --gap: 0%;
  background-color: var(--color1);
  min-width: 100%;
  min-height: 100%;
  border-radius: 500px;
  background: conic-gradient(
    from 0deg, 
    white 0%,
    white var(--gap),
    var(--color1) var(--gap), 
    var(--color1) calc(var(--percentage1) + var(--gap)), 
    white calc(var(--percentage1) + var(--gap)), 
    white calc(var(--percentage1) + calc(2 * var(--gap))), 
    var(--color2) calc(var(--percentage1) + calc(2 * var(--gap))),
    var(--color2) 100%
  );
  /* box-shadow: 0px 4px 8px 0px hsla(0, 0%, 0%, .2); */

}
.donut-mask {
  background-color: white;
  min-width: 50%;
  min-height: 50%;
  position: absolute;
  border-radius: 500px;
  /* box-shadow: inset 0px 4px 8px 0px hsla(0, 0%, 0%, .2); */
}

.donut-legend {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;

  &.column {
    gap: 32px;
  }
}

.legend-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.legend-percentage {
  display: flex;
  justify-content: flex-end;
  width: 32px;
}

.color-legend {
  --size: 12px;
  display: flex;
  min-width: var(--size); width: var(--size);
  min-height: var(--size); height: var(--size);
  margin-left: 6px;
  margin-right: 6px;
  background-color: black;

  &.electricity {
    &.training {background-color: var(--color--electricity--training);}
    &.inference {background-color: var(--color--electricity--inference);}
  }

  &.warming {
    &.training {background-color: var(--color--warming--training);}
    &.inference {background-color: var(--color--warming--inference);}
  }

  &.water {
    &.training {background-color: var(--color--water--training);}
    &.inference {background-color: var(--color--water--inference);}
  }

  &.gpu {background-color: var(--color--gpu);}
  &.server {background-color: var(--color--server);}
  &.equipment {background-color: var(--color--equipment);}
  &.infra {background-color: var(--color--infra);}

}

.donut-label {
  font-weight: 800;
}

.equipment-wrap {
  /* background-color: cyan; */
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 32px;
}

.equipments-area {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}
.equipments-img {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  border: 2px dotted gray;
  padding: 16px;
  width: 500px;
  text-align: center;
  gap: 16px;
  position: relative;
}
.equipments-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 8px;
  width: 100%;
  gap: 8px;
  position: relative;

  &.server {
    background-color: var(--color--server);
    color: white;
  }

  &.equipments {
    background-color: var(--color--equipment);
    color: white;
  }

  &.infra {
    background-color: var(--color--infra);
    color: black;
    border: 1px solid black;
  }
}
.equipments-line {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  width: 100%;
  gap: 8px;
}
.eq-line-block {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 33%;
  border: 2px dashed white;
  padding: 8px;

  &.gpu {
    border: 2px solid white;
    background-color: var(--color--gpu);
  }
}

.grey-block {
  background-color: hsl(0, 0%, 80%);
  color: black;
  border: 1px solid black;
  padding: 4px 16px;
  position: absolute;

  &.building {
    right: 16px;
    top: -14px;
  }

  &.frame {
    right: 16px;
    top: -14px;
  }
}

.ressources-pyramid {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  width: fit-content;
  margin: 0 auto 12px auto;
}

.ressources-pyramid-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.pyramid-row-block-container {
  display: flex;
  justify-content: center;
  align-items: center;
  /* background-color: aqua; */
  padding: 0;
  width: 288px;
}
.ressources-pyramid-block {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 64px;
  color: white;
  font-weight: 800;
  font-size: 18px;
  border-radius: 36px 36px 0 0;
  /* border-radius: 36px; */
}
.ressources-pyramid-row.ai .ressources-pyramid-block     { 
  background-color: var(--color--ai);
  width: 72px; 
}
.ressources-pyramid-row.calcul .ressources-pyramid-block { 
  background-color: var(--color--calcul);
  width: 144px; 
}
.ressources-pyramid-row.data .ressources-pyramid-block   { 
  background-color: var(--color--data);
  width: 216px; 
}
.ressources-pyramid-row.infra .ressources-pyramid-block  { 
  background-color: var(--color--infra-pyramid);
  width: 288px; 
}

.pyramid-row-legend-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-left: 16px;
  gap: 6px;
}

.pyramid-legend-title {
  font-weight: 800;
  font-size: 16px;
}

.ressources-pyramid-row.ai .pyramid-legend-title     { 
  color: var(--color--ai);
}
.ressources-pyramid-row.calcul .pyramid-legend-title { 
  color: var(--color--calcul);
}
.ressources-pyramid-row.data .pyramid-legend-title   { 
  color: var(--color--data);
}
.ressources-pyramid-row.infra .pyramid-legend-title  { 
  color: var(--color--infra-pyramid);
}

.ressources-pyramid-row.ai .pyramid-legend     { 
  color: var(--color--ai);
}
.ressources-pyramid-row.calcul .pyramid-legend { 
  color: var(--color--calcul);
}
.ressources-pyramid-row.data .pyramid-legend   { 
  color: var(--color--data);
}
.ressources-pyramid-row.infra .pyramid-legend  { 
  color: var(--color--infra-pyramid);
}

.good-practice-grid {
  --gap: 12px;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  gap: var(--gap);
  flex-wrap: wrap;
  margin-bottom: 12px;

  .good-practice-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: calc(calc(100% - var(--gap) - var(--gap)) / 3);
    background-color: white;
    border-radius: 12px;
    padding: 12px;
    gap: 12px;
    border: 1px solid var(--color--primary);

    h5, p {
      margin: 0;
    }

    h5 {
      color: var(--color--primary);
    }
  }
}

/* ----------------------- */
.hidden {
  opacity: 0;
}
.none {
  display: none;
}