/*
 * 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.
 */

.main {
  --bar-height: 60px;

  background-color: var(--green-50) !important;
  margin: -24px -24px 0 !important;
  position: sticky;
  top: 0;
  z-index: 4;

  &.merged {
    border-color: transparent !important;
    background: #e8e8ff !important;
  }

  &.error {
    background-color: var(--red-50) !important;
  }

  &.ruleViolation {
    background-color: var(--red-50) !important;
  }

  &.closed {
    background-color: var(--grey-100) !important;
  }

  &.draft {
    background-color: var(--orange-100) !important;
  }

  &.unchecked {
    background-color: var(--orange-50) !important; // Note: No UICore color variable for this background
  }

  .layout {
    height: var(--bar-height);
    padding: 0 var(--spacing-xlarge) !important;

    .secondaryButton,
    [class*='Button--variation-tertiary'] {
      --box-shadow: 0px 0px 1px rgba(40, 41, 61, 0.04), 0px 2px 4px rgba(96, 97, 112, 0.16) !important;
    }
  }

  .btn {
    background-color: var(--green-800) !important;
    color: var(--white) !important;
  }

  .heading {
    font-weight: 600 !important;
    font-size: 16px !important;
    line-height: 24px !important;
    color: var(--grey-700) !important;
  }

  .sub {
    font-weight: 600 !important;
    font-size: 13px !important;
    line-height: 20px !important;
    color: var(--green-800) !important;

    &.closed {
      color: var(--grey-600) !important;
    }

    &.merged {
      color: var(--purple-700) !important;
    }

    &.draft {
      color: var(--orange-900) !important;
    }

    &.unmergeable {
      color: var(--red-500) !important;
    }

    &.unchecked {
      color: #c05809 !important; // Note: No UICore color variable for this text
    }
    &.ruleViolate {
      color: var(--red-500) !important;
    }
  }
}

.popover {
  transform: translateY(5px) !important;

  .menuItem {
    strong {
      display: inline-block;
      margin-left: 10px;
    }

    p {
      font-size: 13px;
      padding-left: 27px;
      line-height: 16px;
      margin: 5px 0;
      max-width: 320px;
      white-space: break-spaces !important;
    }
  }
  .menuReviewItem {
    strong {
      display: inline-block;
      margin-left: 10px;
    }

    p {
      font-size: 13px;
      padding-left: 2px;
      line-height: 16px;
      margin: 0px 1px;
      max-width: 320px;
    }
  }
}

.btnWrapper {
  &.hasRuleViolated.bypass button {
    --background-color: var(--red-500) !important;
    --background-color-hover: var(--red-600) !important;
    --background-color-active: var(--red-800) !important;
    --text-color: var(--white) !important;
  }

  &.hasRuleViolated button {
    --background-color: var(--grey-50) !important;
    --background-color-hover: var(--white) !important;
    --background-color-active: var(--grey-100) !important;
  }

  &.hasRuleViolated a {
    --background-color: var(--grey-50) !important;
    --background-color-hover: var(--white) !important;
    --background-color-active: var(--grey-100) !important;
  }

  &.disabled {
    pointer-events: none;
    opacity: 0.5;
  }

  &.hasError button {
    --background-color: var(--grey-50) !important;
    --background-color-hover: var(--white) !important;
    --background-color-active: var(--grey-100) !important;
  }

  &.disabled {
    pointer-events: none;
    opacity: 0.5;
  }

  a,
  button {
    --background-color: var(--green-800) !important;
    --background-color-hover: var(--green-900) !important;
    --background-color-active: var(--green-900) !important;
  }
}

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

.viewDetailsBtn {
  margin-bottom: 3px !important;
}

.checkbox {
  padding-top: 8px !important;
  padding-right: var(--spacing-medium) !important;
}
