@import "./react-mde.css";
:global {
  @import "../../../../node_modules/react-datetime/css/react-datetime.css";
}

.hidden {
  display: none !important;
}

fieldset {
  margin: 30px 0px;
}

.removeFieldSet {
  float: right;
  border: none;
  color: $accent-2;
  background: none;
}

.addFieldSet {
  border: none;
  background: none;
  color: $sky;
}

.removeFieldSet:hover,
.addFieldSet:hover {
  opacity: 0.7;
}

.loadingWrap {
  align-items: center;
  justify-content: center;
  display: flex;
  width: 100%;
  height: 356px;
}

.createProposalContent {
  min-height: 500px;
  max-height: calc(100vh - 56px);
  overflow: hidden;
}

.createProposalWrapper {
  border-radius: 15px 15px 0 0;
  background-color: $white;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: $shadow-3;
  min-width: 622px;

  .header {
    background-color: $navy;
    border-radius: 15px 15px 0 0;
    position: relative;
    margin: 0;
    padding: 0;
    color: $white;
    height: 40px;
    opacity: 1;
    font-family: $body-font;
    font-weight: $normal;

    span {
      position: relative;
      font-size: 16px;
      font-weight: normal;
      left: 13px;

      b {
        font-weight: normal;
        opacity: 0.5;
        font-size: 14px;
      }
    }

    .closeButton {
      background: none;
      border: none;
      position: absolute;
      right: 10px;
      color: white;
      font-size: 28px;
    }

    .editIcon {
      display: inline-block;
      margin: 10px;
    }
  }

  form {
    select,
    input {
      width: 100%;
      margin-top: 3px;
      margin-bottom: 5px;
      padding: 0 15px;
      box-sizing: border-box;
      background-color: transparent;
      border: $gray-border-2;
      font-size: 13px;
      font-family: $body-font;
      height: 35px;
      line-height: 35px;

      &.error {
        border: 1px solid rgba(246, 80, 80, 1);
      }
      &:focus {
        outline: none;
        border: 1px solid rgba(46, 168, 122, 1);
      }
    }

    input::placeholder,
    textarea::placeholder {
      color: rgba(154, 169, 181, 1);
    }

    .containerNoSidebar {
      width: 110px;
      display: inline-block;
      height: calc(100% - 40px);
    }

    .proposalDescriptionLabelText {
      display: flex;
      padding-bottom: 4px;

      .body {
        margin-right: 6px;
      }
    }

    .dates {
      display: grid;
      grid-column-gap: 12px;
      grid-row-gap: 8px;
      grid-template-columns: 1fr 1fr;

      .date {
        min-width: 221px; // ensure equal widths
        input {
          min-width: 206px; // calendar input
        }
      }
    }

    .addContract {
      position: relative;
    }

    .encodedDataMultiCall {
      overflow-wrap: break-word;
      margin: 5px 0 5px 0px;
      border: 1px solid;
      padding: 20px;
      width: 490px; // TEMP - SHOULD BE DYNAMIC
    }

    input[type=checkbox] {
      width: 15px;
      height: auto;
    } 

    .proposerIsAdminCheckbox {
      label {
        display: inline-block;
        position: relative;
        bottom: 14px;
        margin-right: 4px;
      }

      input {
        width: auto;
      }
    }

    .rewards {
      display: grid;
      grid-column-gap: 12px;
      grid-row-gap: 0;
      grid-template-columns: 1fr 1fr;
      align-items: end;

      .reward {
        .externalTokenInput {
          display: flex;
          border: 1px solid #bfcbd5;
          border-bottom-left-radius: 2px;
          border-top-left-radius: 2px;
          border-top-right-radius: 2px;
          border-bottom-right-radius: 2px;
          margin-top: 3px;
          margin-bottom: 5px;
          max-height: 37px;
          box-sizing: border-box;

          .amount {
            input {
              border-width: 0;
              height: 35px;
              margin-top: 0;
              margin-bottom: 0px;
            }
          }

          .select {
            flex-shrink: 2;
            font-size: 13px;
            font-family: "Open Sans";
            font-weight: 400;
            min-width: 82px;
            height: 35px;

            input {
              margin: 0;
              line-height: unset;
              height: unset;
            }

            :global .react-select-container {
              .react-select__control {
                min-height: 34px;
                border-radius: 0;
                border-width: 0;
                border-left: 1px solid #bfcbd5;
                height: 34px;
                margin-top: 0;
                margin-bottom: 1px;
                border-bottom-left-radius: 0;
                border-top-left-radius: 0;
                top: 0.5px;
                box-shadow: none;
              }
            }
          }
        }
      }
    }

    label {
      color: rgba(80, 97, 118, 1);
      display: block;
      width: fit-content;
      font-size: 13px;
      font-weight: bold;
      padding: 5px 6px 0 0;
      position: relative;

      .requiredMarker {
        display: inline-block;
        color: rgba(104, 154, 214, 1);
        font-weight: bold;
        margin-right: 4px;
      }
    }

    .errorMessage {
      display: block;
      padding-left: 10px;
      color: rgba(246, 80, 80, 1);
      font-size: 11px;
      font-weight: 300;
    }

    .errorMessage.someReward {
      display: block;
      text-align: center;
      text-transform: uppercase;
      left: 0;
      font-size: $small;
      z-index: -10;
      font-weight: 300;
    }
  }

  .recommendedTemplate {
    border: 1px solid rgba(56, 175, 244, 0.2);
    color: rgba(34, 167, 243, 1);
    font-size: $small;
    border-radius: 3px;
    position: relative;
    top: 0px;
    left: 10px;
    margin-right: 10px;
    padding: 1px;
  }

  .transactionList {
    padding: 30px 0;

    .transactionListHeader {
      font-size: $body;
      font-weight: $normal;
      color: $black-halftone;
      position: relative;
      margin: 0;
      span {
        color: $black-thirdtone;
        position: absolute;
        right: 0;
        font-size: $small;
      }
    }

    table {
      font-size: $caption;
      width: 100%;
      border-top: $gray-border-halftone;
      border-spacing: 0;
      margin-top: 12px;
      color: $black-halftone;

      td {
        padding: 8px 0;
        border-spacing: 0;
        border-collapse: collapse;
        border-bottom: $gray-border-halftone;
      }
    }

    .tokenAmount {
      color: $accent-1;
      font-weight: $bold;
    }

    .userAvatar {
      height: 20px;
      position: relative;
      top: 5px;
      margin: 0 8px;
      margin-top: -6px;
    }

    .transferIcon {
      margin-left: 8px;
    }

    .transferTotals {
      text-align: right;
    }
  }

  .exportProposal {
    cursor: pointer;
    height: 30px;
    float: left;
    transition: all 0.25s ease;
    border: none;
    background-color: rgba(0, 0, 0, 0);
  }

  .exitProposalCreation {
    cursor: pointer;
    height: 30px;
    display: inline-block;
    margin: 0 5px;
    font-weight: normal;
    font-size: 13px;
    padding: 0 25px 2px 25px;
    font-family: $body-font;
    transition: all 0.25s ease;
    border: none;
    background-color: rgba(225, 235, 247, 1);
    border-radius: 15px;
    color: rgba(0, 113, 255, 1);
  }

  .submitProposal {
    height: 30px;
    border: none;
    display: inline-block;
    margin: 0 5px;
    font-size: 13px;
    padding: 0 25px 2px 25px;
    font-family: $body-font;
    font-weight: bold;
    transition: all 0.25s ease;
    background-color: rgba(0, 113, 255, 1);
    border-radius: 15px;
    color: $white;

    &:hover {
      cursor: pointer;
    }

    img {
      position: relative;
      top: 4px;
      margin-right: 8px;
    }

    .loading {
      width: 18px;
      display: none;
    }
  }

  .submitProposal:disabled .loading {
    display: inline-block;
  }

  .submitProposal:disabled {
    background-color: rgba(200, 200, 200, 0.5);
    border: 1px solid rgba(200, 200, 200, 1);
    color: rgba(75, 75, 75, 1);
  }

  .submitProposal:disabled .sendIcon {
    display: none;
  }

  .createProposalActions {
    text-align: right;
    margin-top: 20px;
  }
}

.containerNoSidebar {
  width: 562px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  padding: 20px 30px 30px 30px;
}

.containerWithSidebar {
  width: 735px;
  display: flex;
  flex-direction: row;
  content: "";
  clear: both;
  overflow: auto;
  max-height: calc(100vh - 200px);

  .sidebar {
    width: 199px;
    height: inherit;
    overflow-x: hidden;
    overflow-y: auto;
    float: left;
    padding-top: 30px;
    z-index: 900;

    .addSchemeButton {
      display: block;
    }

    button {
      display: block;
      position: relative;
      border: 0;
      outline: none;
      font-size: 13px;
      font-weight: bold;
      color: rgba(80, 97, 118, 1);
      margin: 0;
      padding: 15px 30px;
      width: 100%;
      text-align: left;

      span {
        display: none;
      }
    }

    button:hover,
    button.selected {
      background-color: rgba(233, 238, 244, 1);

      span {
        width: 25px;
        height: 19px;
        position: absolute;
        right: -8px;
        transform: rotate(63deg) skew(35deg) translateY(-50%);
        display: block;
        top: 50%;
        background-color: #e9eef4;
      }
    }
  }

  .contentWrapper {
    padding: 20px 30px 30px 30px;
    width: 535px;
    float: left;
    border-left: 1px solid #e9eef4;
    overflow: auto;

    .helpText {
      font-size: 12px;
    }

    .tab {
      display: none;
    }

    .tab.selected {
      display: block;
    }

    .arrayFieldContainer {
      margin-top: 3px;

      input {
        width: 398px;
        display: inline-block;
      }

      .arrayField {
        margin-bottom: 15px;
      }

      .removeItemButton {
        height: 30px;
        padding: 0;
        margin: 0 0 0 10px;
        width: 30px;
      }

      .addItemButton {
        margin-bottom: 15px;
      }

      button {
        border: none;
        background-color: rgba(245, 247, 250, 1);
        height: 30px;
        line-height: 30px;
        padding: 0 15px;
        margin-right: 8px;
        border-radius: 3px;
        outline: none;
        color: rgba(104, 155, 214, 1);
        font-weight: bold;
        text-align: center;
      }
    }
  }

  .addEditSchemeFields,
  .removeSchemeFields,
  .addSchemeSelectContainer,
  .editSchemeSelectContainer {
    display: none;
    position: relative;
  }

  .editSchemeSelectContainer {
    height: 63px;
  }

  .addScheme .addEditSchemeFields,
  .removeScheme .removeSchemeFields,
  .editScheme .addEditSchemeFields {
    display: block;
  }

  .addScheme .addSchemeSelectContainer {
    display: block;
  }

  .editScheme .editSchemeSelectContainer {
    display: block;
  }

  .removeSchemeSelectContainer {
    position: relative;
  }

  label {
    z-index: 100;
  }

  .otherScheme {
    width: 445px;
  }

  .schemeSelect {
    display: block;
    font-size: 13px;
    margin: 3px 0 5px 0;
    border-radius: 0;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    bottom: 0px;
    height: 37px;
    padding: 0 30px 0 15px;
    left: 0;
    z-index: 0;
    border: 1px solid #bfcbd5;
    width: 477px;
  }

  .parametersHash {
    input {
      font-size: 12px;
    }
  }

  .permissions {
    display: block;
    padding-top: 15px;

    .permissionsLabel {
      font-size: 13px;
      font-weight: bold;
      color: rgba(80, 97, 118, 1);
      margin-bottom: 6px;
    }

    .permissionCheckbox {
      label {
        display: inline-block;
        position: relative;
        bottom: 4px;
        font-size: 11px;
        font-weight: normal;
      }

      input {
        width: auto;
        margin-right: 6px;
        height: 16px;
      }
    }
  }
}

.showFormButton {
  height: 30px;
  border: none;
  display: inline-block;
  margin: 0 5px;
  font-size: 13px;
  padding: 0 25px 2px 25px;
  font-family: $body-font;
  font-weight: bold;
  transition: all 0.25s ease;
  background-color: rgba(0, 113, 255, 1);
  border-radius: 15px;
  color: $white;
  outline: none;

  &:hover {
    cursor: pointer;
  }
}

form .radioButtons {
  input {
    display: inline-block;
    width: auto;
    vertical-align: middle;
    margin: 0 5px;
    padding: 0px;
  }

  label {
    display: inline-block;
    width: auto;
    font-weight: normal;
    vertical-align: middle;
    padding: 0;

    .requiredMarker {
      display: none;
    }
  }
}

label.description {
  margin-bottom: 2px;
}

div.description {
  font-size: 15px;
  margin-bottom: 12px;

  a,
  a:hover {
    color: #0071ff;
  }
}

.tagSelectorContainer {
  padding-top: 0;
}

.tagSelectorLabel {
  margin-top: 4px;
}

@media only screen and (max-width: 475px) {
  .createProposalWrapper {
    top: 0;
    left: 0;
    transform: translate(0, 0);
    height: 100%;

    .header {
      border-radius: 0 0 0 0;
    }

    form {
      padding: 15px 15px 155px 15px;

      textarea {
        border: none;
        width: 100%;
      }

      .encodedData textarea {
        border: $gray-border-2;
        padding: 9px 15px 12px 15px;
      }

      .dates {
        grid-template-columns: 1fr;

        :global(.rdtPicker) {
          position: unset; // show date picker inline
        }
      }
    }
  }

  .containerNoSidebar {
    width: auto;
  }

  .containerWithSidebar {
    width: 100%;
    overflow: auto;

    .sidebar {
      width: 100%;
      float: none;
      padding-top: 0;
    }

    .contentWrapper {
      width: 100%;
      float: none;
      overflow: visible;
    }

    .schemeSelect {
      width: 90%;
    }
  }

  .schemeRegistrar {
    width: auto;

    .schemeRegistrarForm {
      width: auto;
    }
  }

  .schemeRegistrar .schemeRegistrarSidebar {
    width: auto;
    float: none;

    button {
      font-size: 12px;
      padding: 10px 11px;
      display: inline-block;
      width: auto;
    }

    .addSchemeButton {
      display: inline-block;
      margin: 0 0 0 0;
    }

    button.selected span {
      width: 24px;
      left: 50%;
      right: auto;
      transform: rotate(153deg) skew(35deg);
      top: 25px;
      background-color: #e9eef4;
      margin-left: -12px;
    }
  }

  .createProposalWrapper {
    form {
      .proposerIsAdminCheckbox {
        label {
          bottom: 0;
        }
      }
    }
  }
}
