/*
SPDX-FileCopyrightText: German Aerospace Center (DLR) <cosmoscout@dlr.de>
SPDX-License-Identifier: MIT
*/

#sidebar {
  grid-area: sidebar;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 1) 50px),
    linear-gradient(180deg, rgba(0, 0, 0, 0) calc(100% - 30px), rgba(0, 0, 0, 1) 100%);
  -webkit-mask-composite: xor;
}

/* Shrink-to-left-side functionality ------------------------------------------------------------ */

#sidebar .sidebar-tab>.section-header,
#sidebar .sidebar-tab>.section-body {
  width: 50px;
  overflow: hidden;
  transition: width 0.3s ease, height 0.3s ease;
}

#sidebar .sidebar-tab>.section-header:not(.collapsed),
#sidebar .sidebar-tab:hover>.section-header,
#sidebar .sidebar-tab>.section-header:not(.collapsed)+.section-body,
#sidebar .sidebar-tab:hover>.section-header+.section-body {
  width: 450px;
}

#sidebar .sidebar-tab>.section-header span {
  opacity: 0;
  transition: opacity 0.1s linear;
}

#sidebar .sidebar-tab>.section-header:not(.collapsed) span,
#sidebar .sidebar-tab:hover>.section-header span {
  transition-delay: 0.2s;
  transition-duration: 0.3s;
  opacity: 1;
}


/* Sidebar styling ------------------------------------------------------------------------------ */

#sidebar .container-fluid>*:first-child {
  padding-top: 10px;
}

#sidebar .container-fluid>*:last-child {
  padding-bottom: 10px;
}

#sidebar-accordion {
  padding: 50px 0;
}

#sidebar::-webkit-scrollbar {
  display: none;
}

#sidebar .sidebar-tab {
  margin-bottom: 10px;
  margin-right: 10px;
  background-color: var(--cs-color-background-dark);
  border-top-right-radius: var(--cs-border-radius-large);
  border-bottom-right-radius: var(--cs-border-radius-large);
  overflow: hidden;
  border-bottom: 2px solid var(--cs-color-primary);
  border-top: 2px solid var(--cs-color-primary);
  box-shadow: var(--cs-box-shadow-medium);
  width: fit-content;
}

#sidebar .sidebar-tab>.section-header i {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 0 0 70% 0;
  padding: 4px 15px 4px 10px;
  transition: all 0.2s ease;
}

#sidebar .sidebar-tab>.section-header:not(.collapsed) i,
#sidebar .sidebar-tab:hover>.section-header i {
  color: black;
  text-shadow: none;
  background-color: var(--cs-color-primary);
  top: -15px;
  font-size: 3rem;
}

#sidebar .sidebar-tab>.section-header {
  text-align: center;
}

#sidebar .section-header {
  position: relative;
  padding: 4px 10px;
  font-family: 'AlegreyaSansSC', sans-serif;
  overflow-x: hidden;
  font-size: 1.8rem;
  text-overflow: clip;
  white-space: nowrap;
}

#sidebar .section-header span {
  padding-top: 2px;
  position: relative;
  top: 2px;
}

#sidebar .section-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

#sidebar .section-header:active {
  top: 1px;
}

#sidebar *[type=button] {
  -webkit-appearance: none;
}

/* Setting Sections ----------------------------------------------------------------------------- */

#sidebar .settings-section .section-header {
  font-size: 1.5rem;
}

#sidebar .settings-section .section-header span {
  padding-left: 20px;
}

#sidebar .settings-section .section-header .caret-icon {
  position: absolute;
  right: 5px;
  transform: rotate(0deg);
  transition: 100ms transform;
}

#sidebar .settings-section .section-header:not(.collapsed) .caret-icon {
  transform: rotate(-90deg);
}

#sidebar .settings-section {
  border-style: dashed;
  border-width: 1px 0 0 0;
  border-color: var(--cs-color-background-lightest)
}