/*
 * Copyright 2023 Harness, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

.box {
  background: var(--white) !important;
  box-shadow: var(--elevation-2);
  border-radius: 4px;
  padding: var(--spacing-xlarge) var(--spacing-large) !important;

  &.desc {
    padding: var(--spacing-xlarge) !important;

    .mdWrapper {
      position: relative;
      padding-right: var(--spacing-large) !important;

      .menuWrapper {
        position: absolute;
        top: -10px;
        right: -10px;
        display: inline-block;
      }
    }

    :global {
      .task-list-item,
      .task-list-item input {
        cursor: pointer;
      }
    }
  }
}

.selectButton {
  :global {
    .bp3-input {
      border: unset !important;
      background: inherit !important;
      font-weight: 600 !important;
      color: var(--grey-800);
    }

    .bp3-input-action:last-child {
      right: 10% !important;
    }
  }
}

.timeButton {
  line-height: 32px !important;
  height: 32px;
  cursor: pointer;
}

.timeButton:hover {
  box-shadow: unset !important;
}

.timeText {
  margin-left: 8px !important;
  color: var(--grey-400);
  font-size: var(--font-size-small);
}

.sortContainer {
  border-bottom: 1px solid var(--grey-200);
  margin-bottom: var(--spacing-small) !important;
}

.descContainer {
  --layout-spacing: 0 !important;
  padding-top: var(--spacing-small) !important;
  padding-bottom: var(--spacing-medium) !important;
}

.ascContainer {
  --layout-spacing: 0 !important;
  padding-top: var(--spacing-small) !important;
  padding-bottom: var(--spacing-small) !important;
}

.commentBox {
  box-shadow: 0px 2px 3px 0px #60617029, 0px 0px 3px 0px #28293d14 !important;
  border-radius: 4px;

  .commentEditor {
    background-color: var(--grey-100) !important;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }
}

.threadbox {
  box-shadow: 0px 2px 3px 0px #60617029, 0px 0px 3px 0px #28293d14 !important;
  border-radius: 4px;
}

.sortDropdown {
  .bp3-popover-wrapper {
    width: 200px;
    min-width: 200px;
  }
}

.mergedBox {
  padding-top: var(--spacing-xsmall) !important;
  padding-bottom: var(--spacing-xsmall) !important;
}

.mergeContainer {
  border-radius: 4px;
  background: #e8e8ff !important;
  padding: 2px 5px !important;
}

/* TODO: This styling per design is too white */
.descBox {
  box-shadow: 0px 0px 1px rgba(40, 41, 61, 0.08), 0px 0.5px 2px rgba(96, 97, 112, 0.16);
  border-radius: 4px;
  padding: var(--spacing-xlarge) var(--spacing-large) !important;
}

.snapshot {
  --border-color: var(--grey-200);
  --radius: 4px;
  margin-top: var(--spacing-small) !important;

  :global {
    .d2h-code-linenumber {
      cursor: default;
      display: flex;
      flex-direction: row-reverse;

      .annotation-for-line {
        display: none;
      }
    }
  }

  .title {
    background-color: var(--grey-100);
    padding: 5px 10px 5px 10px;
    border: 1px solid var(--border-color);
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);

    .fname a {
      font-size: 13px !important;
      font-weight: 600 !important;
      color: var(--grey-900) !important;
      display: inline;
    }
  }

  .snapshotContent {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);

    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);

    :global {
      .d2h-file-header {
        display: none;
      }

      .d2h-wrapper > div {
        margin-bottom: 0;
      }

      .d2h-file-wrapper {
        border: 0;
      }

      .d2h-diff-tbody,
      .d2h-diff-tbody tr:last-of-type td:last-of-type {
        border-bottom-left-radius: var(--radius);
        border-bottom-right-radius: var(--radius);
      }

      .d2h-code-side-linenumber {
        border-left: 0;
      }

      .d2h-code-side-linenumber {
        width: 56px;
      }

      tr {
        td:first-of-type {
          z-index: 2;
        }

        td:last-of-type > div {
          z-index: 0;
        }
      }
    }
  }

  div[data-annotation-for-line] {
    display: none !important;
  }
}

.hideDottedLine {
  z-index: 3;
}

.refreshIcon {
  padding-left: var(--spacing-xsmall) !important;
  padding-right: var(--spacing-xsmall);
}

.optionMenuIcon {
  > .bp3-icon {
    padding-right: var(--spacing-xlarge);
  }
}

.repeatBtn:hover {
  box-shadow: 0px 0px 1px rgba(40, 41, 61, 0.04), 0px 2px 4px rgba(96, 97, 112, 0.16) !important;
}

.repeatBtn {
  margin-left: var(--spacing-xsmall) !important;
  padding: 5px 1px !important;
  background-color: var(--orange-100) !important;
  color: #c05809 !important;
  --background-color-hover: var(--grey-50) !important;
  --background-color-active: var(--grey-100) !important;
  --border: none !important;
  --padding: 12px;
  --icon-padding: 4px;
  --font-size: 13px;
  --font-weight: 500;
  min-height: 24px !important;
  height: 24px !important;

  .bp3-button-text {
    color: var(--orange-300);
  }
}

.commitLink {
  text-decoration: underline;
  color: var(--primary-7) !important;
}

.commitContainer {
  padding-top: 1px;
}

.popover {
  :global {
    .bp3-popover-content {
      padding: var(--spacing-medium);
      max-width: 700px;
      word-break: break-all;
    }
  }
}

.popoverDescriptionbox {
  :global {
    .bp3-popover-content {
      padding: var(--spacing-small);
      max-width: 700px;
      word-break: break-word;
    }
  }
}

.copyButton {
  --button-height: 14px !important;
}

.textPadding {
  padding-left: var(--spacing-xsmall);
  padding-right: var(--spacing-xsmall);
}

.rightTextPadding {
  padding-right: var(--spacing-xsmall);
}

.aidaIcon {
  :global(> svg) {
    border-radius: 4px !important;
    background: linear-gradient(317deg, #5e2ce0 11.36%, #a652f9 79.62%) !important;
    padding: 2px !important;
  }
}
