@import (multiple, reference, optional) '../../theme.config';

@type: extra;
@element: custom;

@grey-1: #f9f9f9;

.enlarge-modal.ui.modal {
  width: 95% !important;
  height: 85%;
  overflow-y: auto;

  .close.icon {
    top: 1rem;
    right: 1rem;
    width: 24px !important;
    height: 24px;
    padding: 0;

    > i {
      font-size: 24px;
    }
  }

  .content {
    .js-plotly-plot {
      width: 100%;
      height: 100%;
    }
  }
}

.visualization-toolbar,
.legend-toolbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;

  .left-col {
    > *:not(:last-child)::after {
      width: 1px;
      margin: 4px 0;
      background-color: @textColor;
      content: '';
    }
  }

  .left-col,
  .right-col {
    display: flex;
    align-items: center;
    column-gap: 1rem;

    > * {
      display: flex;
      height: 100%;
      align-items: stretch;
      column-gap: 1rem;
    }
  }

  .trigger-button {
    display: inline-flex;
    align-items: center;
    padding: 0;
    padding-bottom: 3px;
    border: none;
    background-color: transparent;
    color: @textColor;
    column-gap: 0.25rem;
    cursor: pointer;
    line-height: 1.5;

    &:hover {
      color: @secondaryColor;
    }

    &.open {
      padding-bottom: 0;
      border-bottom: 3px solid @secondaryColor;
      color: @secondaryColor;
    }

    i {
      line-height: 1;
    }
  }
}

.legend-toolbar {
  display: block;

  &:not(.open) {
    margin-bottom: 0.25rem;
  }

  .trigger-button {
    position: relative;
    z-index: 1;

    &.open {
      margin-bottom: 0.5rem;
    }
  }
}

#vis-toolbar-popup {
  .ui.popup {
    padding-right: 1rem;
    padding-left: 1rem;
    background-color: @grey-1;
    box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px;

    &::before {
      background-color: @grey-1;
    }
  }

  &.figure-note-popup,
  &.sources-popup {
    .ui.popup {
      min-width: 600px;

      @media screen and (max-width: @largestMobileScreen) {
        min-width: 300px;
      }
    }
  }

  &.sources-popup {
    .sources-list {
      margin: 0;
      list-style: decimal inside;
      padding-inline-start: 0;
    }
  }

  .item {
    margin-bottom: 0.75rem;
  }

  .label {
    display: block;
    margin-bottom: 0.5rem;
  }

  .control {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;

    > * {
      display: flex;
      margin: 0;
    }
  }

  .types {
    display: flex;
    column-gap: 1rem;

    > *:not(:last-child)::after {
      display: block;
      width: 1px;
      height: 100%;
      background-color: @textColor;
      content: '';
    }

    .type {
      display: flex;
      column-gap: 1rem;
    }

    button {
      display: inline-flex;
      align-items: center;
      padding: 0;
      border: none;
      background-color: transparent;
      color: @linkColor;
      cursor: pointer;

      &:hover {
        color: @linkHoverColor;
        text-decoration: @linkHoverUnderline;
      }
    }
  }
}

.visualization-toolbar.mobile {
  flex-flow: column;
  align-items: center;
  row-gap: 0.5rem;

  .right-col {
    .trigger-button {
      flex-flow: column;
    }
  }
}

@media print {
  .visualization-toolbar {
    display: none;
  }
}
