@use '../global/common' as global;

.acms-banner-edit-item {
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 15px;
  background-color: global.$acms-color-white;
  border-radius: 3px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 10%);
}

.acms-banner-edit-item-wrap {
  margin-bottom: 15px;
}

.acms-banner-edit-item-source {
  padding-bottom: 0;
}

.acms-banner-edit-header {
  display: flex;
  padding: 5px 15px;
  color: global.$acms-color-white;
  background-color: global.$acms-color-system-gray60;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  transition: background-color 0.2s linear;

  > *:first-child {
    flex: 1;
  }
}

.acms-banner-edit-header-item {
  display: flex;

  > * {
    display: flex;
    align-items: center;
  }

  > * + * {
    margin-left: 5px;
  }
}

.acms-nested-item-header.acms-banner-edit {
  padding-left: 50px;
}

.acms-banner-edit-header-type-label {
  margin: 0;
  font-size: 13px;
  font-weight: bold;
  color: global.$acms-color-white;
}

.acms-banner-edit-container {
  padding: 15px;
  background-color: global.$acms-color-gray10;
}

.acms-banner-edit {
  padding: 10px;
  transition: opacity 0.2s linear;
}

.acms-banner-edit-item-inner {
  display: flex;
  padding-top: 10px;
}

.acms-banner-edit-item-thumb-wrap,
.acms-banner-edit-check-wrap {
  width: 240px;

  .acms-banner-img-wrap {
    box-sizing: border-box;
    min-height: 140px;
  }
}

.acms-banner-edit-item-thumb-wrap {
  flex: 3;
}

.acms-banner-edit-content {
  flex: 7;
  padding-left: 30px;
}

.acms-banner-edit-item-content {
  flex: 1;
}

.acms-banner-edit-item-title {
  margin: 0 0 5px;
  font-size: 14px;
}

.acms-banner-edit-item-btn-wrap {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.acms-banner-edit-btn-draggable {
  color: global.$acms-color-white;
}

.acms-banner-edit-remove-btn {
  width: 18px;
  height: 18px;
  padding: 2px;
  margin: 0;
  font-size: 10px;
  color: global.$acms-color-system-gray60;
  text-align: center;
  appearance: none;
  cursor: pointer;
  background: global.$acms-color-white;
  border: 0;
  border-radius: 50%;
}

.acms-banner-edit-figure {
  position: relative;
  box-sizing: border-box;
  padding-bottom: 100%;
  overflow: hidden;
  cursor: pointer;
  background-color: global.$acms-color-gray20;

  img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: transform 0.3s;
    transform: translate(-50%, -50%);
  }
}

.acms-banner-edit-table {
  th {
    min-width: 100px;
    text-align: right;
    vertical-align: top;
  }

  td,
  th {
    padding: 5px;
  }
}

.acms-banner-edit-source-table {
  td,
  th {
    padding: 0 5px;
  }
}

.acms-banner-edit-open-label {
  display: inline-block;
  margin-right: 20px;
  font-weight: bold;
  vertical-align: middle;
}

.acms-banner-edit-preview-wrap {
  position: relative;
  display: inline-block;
  min-width: 100px;
  padding: 4px;
  background-color: global.$acms-color-system-gray10;

  &:hover {
    .acms-banner-edit-preview-overlay {
      opacity: 1;
    }

    .acms-banner-edit-preview-remove-btn {
      opacity: 1;
    }

    .acms-banner-edit-preview-edit-btn {
      opacity: 1;
    }
  }

  .acms-banner-edit-preview {
    display: block;
    width: auto;
    min-width: 100px;
    max-width: 100%;
    height: auto;
    max-height: 250px;
  }
}

.acms-banner-edit-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0 0 0 / 40%);
  opacity: 0;
  transition: opacity 0.3s;
}

.acms-media-edit-btn.acms-banner-edit-preview-edit-btn {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 4px 8px;
  opacity: 0;
  transition: opacity 0.3s;

  @include global.font-size(11);
}

.acms-banner-edit-preview-remove-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: 32px;
  height: 32px;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s;

  &::before {
    transform: rotate(45deg);
    transform-origin: center;
  }

  &::after {
    transform: rotate(-45deg);
    transform-origin: center;
  }

  &::before,
  &::after {
    position: absolute;
    top: 14px;
    left: 8px;
    display: block;
    width: 15px;
    height: 1px;
    content: '';
    background-color: global.$acms-color-white;
  }
}

.acms-banner-edit-unit-box {
  position: relative;
  padding: 10px;
  background: global.$acms-color-system-gray20;
  border: 1px solid global.$acms-color-system-gray30;
  box-shadow: 0 1px 1px 0 rgb(0 0 0 / 10%);

  .acms-banner-edit-item-handle {
    color: global.$acms-color-black;
    vertical-align: middle;
  }
}

.acms-banner-edit-unit-box-inner {
  display: flex;
}

.acms-banner-edit-menu {
  display: flex;
  align-items: center;

  > * + * {
    margin-left: 15px;
  }
}

.acms-banner-edit-btn-group {
  display: flex;
  align-items: center;

  > * + * {
    margin-left: 5px;
  }
}

// ------------------------------
// ドロップエリア
// ------------------------------

.acms-banner-edit-droparea {
  padding: 35px 0;
  text-align: center;
  background-color: transparent;
  border: 1px dashed global.$acms-color-info80;
  transition: background-color 0.3s;
}

@include global.media-breakpoint-down(md) {
  .acms-banner-edit-item-inner {
    display: block;
  }

  .acms-banner-edit-item-thumb-wrap {
    width: auto;
  }

  .acms-banner-edit-content {
    padding-left: 0;
  }

  .acms-banner-edit-item {
    padding-left: 0;

    table,
    tbody,
    tr,
    td,
    th {
      display: block;
      text-align: left;
    }

    select {
      padding-top: 2px;
      padding-bottom: 2px;

      @include global.font-size(12);
    }
  }
}

// ------------------------------
// ステータスが非表示の場合
// ------------------------------

.acms-banner-edit-item-hide {
  .acms-banner-edit-header {
    background: global.$acms-color-system-gray50;
  }

  .acms-banner-edit {
    opacity: 0.66;
  }
}
