@use "variables" as *;
@use "mixins";

.silex-workspace {
  @include mixins.silex-ui-full;
  display: flex;
  body {
    font-family: $fontFamily;
  }
  a {
    color: inherit;
  }
  h2 {
    font-size: 18px;
    background: $lighterPrimaryColor;
    border-radius: 8px 8px 0 0;
    padding: 8px;
    margin: 0;
    font-weight: normal;
  }
  h3 {
    margin: 10px 0;
    font-size: 18px;
    font-weight: normal;
  }
  //Better contrast than grapesjs default for select menu et input
  select, input {
    background-color: $darkerPrimaryColor;
  }
  .gjs-color-warn, .gjs-sm-sector .gjs-sm-field input, .gjs-clm-tags .gjs-sm-field input, .gjs-sm-sector .gjs-clm-field input, .gjs-clm-tags .gjs-clm-field input, .gjs-sm-sector .gjs-sm-field select, .gjs-clm-tags .gjs-sm-field select, .gjs-sm-sector .gjs-clm-field select, .gjs-clm-tags .gjs-clm-field select {
    color: $secondaryColor;
  }
}

.full-width {
  width: 100%;
}

// Resize options panel button
.silex-workspace {
  .gjs-pn-viewsOptions {
      z-index: $z-views-options-buttons;
      right: 0;
      left: auto;

      .viewsOptions__size-btn::before {
        content: '←';
      }
    }
}

.silex-hidden {
  /* do not really hide, because it breaks the code editor init in the site settings + for animation */
  visibility: hidden;
  position: absolute;
  opacity: 0;
  height: 10px;
  width: 10px;
  overflow: hidden;
}

// full screen settings
.settings-dialog > div {
  max-width: none;
  width: 100%;
  height: 100vh;
  overflow: auto;
  form.silex-form {
    padding-bottom: 100px; // leave space for fixed footer
    textarea {
      min-height: 250px;
    }
  }
  .silex-form__element {
    padding: 10px 5px;
    border: 1px solid $lighterPrimaryColor;
    margin: 10px 0;
    width: 98%;
  }
  footer {
    position: fixed;
    z-index: 10;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    background-color: $primaryColor;
    &>*:last-child {
      margin-right: 30px;
    }
    .silex-version {
      float: left;
      padding: 0 15px;
      font-size: x-small;
    }
  }
  .CodeMirror {
    min-height: 400px;
    height: auto;
  }
}

button.silex-button,
input.silex-button[type="button"],
input.silex-button[type="submit"] {
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e9ebeb;
  border-bottom-color: #e1e3e3;
  border-radius: 4px;
  box-shadow: 0 2px 4px 0 rgba(14, 30, 37, .12);
  background-color: $lighterPrimaryColor;
  border-color: transparent;
  padding: 5px;
  &:focus {
    outline: none;
    box-shadow: 0 0 0 2px $tertiaryColor;
  }
  &:hover {
    background-color: $darkerPrimaryColor;
  }
}

.silex-button.disabled,
.silex-button[disabled] {
  opacity: .8;
  cursor: unset;
}

.silex-button.silex-button--primary {
  background-color: $lighterPrimaryColor;
}

.silex-button.silex-button--secondary {
  background-color: $primaryColor;
}

.silex-button--size {
  max-height: 30px;
  margin: 0 10px;
}

.silex-button--small {
  font-size: .7em;
  padding: 0 5px;
}

.silex-input {
  appearance: initial;
}

.silex-label {
  display: block;
}

.silex-sidebar-dialog,
.silex-bar {
  display: flex;
  &>* {
    margin: 5px;
  }
  main {
    width: 100%;
  }
}

ol.silex-list,
ul.silex-list {
  list-style: none;
  margin: 0;
  padding: 0;
  //background-color: #575757;
  &>li {
    padding: 5px;
    border-bottom: 1px solid $lighterPrimaryColor;
    //background-color: #444;
    margin: 5px;
  }
  fieldset {
    border-color: $lighterPrimaryColor;
  }
  h4 { // badge-like
    display: inline-block;
    padding: 5px;
    padding-bottom: 2px;
    margin: 10px 5px;
    font-weight: normal;
    color: #3d3d3d;
    background-color: #c4c4c4;
  }
  .silex-list__item__body {
    display: flex;
  }
  .silex-list__item__footer {
    display: flex;
    justify-content: flex-end;
    button {
      padding: 5px;
      margin: 5px;
      padding-top: 8px;
    }
  }
}

ol.silex-list--menu,
ul.silex-list--menu {
  &>li {
    padding: 15px;
    margin: 0;
    border: 1px solid transparent;
    border-bottom-color: $lighterPrimaryColor;
    text-align: center;
    cursor: pointer;
  }
  &>li:first-child {
    border-top-color: $lighterPrimaryColor;
  }
  .active,
  &>li:hover {
    color: $tertiaryColor;
    background-color: $darkerPrimaryColor;
  }
}

form.silex-form {
  display: flex;
  flex-direction: column;
  footer {
    text-align: right;
    border-top: 1px solid $lighterPrimaryColor;
    padding: 20px 0 10px;
    margin: 20px 0 0;
  }
  button, input, optgroup, select, textarea {
    background-color: $darkerPrimaryColor;
    color: $secondaryColor;
    padding: 5px;
    border: none;
  }
  input[type=checkbox] {
    margin: 5px;
  }
  textarea {
    width: 98% !important;
  }
  .silex-form__element {
    display: inline-flex;
    flex-direction: column;
  }
  .silex-form__group.col2 {
    column-count: 2;
  }
}
