@use '../../abstracts/variables' as *;

// -----------------------------------------------------------------------------
// Question Panel: admin table for managing lesson items
// Page: #page-mod-minilesson-rsquestion-rsquestions
// -----------------------------------------------------------------------------

// Add item link boxes (additemlink.mustache)
.mod_minilesson_link_box {
  border: 1px solid $black;
  display: inline-block;
  width: 150px;
  height: 120px;
  vertical-align: top;
  margin: 10px;
  position: relative;
  background-size: 50%;
  background-repeat: no-repeat;
  background-position: center 10px;
  cursor: pointer;

  &:hover {
    background-color: $grey-100;
  }
}

.mod_minilesson_link_box_title {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  text-align: center;
  margin: 5px;
}

// Page-scoped overrides
#page-mod-minilesson-rsquestion-rsquestions {

  .additembutton {
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 10px;
    font-size: 17px;
    background-color: $primary;

    &:hover,
    &:active {
      background-color: $primary-hover;
      box-shadow: unset;
      outline: 0;
    }
  }

  .noitemyet {
    margin-top: 5px;
    margin-bottom: 15px;
  }
}

#page-mod-minilesson-rsquestion-rsquestions .mod_minilesson_qpanel {

  td .itemname {
    color: $text;
    font-weight: 500;
    line-height: 100%;
    font-size: 15px;
    letter-spacing: 0;
  }

  td .itemtype:not(.mobileviewtype) {
    color: $text-slate;
  }

  td.itemaction {
    vertical-align: middle;

    .icon {
      color: $text-slate;
    }

    .mod_minilesson_item_row_deletelink .icon {
      color: $error;
    }
  }

  td .itemicon {
    width: 30px;
    height: 30px;
    object-fit: contain;
  }
}

// Table base styles
.mod_minilesson_qpanel {
  --bs-border-color: #{$grey-border-light};
  --bs-border-width: 1px;
  border-collapse: separate !important;
  border-spacing: 0 15px !important;
  width: 100% !important;
  border-bottom: 0 !important;

  thead tr th {
    border: 0 !important;
    padding: 0 !important;
  }

  td {
    background: $primary-ghost;
    padding: 12px 16px;
  }

  tr td:first-child,
  tr th:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    width: 88%;
    vertical-align: middle;
  }

  tr td:last-child,
  tr th:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    text-align: right;
    width: 5%;
    min-width: 110px;
    max-width: 130px;
  }

  tr th:last-child {
    text-align: right;
    padding-right: 30px !important;
  }

  .mod_minilesson_item_row td.c2,
  .mod_minilesson_item_row th.c2 {
    width: 11%;
    text-align: right;
  }

  .tblheader {

    .theadselectall {
      display: flex;
      align-items: center;
      padding-left: 15px;
    }

    .selectalllabel {
      margin-left: 5px !important;
      font-size: 15px;
      font-weight: 600;
      line-height: 100%;
      letter-spacing: 0;
    }

    th {
      color: $black;
    }

    th[aria-label="Reorder"] {
      text-align: right;
      padding-right: 20px !important;
    }

    th input[data-togglegroup="delete-question"] {
      width: 17px;
      height: 17px;
    }
  }

  .tblbody {

    .mod_minilesson_item_row {

      .itemdate .icon {
        color: $text-slate;
      }

      .itemtypelabel {
        font-size: 11px;
        display: inline-block;
        position: relative;
        top: -1px;
        border-left: 1px solid;
        padding-left: 11px;
      }
    }

    .dataTables_empty {
      height: 150px;
      color: $text-dark;
      font-weight: 400;
      font-style: italic;
      font-size: 15px;
      line-height: 100%;
      letter-spacing: 0;

      .noitemyet {
        margin-top: 45px;
        font-size: 15px;
        font-weight: 600;
        font-style: italic;
        color: rgba(32, 36, 56, 0.85);
        line-height: 100%;
        letter-spacing: 0;
      }
    }

    td input[data-togglegroup="delete-question"] {
      width: 17px;
      height: 17px;
    }
  }

  .mobileviewtype {
    display: none;
  }
}

// Item row icons (shared outside qpanel nesting)
.mod_minilesson_item_row {
  box-shadow: $subtle-shadow;
  border-radius: 8px;

  .mod_minilesson_item_row_previewlink .icon,
  .mod_minilesson_item_row_duplicatelink .icon,
  .mod_minilesson_item_row_deletelink .icon,
  .mod_minilesson_item_row_editlink .icon {
    font-size: 17px;
    width: 17px;
    height: 17px;
  }

  .mod_minilesson_item_move .icon {
    font-size: 25px;
    width: 25px;
    height: 25px;
  }
}

// Responsive
@media only screen and (max-width: 768px) {
  .mod_minilesson_qpanel {

    .mobileviewtype {
      display: block;
      color: $text-slate;
    }

    .itemtypename {
      display: none;
    }
  }
}

// Reports menu (reportsmenu.mustache)
.minilesson_reportsmenu_box {
  text-align: center;
  display: flex;
}

.minilesson_reportsmenu_item {
  height: 80px;
  width: 150px;
  margin: 10px;
}

.minilesson_reportsmenu_itembutton button {
  height: 80px;
  width: 150px;
}

// AI gen page
#page-mod-minilesson-aigen .table-dynamic[data-table-handler="usages"][data-table-total-rows="0"] {
  display: none;
}

// Item types page
#page-mod-minilesson-itemtypes .itemimg {
  width: 30px;
  height: auto;
}
