/* stylelint-disable custom-property-empty-line-before, declaration-empty-line-before */

.panels-layout {
  /** Side panels */
  --panels-layout-side-panel-width: 500px;
  --panels-layout-button-size: 38px;
  --panels-layout-actions-offset: 20px;
  --panels-layout-actions-offset-y: 10px;
  /** Tabs */
}

/* Panels layout actions */
.panels-layout .panels-layout-actions {
  position: absolute;
  right: var(--panels-layout-actions-offset);
  top: var(--panels-layout-actions-offset-y);
  display: flex;
  gap: 4px;
  z-index: 10;
}
.panels-layout .panels-layout-actions.fixed {
  position: fixed;
}
.panels-layout .panels-layout-actions-button {
  width: var(--panels-layout-button-size);
  height: var(--panels-layout-button-size);
  border-radius: 50%;
  background-color: var(--layout-theme-primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--common-animation-time);
  opacity: 0.5;
}
.panels-layout .panels-layout-actions-button:hover {
  opacity: 1;
}
.panels-layout .panels-layout-actions-button.activable > * {
  transition: all var(--common-animation-time);
}
.panels-layout .panels-layout-actions-button.activable.active > .icon-default,
.panels-layout .panels-layout-actions-button.activable:not(.active) > .icon-active {
  display: none;
}
.panels-layout .panels-layout-actions-button.turnaround {
  transform: rotate(-90deg);
}
.panels-layout .panels-layout-actions-button.turnaround.turned {
  transform: rotate(90deg);
}
.panels-layout .panels-layout-content {
  flex: 1;
}
.panels-layout .panels-layout-content.padded {
  margin: 20px auto;
}
.panels-layout .panels-layout-side:not(.hidden) {
  border-bottom: 1px solid var(--minor-border-color);
}

.panels-layout .panels-layout-container.padded {
  padding: 20px;
}
.panels-layout .panels-layout-vertical {
  display: flex;
  flex-direction: column;
}

.panels-layout .panels-layout-wrapper {
  position: relative;
  overflow: hidden;
}

/* Panels layout */
/* TODO: Make width adaptive depending on the screen size? */
/* TODO: To use vars for media queries? Eg, for `panels-layout-min-threshold`? */
@media (width < 700px) {
  .panels-layout .panels-layout-side.hidden {
    display: none;
  }
}
@media (width >= 700px) {
  .panels-layout .panels-layout-container.padded {
    padding: 20px;
  }
  .panels-layout .panels-layout-full {
    flex: 1;
  }
  .panels-layout .panels-layout-content.padded {
    margin: 20px;
  }
  .panels-layout .panels-layout-content {
    width: auto;
  }
  .panels-layout .panels-layout-side {
    border-bottom: none;
  }
  .panels-layout {
    position: fixed;
    overflow: hidden;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: stretch;
    flex-direction: row-reverse;
  }
  .panels-layout .panels-layout-container {
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
  }
  .panels-layout .panels-layout-main,
  .panels-layout .panels-layout-side {
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
  }
  .panels-layout .panels-layout-scrollable {
    overflow: auto;
  }
  .panels-layout .panels-layout-main {
    width: auto;
    flex: 1;
  }
  /* TODO: The animation effect based on panel width, so it requires to be fixed before use resize feature
  .panels-layout.has-panel .panels-layout-main {
    overflow: hidden;
    resize: horizontal;
  }
  */
  .panels-layout .panels-layout-side {
    transition: all var(--common-animation-time) ease-out;
    width: var(--panels-layout-side-panel-width);
    flex-shrink: 0;
    opacity: 1;
  }
  .panels-layout .panels-layout-side:not(.hidden).panels-layout-right {
    border-left: 1px solid var(--minor-border-color);
  }
  .panels-layout .panels-layout-side.hidden {
    opacity: 0;
    pointer-events: none;
  }
  .panels-layout .panels-layout-side.hidden.panels-layout-right {
    margin-right: calc(var(--panels-layout-side-panel-width) * -1);
  }

  .panels-layout .panels-layout-actions-button.turnaround {
    transform: rotate(0deg);
  }
  .panels-layout .panels-layout-actions-button.turnaround.turned {
    transform: rotate(180deg);
  }
}

/* Tabs */
.panels-layout .panels-layout-tabs {
  padding: 8px 20px;
  padding-bottom: 0;
  background-color: #f8f8f8;
  border-bottom: 1px solid #eee;
  display: flex;
  gap: 10px;
}
.panels-layout .panels-layout-tab {
  display: block;
  --panels-layout-tabs-radius: 6px;
  border-top-left-radius: var(--panels-layout-tabs-radius);
  border-top-right-radius: var(--panels-layout-tabs-radius);
  border: 1px solid #eee;
  border-bottom: none;
  padding: 8px 40px;
  cursor: pointer;
  --bg-color: #ddd;
  /* background-color: color.change(var(--bg-color), $alpha: .8); */
  background-color: var(--bg-color);
  color: var(--layout-theme-text-color);
  font-weight: bold;
  transition: all var(--common-animation-time);
  opacity: 0.5;
}
.panels-layout .panels-layout-tab i.fa {
  display: inline-block;
  opacity: 0.4;
  margin-right: 4px;
}
.panels-layout .panels-layout-tab.active {
  background-color: var(--layout-theme-primary-color);
  color: #fff;
}
.panels-layout .panels-layout-tab:hover {
  opacity: 1;
}
.panels-layout-tab-content:not(.panels-layout-tab-content-active) {
  display: none;
}
