/*!
 * ADAM: Wivern extension
 * Created by the MEEO developers <info@meeo.it>
 */

/* ==========================================================================
   Wivern general styling
   ========================================================================== */

/* Theming
   ========================================================================== */

:root {
  --adam-accent-color: #00284b !important;
  --adam-accent-hover-color: #2a4d65 !important;
  --wivern-top-spacing: 12rem;
  --wivern-canvas-width: 50vw;
  --wivern-sidebar-width: 50vw;
}

/* Required ADAM overrides
   ========================================================================== */

/* Globe */
#canvasOne {
  position: absolute !important;
  width: 100% !important;
  height: 100% !important;
}

/* Controller/Dataset-Wrapper */
#gis_bar,
#gis_controller {
  position: absolute !important;
}

#gis_bar {
  bottom: 62vh !important;
  right: 98vw !important;
}

#gis_controller {
  top: 17rem !important;
  left: 4vw !important;
}

.adam-colorlegend_container {
  position: absolute;
  top: 24rem;
  right: 98vw !important;
}

#dataset_container_wrapper {
  bottom: 30px;
}

/* Mixed */
#has-sidebar-main,
#canvasOne-container {
  position: relative !important;
  height: 100vh !important;
}

#has-sidebar-main #canvasOne {
  transition: width 0.2s;
}

/* Navbar */
#nav-container-h {
  background: var(--main-bg-color);
  border-bottom: 1px solid var(--main-border-color);
  top: 0;
  width: 100vw;
  height: 50px;
  border-radius: 0;
}

.navbar-brand {
  padding: 0;
}

#steps-panel {
  position: absolute;
  width: 200px;
  height: 150px;
  left: 2px;
  top: 5.1rem;
  background-color: #000000;
  border-radius: 0.5rem;
  border: 2px solid var(--main-border-color);
}

#steps-panel li {
  cursor: pointer;
}

#steps-panel li:hover {
  color: #63a9d3;
}

#steps-panel li.step-active {
  color: #63a9d3;
  pointer-events: none;
}

/* Footer-Sidebar
   ========================================================================== */

#footer-sidebar-wrapper {
  position: absolute;
  bottom: 0;
  right: 0;
}

#footer-sidebar {
  position: absolute;
  width: 80vw;
  height: auto;
  right: 10px;
  bottom: 77px;
  border: 2px solid var(--main-border-color);
  border-radius: 0.5rem;
  background-color: #121212e0;
}

#footer-sidebar .opener-add {
  position: absolute;
  top: -0.75rem;
  left: -0.75rem;
  padding: 0.3rem;
  display: block;
  width: 25px;
  height: 25px;
  background-color: var(--main-bg-color-hover);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border: 2px solid var(--main-border-color);
  border-radius: 0.5rem;
  font-size: 0.775rem;
  cursor: pointer;
}

/* Sidebar-Button */

#sidebar-trigger {
  position: absolute;
  width: 2.5rem;
  height: 2.5rem;
  text-align: center;
  line-height: 2.4;
  cursor: pointer;
  text-align: center;
  bottom: 30px;
  right: 10px;
}

/* Controls-Panel */

.controls-panel {
  position: absolute;
  bottom: 30px;
  height: 2.5rem;
  width: 300px;
  right: 55px;
  border: 2px solid var(--main-border-color);
  border-radius: 0.5rem;
  padding: 0.5rem 0.4rem;
  background-color: #121212e0;
  padding: 5px;
}

.controls-speed-button,
.controls-button {
  display: block;
  width: 2.5rem;
  height: 1.6rem;
  text-align: center;
  line-height: 2.4;
  cursor: pointer;
  border: 1px solid var(--adam-accent-color);
  border-radius: 5px;
  margin-left: 8px;
  margin-right: 8px;
  font-size: 10px;
}

.controls-button:hover,
.speed-active,
.active {
  background: var(--adam-accent-hover-color);
}

.controls-button.active {
  pointer-events: none;
}

/* Product-Showcase */

.product-showcase {
  width: 330px;
  height: 120px;
  padding: 0.5rem 0.4rem;
  border: 2px solid var(--main-border-color);
  border-radius: 0.5rem;
  background-color: var(--main-bg-color);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.product-showcase .opener-image,
.product-showcase .opener-image > img {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  height: 96px;
  min-height: 96px;
  max-height: 96px;
  background: var(--anomaly-card-image);
  border-radius: 0.25rem;
}
.product-showcase .opener-image > img {
  height: 100%;
  object-fit: contain;
  opacity: 1;
}
.product-showcase .opener-image > span {
  font-size: 1.25rem;
  padding: 0.6rem 0.55rem;
}

.product-showcase .opener-details {
  position: relative;
}

.product-showcase .opener-subtitle {
  margin-top: 10px;
}

.product-showcase .opener-min,
.product-showcase .opener-max {
  width: auto;
  padding: 0 0.2rem;
  font-size: 0.8rem;
}

.product-showcase .opener-colortable {
  width: 200px;
  height: 7px;
  padding: 0 5px;
}

.magic-ct img {
  width: 100%;
  height: 20px;
}

.ct-min-value {
  margin-left: 15px;
}

.ct-max-value {
  margin-right: 15px;
}

.product-showcase .remove-showcase {
  left: -0.5rem;
  padding: 0.3rem;
}

.product-showcase .remove-showcase {
  position: absolute;
  top: -0.75rem;
  display: block;
  width: 25px;
  height: 25px;
  background-color: var(--main-bg-color-hover);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border: 2px solid var(--main-border-color);
  border-radius: 0.5rem;
  font-size: 0.775rem;
  cursor: pointer;
}

/* Panel */
#panel-sidebar .container-panel .sb-item-panel {
  color: #fafafa;
  background: #0f0f0f;
  width: 100%;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid var(--main-border-color);
  transition: border-color 0.3s, color 0.1s;
}

#panel-sidebar .container-panel .sb-item-panel.panel-running {
  color: #6c757d;
  user-select: none;
  animation: border-pulsate 0.8s infinite;
}

#panel-sidebar .container-panel .sb-item-panel.highlighted {
  border-color: var(--warning) !important;
}

#panel-sidebar .container-panel .sb-item-panel.panel-running-error {
  border-color: var(--red);
}

#panel-sidebar .container-panel .sb-item-panel .wivern-row {
  padding-bottom: 12px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

#panel-sidebar .container-panel .sb-item-panel .wivern-row:hover {
  border-color: var(--adam-accent-hover-color);
}

@keyframes border-pulsate {
  0% {
    border-color: var(--adam-accent-color);
  }
  50% {
    border-color: var(--main-border-color);
  }
  100% {
    border-color: var(--adam-accent-color);
  }
}

/* Plotly wrapper */
#panel-sidebar .container-panel .sb-item-panel .panel-plot {
  transition: filter 0.2s;
}

#panel-sidebar .container-panel .sb-item-panel .panel-plot.plot-running {
  filter: brightness(70%) grayscale(100%);
}

/* Hide scrollbar for Chrome, Safari and Opera */
.super-row::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.super-row {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* Products-Modal
   ========================================================================== */

#products-modal {
  z-index: 9999;
}

#products-modal .modal-dialog {
  min-width: unset;
  width: 1300px;
  max-width: unset;
  min-height: unset;
  height: 890px;
  max-height: unset;
}

#products-modal .modal-content {
  background-color: var(--main-bg-color);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
}

#products-modal .modal-header,
#products-modal .modal-body {
  background-color: transparent;
}

#products-modal .dataset-counter {
  font-size: 0.775rem;
}

#products-modal .filters-title {
  font-size: 1rem;
}
#products-modal .filter-label {
  font-size: 0.75rem;
  height: 0.875rem;
}
#products-modal .filter-counter {
  opacity: 0.5;
}
#products-modal .filter-disabled {
  pointer-events: none;
  opacity: 0.5;
}
#products-modal .filter-hide {
  display: none;
}

#products-modal .product-row {
  max-height: 830px;
  overflow: hidden auto;
}

#products-modal .product-card {
  -ms-flex: 0 0 25%;
  flex: 0 0 22.5%;
  max-width: 22.5%;
  height: 255px;
  background-color: var(--anomaly-card-bg-hover) !important;
  border-radius: 0.3rem 0.3rem 0.25rem 0.25rem !important;
  border: 1px solid var(--secondary-border-color) !important;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}
#products-modal .product-card:hover {
  background-color: var(--anomaly-card-bg) !important;
}

#products-modal .product-card.selected {
  border: 1px solid var(--adam-accent-color) !important;
  cursor: default;
  pointer-events: none;
}

#products-modal .product-card .card-image-container {
  position: relative;
  height: 5rem;
  background-color: var(--anomaly-card-image);
  border-radius: 0.25rem 0.25rem 0 0;
}

#products-modal .product-card .card-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: auto;
  min-width: unset;
  max-width: 100%;
  height: auto;
  min-height: unset;
  max-height: 100%;
}

#products-modal .card-id {
  font-size: 0.75rem;
  max-width: 100%;
}

#products-modal .product-details-row {
  font-size: 0.875rem;
}

/* Orbit-Panel
   ========================================================================== */

#orbit-panel {
  position: absolute;
  top: 8rem;
  width: 20rem;
  left: 0.2rem;
  border-radius: var(--adam-border-radius);
  border: 1px solid var(--main-border-color);
  background-color: var(--adam-accent-hover-color);
  transition: width 0.2s ease-in-out;
}

#orbit_panel.reduced {
  width: 2vw;
}

#orbit-panel .orbit-panel-hider {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  cursor: pointer;
}

#orbit_panel.reduced #map-orbit-panel {
  display: none !important;
}

#map-orbit-panel {
  height: 150px;
  border-bottom-right-radius: var(--adam-border-radius);
  border-bottom-left-radius: var(--adam-border-radius);
}

/* Temporalbar
   ========================================================================== */

#temporal_bar {
  display: none;
}

/* Media queries
   ========================================================================== */

@media screen and (max-width: 1200px) {
  #has-sidebar-main.triggered,
  #has-sidebar-main.triggered #canvasOne {
    width: var(--wivern-canvas-width) !important;
  }

  #panel-sidebar.triggered {
    width: var(--wivern-sidebar-width);
  }
}

@media screen and (max-width: 992px) {
  #nav-container-h {
    padding: 0;
    height: var(--wivern-top-spacing);
  }

  #has-sidebar-main.triggered,
  #has-sidebar-main.triggered #canvasOne {
    width: 0 !important;
  }

  #panel-sidebar.triggered {
    width: 100%;
    position: absolute !important;
    z-index: 4090;
    top: var(--wivern-top-spacing);
  }

  #sidebar-trigger {
    position: fixed;
    z-index: 4090;
    top: calc(var(--wivern-top-spacing) + 10px);
  }

  #sidebar-trigger.triggered {
    left: 0.8rem;
  }
}
