/* ----------------------------------------- */
/*  Common Sheet Styles                      */
/* ----------------------------------------- */

body.system-bol img#logo {
  content: url("/systems/bol/ui/logo2.webp");
}

.journal-page-content {
  /* Reserved for future use */
}

.bol.dialog {
  & > section.window-content {
    background: white;
    border: 10px solid transparent;
    border-image: url("/systems/bol/ui/box-border-large.webp") 36 repeat;
    border-image-outset: 1;
    padding: 10px;
  }

  .window-title {
    font-family: "Wolfsbane2Expanded", cursive;
    color: #4b4a44;
  }

  .sheet-header {
    text-align: center;
    margin-bottom: 6px;
    padding: 4px 0;
    border-bottom: 2px solid darkred;

    h3 {
      font-family: "Wolfsbane2Expanded", cursive;
      font-size: 1.3rem;
      color: #191813;
      margin: 0;
    }
  }

  // 2-column layout for roll dialogs
  .roll-dialog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 8px;
    align-items: start;
    margin-bottom: 2px;
  }

  .roll-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .roll-box, .box-roll,
  div.flexrow:has(.bg-darkred) {
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1px;
    background: #f5f0e8;
    gap: 2px;

    .bg-darkred {
      padding: 4px 10px;
      font-family: "Wolfsbane2Expanded", cursive;
      font-size: 0.78rem;
      letter-spacing: 0.6px;
      border-radius: 5px;
      margin: 2px 0 2px 2px;
      background: linear-gradient(135deg, #7a0000, darkred);
      text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    }

    .cell {
      background: transparent;
      padding: 2px 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #191813;
      flex-wrap: wrap;

      label.checkbox {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
      }
    }
  }

  select, input[type="text"], input[type="number"] {
    background: transparent !important;
    color: #191813 !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 0.88rem;
    width: 100%;

    option {
      background: #f5f0e8;
      color: #191813;
    }
    option:checked, option:hover {
      background: darkred !important;
      color: white !important;
    }
  }

  input:disabled {
    color: #8b0000 !important;
    font-weight: bold;
    font-size: 0.95rem;
  }

  .dice-options-cell {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 6px;
    justify-content: center;

    .dice-option {
      display: flex;
      align-items: center;
      gap: 3px;
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 0.82rem;
      cursor: pointer;
      white-space: nowrap;

      input[type="radio"] { margin: 0; }
    }

    .bdice-label { background: #e8f5e8; color: #1a5c1a; border: 1px solid #4caf50; }
    .neutral-label { background: #f0ede5; color: #4b4a44; border: 1px solid #9e9e7a; }
    .mdice-label { background: #fce8e8; color: #7a0000; border: 1px solid #e57373; }
  }
}

.bol.sheet, .bol.dialog {
  footer.form-footer {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 2px solid darkred;

    button {
      flex: 1;
      background: linear-gradient(135deg, #7a0000, darkred);
      color: white;
      border: 1px solid #6b0000;
      border-radius: 5px;
      padding: 5px 10px;
      font-family: "Wolfsbane2Expanded", cursive;
      font-size: 0.95rem;
      letter-spacing: 0.6px;
      text-shadow: 0 1px 2px rgba(0,0,0,0.4);
      cursor: pointer;
      transition: background 0.15s;

      i { margin-right: 4px; }

      &:hover { background: linear-gradient(135deg, #9b0000, #c00000); }

      &[type="button"] {
        background: linear-gradient(135deg, #2a2a2a, #4b4a44);
        border-color: #2a2a2a;
        &:hover { background: linear-gradient(135deg, #3a3a3a, #5b5a54); }
      }
    }
  }
}

.bol.sheet {
  .window-header {
    border: none;
  }

  .window-content {
    height: 100%;
    padding: 10px;
    overflow-y: hidden;
    background: transparent;

    .bol-actor-form {
      border: 10px solid transparent;
      border-image: url("/systems/bol/ui/box-border-large.webp") 36 repeat;
      border-image-outset: 1;
      background: white;
      margin: 0;
      padding: 0;
      height: 100%;
      position: relative;
      width: 100%;

      .sheet-header {
        background-image: url("/systems/bol/ui/banner.webp");
        background-repeat: no-repeat;
        background-size: 330px 62px;
        background-position-y: -15px;
        background-position-x: right;
        height: 115px;
        min-height: 115px;
        max-height: 115px;
        overflow: hidden;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: flex-end;
        padding-bottom: 10px;

        .header-field {
          .header-field-group {
            overflow: hidden;
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            justify-content: flex-start;
            align-items: baseline;

            .charname,
            .itemname {
              color: #4b4a44;
              font-family: "Wolfsbane2Expanded", cursive;
              font-size: 1.65rem;
              background-color: #2a2a2a30;
              border: 1px solid #4b4a44 !important;
              border-radius: 0.5rem;
              width: 100%;
              margin-bottom: 4px;
            }

            .header-field-label {
              margin-right: 5px;
              font-size: 0.86rem;
            }

            .header-field-label.xp-sublabel {
              font-size: 0.9rem;
              color: #606060;
            }

            .header-field-value {
              color: #4b4a44;
              font-family: "Wolfsbane2Expanded", cursive;
              font-size: 0.9rem;
              background-color: #2a2a2a30;
              border: 1px solid #4b4a44 !important;
              border-radius: 0.5rem;
              text-align: center;

              &[type="select"],
              &:is(select) {
                border: 1px solid #4b4a44 !important;
                border-radius: 0.5rem;
                background-color: #2a2a2a30;
              }
            }
          }
        }

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

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

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

      .wrap {
        flex: 1;
        min-height: 0;
        align-items: stretch;
      }

      .bol-actor-sidebar {
        align-self: flex-start;
      }

      .main {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        height: 100%;
        overflow: hidden;

        .tabs {
          flex: 0 0 30px;
          background-color: black;

          .item {
            line-height: 30px;
            font-weight: bold;
            font-family: "CCMeanwhile", cursive;
            color: white;
            padding-top: 4px;
            font-size: 0.8em;

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

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

          .tab {
            height: 100%;
            border: none;
            overflow-y: auto;
            display: none;

            &.active {
              display: block;
            }

            &.stats {
              hr {
                margin-top: 6px;
                margin-bottom: 6px;
              }

              .editor,
              .editor-content,
              prose-mirror {
                color: #191813;
              }
              prose-mirror .editor-content,
              prose-mirror p,
              prose-mirror div,
              prose-mirror span {
                color: #191813 !important;
              }
            }

            &.description {
              .editor,
              .editor-content,
              prose-mirror {
                height: 100%;
                color: #191813;
              }
              prose-mirror .editor-content,
              prose-mirror p,
              prose-mirror div,
              prose-mirror span {
                color: #191813 !important;
              }
              input[type="text"],
              input[type="number"] {
                background-color: #2a2a2a30;
                border: 1px solid #4b4a44 !important;
                border-radius: 0.5rem;
                color: #4b4a44;
                text-align: center;
                font-size: 0.95rem;
                margin-left: 6px;
              }
              select.header-field-value {
                background-color: #2a2a2a30;
                border: 1px solid #4b4a44 !important;
                border-radius: 0.5rem;
                color: #4b4a44;
              }
            }
          }
        }
      }
    }
  }
}

.sheet-profile-img {
  cursor: pointer;
  border: none;
  background-color: #EEE;
  height: auto;
  width: 96px;
  height: 96px;
  min-width: 96px;
  min-height: 96px;
  max-width: 96px;
  margin-right: 10px;
}
