@use "./vars";
$inspector-panel-width-very-narrow: 48px;
$inspector-panel-width-narrow: 64px;
$inspector-panel-width-medium: 72px;
$inspector-panel-width-wide: 80px;
$inspector-panel-border-width: 2px;

.inspector-panel {
  align-items: center;
  background-color: white;
  border: $inspector-panel-border-width solid vars.$focus-border-color;
  border-radius: 5px;
  box-shadow: rgba(0, 0, 0, 0.25) 0px 1px 3px 0px;
  display: flex;
  flex-direction: column;
  min-height: 50px;
  position: absolute;
  top: -$inspector-panel-border-width;
  z-index: 15;

  &.very-narrow {
    width: $inspector-panel-width-very-narrow;
    right: calc(-1 * $inspector-panel-width-very-narrow);
  }

  &.narrow {
    width: $inspector-panel-width-narrow;
    right: calc(-1 * $inspector-panel-width-narrow);
  }

  &.normal {
    width: $inspector-panel-width-medium;
    right: calc(-1 * $inspector-panel-width-medium);
  }

  &.wide {
    width: $inspector-panel-width-wide;
    right: calc(-1 * $inspector-panel-width-wide);
  }

  .inspector-tool-button {
    align-items: center;
    background-color: white;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    height: 52px;
    justify-content: space-between;
    padding-bottom: 7px;
    padding-top: 4px;
    width: 100%;

    &:active, &.active {
      background-color: #bfefff;
    }

    &:hover {
      background-color: #d3f4ff;
    }

    &.bottom {
      border-bottom-left-radius: 4px;
      border-bottom-right-radius: 4px;
      height: 56px;
      padding-bottom: 11px;
    }

    &.top {
      border-top-left-radius: 4px;
      border-top-right-radius: 4px;
      height: 56px;
      padding-top: 8px;

      &.bottom {
        height: 60px;
      }
    }

    .inspector-button-label {
      font-size: 14px;
      font-weight: 500;
    }

    &.inspector-tool-menu {
      span:not(.inspector-button-label) {
        align-items: center;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
      }
    }
  }
}

.codap-inspector-palette {
  background-color: #EEE;
  border: 0px #444 solid;
  position: absolute;
  inset: 0;
  width: fit-content;
  height: fit-content;
  font-family: "museo-sans", sans-serif;
  z-index: 5;
  font-size: 12px;
  min-width: 205px;
  min-height: 100px;
  font-weight: bold;

  .codap-inspector-palette-header {
    position: relative;
    top: 0;
    left: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    box-shadow: none;

    .codap-inspector-palette-icon-container {
      width: 30px;
      height: 30px;
      background-color: vars.$teal-dark;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .codap-inspector-palette-header-title {
      border-bottom: solid #C1C5C7 1px;
      border-left: solid #C1C5C7 1px;
      padding-left: 5px;
      width: calc(100% - vars.$header-height);
      height: vars.$header-height;
      font-size: 12px;
      line-height: vars.$header-height;
    }
  }

  .palette-form {
    position: relative;
    left: 0;
    padding: 5px 10px 10px 10px;
    background-color: #EEE;
    height: fit-content;
    z-index: 20;

    .chakra-form-control {
      margin: 3px 0;
    }

    .palette-row {
      flex-direction: row;
      align-items: center;
      height: 20px;
      white-space: nowrap;

      &.color-picker-row {
        display: flex;
        flex-direction: row;
        height: 30px;
        justify-content: space-between;
        padding-right: 5px;
        margin: 4px 0;
      }
    }

    .form-title {
      font-family: "museo-sans", sans-serif !important;
      font-size: 12px;
    }

    .form-label {
      align-items: center;
      display: flex;
      flex-direction: row;
      white-space: nowrap;
      &.color-picker {
        margin-right: 4px;
        &.color {
          margin-right: 8px;
        }
      }
    }

    .palette-checkbox {
      height: 20px;
      width: 180px;
      margin: 2px 0;
    }

    .chakra-radio__control {
      border-color: #cfcfcf;
    }

    [data-checked] {
      border-color: #3182ce;
    }

    .inline-input-group {
      background: rgba(231, 231, 231, 0.7);
      display: flex;
      flex-direction: row;

      .form-label {
        align-items: center;
        display: flex;
        flex-grow: 3;
        margin: 0 10px 0 0;
      }
      .form-input {
        background: white;
        display: inline-block;
        font-size: 12px;
        margin-right: 10px;
        width: 40px;
      }
    }
  }
}

.palette-pointer {
  position: absolute;
  z-index: 10;

  &.arrow-left {
    left: calc($inspector-panel-width-medium - 10px);
    border-top: 25px solid transparent;
    border-bottom: 25px solid transparent;
    border-right: 22px solid #EEE;
  }
  &.arrow-right {
    right: calc($inspector-panel-width-medium - 10px);
    border-top: 25px solid transparent;
    border-bottom: 25px solid transparent;
    border-left: 22px solid #EEE;
  }
}
