/* ----------------------------------------- */
/*  Item Sheet Styles                        */
/* ----------------------------------------- */

.bol.sheet.item {
  min-width: 460px;
  min-height: 400px;

  .window-content {
    background: transparent !important;
    color: #191813 !important;
    padding: 10px;
    overflow: hidden;

    // Inner div — mirrors the AppV1 <form> with box-border-large decoration
    .bol.sheet.item {
      border: 10px solid transparent;
      border-image: url("/systems/bol/ui/box-border-large.webp") 36 repeat;
      border-image-outset: 1;
      background: white !important;
      color: #191813 !important;
      margin: 0;
      padding: 0;
      height: 100%;
      position: relative;
      width: 100%;
      display: flex;
      flex-direction: column;

      .wrap {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;

        .main {
          flex: 1;
          min-height: 0;
          display: flex;
          flex-direction: column;

          .sheet-body {
            flex: 1;
            min-height: 0;
            overflow: hidden;

            .tab {
              display: none;

              &.active {
                display: block;
                height: 100%;
                overflow-y: auto;
              }

              &.properties {
                padding: 5px 8px;
              }
            }
          }
        }
      }
    }
  }

  .window-content .bol.sheet.item .sheet-header {
    background-image: url("/systems/bol/ui/banner.webp");
    background-size: 330px 62px;
    background-position: 100% -15px;
    background-repeat: no-repeat;
    height: 115px;
    min-height: 115px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 10px;

    img.profile-img {
      cursor: pointer;
      border: none;
      background-color: lightgray;
      box-shadow: 5px 5px 5px black;
      width: 96px;
      height: 96px;
      min-width: 96px;
      min-height: 96px;
      max-width: 96px;
      max-height: 96px;
      margin-right: 10px;
      object-fit: cover;
    }

    .header-buttons {
      align-self: flex-end;
      padding-bottom: 10px;

      .post-item {
        color: #4b4a44;
        background: rgba(0, 0, 0, 0.1);
        border: 1px solid #999;
        border-radius: 3px;
        height: 32px;
        width: 32px;
        line-height: 30px;
        cursor: pointer;

        &:hover {
          color: #191813;
          background: rgba(0, 0, 0, 0.2);
        }
      }
    }
  }

  .window-content .bol.sheet.item .tabs {
    height: 44px;
    background-color: black;
    display: flex;
    flex-shrink: 0;

    a.item {
      line-height: 44px;
      font-weight: bold;
      font-family: "CCMeanwhile", cursive;
      color: white;
      font-size: 0.9em;

      &.active {
        text-decoration: underline;
        text-shadow: none;
      }
    }
  }

  .window-content .bol.sheet.item .sheet-body {
    .tab.description.active {
      color: #191813;
      display: block;
      overflow: auto;

      .editor,
      .editor-content,
      .prosemirror,
      .prosemirror p,
      .prosemirror div,
      .prosemirror span,
      .prosemirror h1,
      .prosemirror h2,
      .prosemirror h3,
      .prosemirror h4,
      .form-group:has(.prosemirror),
      .form-group:has(.editor) {
        color: #191813 !important;
      }
    }

    .tab.properties {
      label,
      .form-group label,
      select,
      input[type="text"],
      input[type="number"] {
        color: #191813;
      }
    }
  }

  h1 input.itemname {
    margin-top: 0;
    min-width: 26.4rem;
    font-family: "Wolfsbane2Expanded", cursive;
    text-shadow: 3px 3px 5px #333;
  }

  // Normalize inputs and selects in item sheets
  .window-content .bol.sheet.item {
    .form-group {
      display: flex;
      flex-direction: row;
      align-items: flex-start;
      margin: 3px 0;

      > label:not(.checkbox) {
        flex: 0 0 40%;
        color: #191813;
        font-weight: bold;
        padding-top: 2px;
      }

      input[type="checkbox"] {
        flex: 0 0 auto;
        width: 16px;
        height: 16px;
        margin: 0;
        position: static;
        top: auto;
        cursor: pointer;
      }

      input[type="text"],
      input[type="number"],
      select,
      .form-fields {
        flex: 1;
      }

      .form-fields {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }
    }

    label.checkbox {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 6px;
      color: #191813;

      > input[type="checkbox"] {
        position: static;
        top: auto;
        margin: 0;
        flex: 0 0 auto;
      }
    }

    .vehicle-checkboxes {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px 16px;
      padding: 4px 0;
    }

    input[type="text"],
    input[type="number"],
    input[type="text"]:hover,
    input[type="number"]:hover,
    input[type="text"]:focus,
    input[type="number"]:focus,
    select {
      color: #191813;
      background-color: #f0efe8;
      border: 1px solid #999;
      border-radius: 2px;
      padding: 1px 4px;
    }

    select option {
      background-color: #f0efe8;
      color: #191813;
    }
  }

  .item-properties {
    margin: 5px 0;
    padding-bottom: 5px;
    border-bottom: 1px groove #eeede0;

    .properties-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: block;

      li {
        margin: 3px 0;
        padding: 0 2px;
        background: rgba(0, 0, 0, 0.05);
        border: 1px groove #eeede0;
        text-align: center;
        font-size: 12px;
        line-height: 18px;
      }
    }
  }
}

.bol.dialog .sheet-header h3 {
  font-family: "Wolfsbane2Expanded", cursive;
  font-size: 24px;
  color: black;
}

.editor,
.editor-content {
  height: 100%;
}
