@import "../variables";
@import "../utilities";

.system-vermine2047 .vermine2047.actor.vehicle {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto 1fr auto !important;

  > header.window-header {
    grid-column: 1;
    grid-row: 1;
  }

  > section.window-content {
    grid-column: 1;
    grid-row: 2;
  }

  > div.window-resize-handle {
    grid-column: 1;
    grid-row: 3;
  }

  .window-content {
    display: grid;
    grid-template-rows: auto auto 1fr;
    grid-template-columns: 1fr;
    overflow: hidden;

    > .tab.main {
      grid-column: 1;
      grid-row: 1;
      display: flex !important;
      flex-direction: column;
      overflow-y: auto;
      padding: 8px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    > nav.tabs {
      grid-column: 1;
      grid-row: 2;
    }

    > .tab:not(.main) {
      grid-column: 1;
      grid-row: 3;
      display: none;
      overflow-y: auto;
      padding: 8px;

      &.active {
        display: flex;
        flex-direction: column;
      }
    }
  }

  .sheet-header {
    .background-image(url("@{ui-path}/barre_haut.webp"), no-repeat, 100% 100%, right top);
    padding: 10px;
    overflow: visible;
  }

  .header-fields { flex: 1; }

  .resource {
    .card-style();

    // Le mixin card-style ajoute un margin-bottom (15px) : inutile dans le
    // header, on le neutralise pour garder une hauteur compacte.
    margin-bottom: 8px;
  }

  .resource-label {
    font-weight: bold;
    margin-right: 8px;
    min-width: 60px;
    font-size: @font-size-12;
  }

  .resource-content {
    display: flex;
    align-items: center;

    select {
      margin-right: 8px;
      min-width: 100px;
    }

    input[type="number"] {
      width: 60px;
      text-align: center;
    }
  }

  .charname {
    margin: 0;
    height: auto;
    font-size: @font-size-18;
    line-height: 1.2;

    span,
    input {
      font-size: @font-size-18;
      font-weight: bold;
      text-align: center;
    }

    input {
      width: 100%;
    }
  }

  .vehicle-owner {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    padding: 6px 8px;
    border: 1px dashed @color-hemolymph;
    background: fade(@color-hemolymph, 8%);

    .label {
      font-family: "DistressBlack", sans-serif;
      text-transform: uppercase;
      font-size: @font-size-11;
      color: @color-text-light-2;
    }
  }

  .vehicle-section {
    padding: 8px;
    border: 1px solid @color-border-dark-4;
    background: fade(@color-chitin-dark, 20%);
    margin-bottom: 8px;

    h3 {
      font-family: "DistressBlack", sans-serif;
      text-transform: uppercase;
      font-size: @font-size-13;
      color: @theme-color-dark;
      margin: 0 0 8px;
      text-align: left;
      border-bottom: none;
    }

    .resource-label {
      display: block;
      margin: 0 0 4px;
      min-width: 0;
    }

    .unit {
      font-size: @font-size-11;
      color: @color-text-dark-secondary;
      opacity: 0.8;
    }

    .maintenance {
      margin-top: 8px;

      .flexrow label {
        gap: 4px;
        margin-right: 12px;
        font-size: @font-size-12;
      }
    }

    .form-group {
      label {
        font-family: "DistressBlack", sans-serif;
        text-transform: uppercase;
        font-size: @font-size-11;
        color: @color-text-light-2;
      }
    }
  }

  input[type="text"] {
    width: 100%;
    padding: 5px;
  }
}
