@use "../vars";
@use "../case-tile-common/case-tile-vars" as cardVars;

@mixin buttonSvgStyles {
  &:hover {
    svg {
      .shaded {
        fill: #0481a0;
      }
    }
  }

  svg {
    height: 24px;
    width: 24px;

    .shaded {
      fill: #87c6db;
    }
  }
}

.case-card-view {
  margin: 5px 7px;
  padding: 2px;
  border-radius: 5px;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.3), 0 2px 0 rgba(255,255,255,0.8);
  left: 0;
  position: relative;
  width: calc(100% - 14px);

  &.animating {
    transition: left 0.3s ease-in-out;
  }

  &:first-child {
    border: solid 2px #cecece;
    box-shadow: none;
  }
  &.color-cycle-1 {
    background-color: cardVars.$color-cycle-1;
  }
  &.color-cycle-2 {
    background-color: cardVars.$color-cycle-2;
  }
  &.color-cycle-3 {
    background-color: cardVars.$color-cycle-3;
  }
  &.color-cycle-4 {
    background-color: cardVars.$color-cycle-4;
  }
  &.color-cycle-5 {
    background-color: cardVars.$color-cycle-5;
  }

  .case-card-view-header {
    align-items: center;
    background-color: white;
    border-radius: 4px 4px 0 0;
    display: flex;
    font-weight: 600;
    margin: 0 0 5px;
    overflow: hidden;
    padding: 3px;
    text-align: left;

    .case-card-view-title {
      background: white;
      flex-grow: 2;
      overflow: hidden;
      padding: 2px;
      width: 100%;

      .collection-title span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }

    .case-card-controls {
      align-items: center;
      display: flex;
      margin-right: 0;
      white-space: nowrap;

      .arrow {
        width: 20px;
        height: 20px;
        margin: 0 4px;
        border-radius: 5px;
        border: solid 1.5px vars.$charcoal-light-1-c;
        background-color: #f5fbfc;
        fill: #0592af;
        padding: 0;

        &:disabled {
          opacity: 0.35;
        }

        &.previous {
          svg {
            transform: rotate(90deg);
          }
        }
        &.next {
          svg {
            transform: rotate(-90deg);
          }
        }

        svg {
          width: 20px;
          height: 20px;
          position: relative;
          top: -1px;
          left: -1px;
        }
      }

      .caseIndex {
        font-weight: 500;
        font-stretch: normal;
        font-style: normal;
        line-height: normal;
        letter-spacing: normal;
        text-align: center;
      }
    }
    .add-case {
      align-items: center;
      display: flex;
      margin: 0 0 0 10px;
      width: 24px;

      button {
        height: 24px;
        margin-right: 5px;
        width: 24px;
        @include buttonSvgStyles
      }
    }
  }

  .case-card-attributes {
    overflow: hidden;
    position: relative;

    button.add-attribute {
      height: 24px;
      left: 0;
      position: absolute;
      top: 0;
      width: 24px;
      @include buttonSvgStyles
    }
  }
}
