@use '../../vendor/twbs/bootstrap/scss/bootstrap' as *;
@use 'variables' as variables;

/* =========================================================
   LAYOUT PROBA
========================================================= */

.proba-premium-layout {
  display: block;
}

.proba-premium-card {
  display: block;
}

.proba-premium-map-shell {
  position: relative;
}

.proba-map-wrapper {
  &--premium {
    position: relative;
    overflow: visible;
  }
}

.proba-map {
  height: clamp(320px, 45vh, 520px) !important;
  min-height: 320px;
  border-radius: 0;
}

.proba-premium-thumbnails-block {
  margin-top: 1.5rem;
}

.proba-premium-thumbnails-grid {
  margin: 0;

  > [class*="col-"] {
    display: flex;
  }
}

.proba-map-wrapper {
  position: relative;
  width: 100%;
  min-height: 320px;
  height: 55vw;
  max-height: 520px;
}

.proba-map {
  width: 100%;
  height: 100%;
  min-height: 320px;
}

@media (max-width: 767.98px) {
  .proba-map-wrapper {
    height: 70vw;
    min-height: 300px;
    max-height: 420px;
  }
}

#thumbnails {
  margin: 0;
}

#map-thumbnails {
  height: auto;
}

.proba-premium-thumbnails-grid > div {
  display: flex;
}

.map-thumbnail {
  width: 100%;
}

.proba-premium-thumbnails-grid .map-thumbnail,
#thumbnails .map-thumbnail {
  position: relative;
  flex: 1 1 auto;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  text-align: left;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition:
          transform 0.18s ease,
          box-shadow 0.18s ease,
          border-color 0.18s ease;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
    border-color: rgba(62, 144, 158, 0.35);
  }

  &.active-layer {
    border: 2px solid variables.$tertiary;
    box-shadow:
            0 0 0 3px rgba(62, 144, 158, 0.14),
            0 0.75rem 1.5rem rgba(62, 144, 158, 0.18);
  }

  p {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    z-index: 1;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    max-width: calc(100% - 1rem);
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  img {
    width: 100%;
    height: 118px;
    display: block;
    background: #f8fafc;
    object-fit: contain;
    object-position: center;
    padding: 0.35rem;
  }

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  }
}

/* =========================================================
   CHART
========================================================= */

#chart {
  &.bb {
    svg {
      font: 12px "Open Sans", sans-serif;
    }

    .bb-chart-text {
      font: 11px "Open Sans", sans-serif;
    }

    .bb-axis-x path,
    .bb-axis-x line {
      stroke: #1e465f;
      stroke-width: 0.5px;
    }

    .bb-axis-y path,
    .bb-axis-y line,
    .bb-axis-y2 path,
    .bb-axis-y2 line {
      stroke: #1e465f;
      stroke-width: 0;
    }

    .bb-xgrid-focus {
      opacity: 0.6;
      stroke-width: 1rem;
      stroke: white !important;
    }

    .bb-line {
      stroke-width: 3px;
    }

    .bb-axis-x g,
    .bb-axis-y g,
    .bb-axis-y2 g,
    .bb-axis-y-label,
    .bb-axis-y2-label,
    .bb-axis-x-label {
      fill: #1e465f;
      font-size: 0.775rem;
      font-weight: 600;
    }

    .bb-legend-item-data text,
    .bb-legend-item {
      fill: variables.$primary;
      font-size: 0.725rem;
      font-weight: 600;
      text-transform: uppercase;
      margin-right: 2rem;
    }

    .bb-legend-item-tile {
      shape-rendering: auto;
      stroke-linecap: round;
      stroke-dasharray: 0.1 10;
      stroke-width: 12;
      transform: translate(6px, 1px);
    }

    text.bb-text {
      fill: #292929 !important;
      stroke: none;
      stroke-opacity: 1 !important;
      font-size: 0.775rem;
      font-weight: 600;
      opacity: 1;
    }

    .bb-tooltip-container {
      color: white;

      .bb-tooltip {
        background-color: rgba(0, 0, 0, 0.8);
        box-shadow: 7px 7px 12px -9px #ffffff61;
        opacity: 1;

        tr {
          border: 0;
        }

        th {
          background-color: unset;
          padding: 5px;
          font-weight: 600;
          text-align: left;
        }

        td {
          background-color: unset;
          border: 0;
        }
      }
    }

    .bb-grid line {
      stroke: #1e465f30;
      stroke-opacity: 1;
      stroke-dasharray: 0;
    }

    .bb-chart-lines .bb-circles .bb-circle {
      display: none;

      &._expanded_ {
        display: block;
      }
    }
  }
}

/* =========================================================
   NAVIGATION DES JOURS
========================================================= */

#nav-days-proba {
  display: flex;
  align-items: center;
  flex-direction: row;
  margin: 0;
  padding: 0;
  height: 60px;
  width: 100%;

  .inside {
    height: auto;
    width: 88%;
    margin: 0;
    overflow: hidden;
    text-align: left;

    #day-selector {
      display: flex;
      flex-wrap: nowrap;
      text-align: center;

      p {
        flex: 1 0 auto;
        margin: 1rem 0;
        padding: 0 10px;

        &:last-child {
          border-right: 0;
        }
      }
    }
  }

  //.go-down,
  //.go-up {
  //  width: 6%;
  //  height: 100%;
  //  padding: 0;
  //  vertical-align: top;
  //  text-align: center;
  //  font-size: 1.4rem;
  //  background: variables.$tertiary;
  //  line-height: 60px;
  //  color: #fff;
  //
  //  &:hover {
  //    background: #3f94ad;
  //    text-decoration: none;
  //    transition: all 0.3s ease-out;
  //  }
  //}
  .go-down,
  .go-up {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    background: variables.$dark;
    color: #ffffff;
    transition: all 0.3s ease-out;
    border-radius:50%;

    &:hover {
      background-color: lighten(variables.$dark, 10%);
    }

    p {
      text-align: center;
      width: 100%;
    }
  }

  @include media-breakpoint-down(sm) {
    .inside {
      margin: 0;
      padding: 0 !important;
      width: 100%;
      overflow-y: hidden !important;
      overflow-x: scroll !important;
      text-align: center;
    }

    .go-down,
    .go-up {
      display: none;
    }
  }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@include media-breakpoint-down(md) {
  .proba-map {
    height: 300px !important;
    min-height: 300px;
  }

  .proba-premium-thumbnails-grid .map-thumbnail,
  #thumbnails .map-thumbnail {
    p {
      top: 0.4rem;
      left: 0.4rem;
      right: 0.4rem;
      font-size: 0.66rem;
      padding: 0.3rem 0.48rem;
    }

    img {
      height: 102px;
      padding: 0.25rem;
    }
  }
}