@import "../../constants/index.scss";

.carouselElement {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin-right: 8px;

  &:last-child {
    margin-right: 0;
  }

  width: 200px;
  &Image {
    width: 100%;
    min-height: 100px;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid $border-color;
    border: 1px solid #ddd;
    margin-bottom: -4px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    &:not(:empty) {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      font-size: 12px;
      background-color: #fff;
      margin-bottom: 0;
    }

    &.darkMode {
      border-bottom: none;
    }
  }

  &Text {
    overflow: hidden;
    background-color: #fff;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    text-align: left;
    padding: 8px;
    line-height: 1.5;

    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;

    &:empty {
      padding: 0;
      border: none;
    }

    &.withActionables {
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
    }

    &TitleWrapper {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    &Title {
      font-size: 13px;
      flex: 2;
      overflow: hidden;
      text-overflow: ellipsis;
      padding: 0;
    }

    &Metadata {
      text-align: right;
      font-size: 12px;
      opacity: 0.7;
      flex: 1;
      padding-left: 12px;
      &:empty {
        padding-left: 0;
      }
    }

    &Subtitle {
      font-weight: 700;
      margin-bottom: 6px;
      font-size: 12px;
      display: block;
      &:last-child {
        margin-bottom: 0;
      }
    }

    &Description {
      display: block;
      font-size: 12px;
      opacity: 0.7;
      position: relative;
      left: -1px;
      padding: 0 !important;
      box-shadow: none !important;
      white-space: pre-wrap;
    }
  }

  &Actionables {
    border: 1px solid #ddd;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
    &:empty {
      padding: 0;
      border: none;
    }
  }

  &Actionable {
    padding: 8px;
    margin-right: 0;
    background-color: #fff;
    color: $primary-color;
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
    text-align: center;
    &:last-child {
      border-bottom: none;
    }

    &Title {
      font-size: 12px;
    }

    &Subtitle {
      color: #666;
      font-size: 10px;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  .miniActionable {
    position: relative;
    margin-left: -8px;
    transform: translateY(-50%);
    button {
      margin: 0 auto;
      font-size: 14px;
      font-weight: 500;
    }
  }
}
