/**
 * @file
 * Visual styling for forms in the off-canvas dialog.
 */

form {
  color: $panel_text_color;
  font-family: inherit;
}

input[type="checkbox"] {
  margin-right: .5rem;
}

input[type="radio"] {
  margin-right: .5rem;
}

label {
  color: $panel_text_color;
  font-size: 1rem;
  font-weight: normal;
}

.description,
.form-item .description,
.details-description {
  color: rgba($panel_text_color, .5);
  font-size: .875rem;
  margin-top: .25rem;
  margin-bottom: 1rem;
}

.form-item {
  margin-top: .25rem;
  margin-bottom: 1.5rem;

  // Safari only
  @media not all and (min-resolution: .001dpcm) {
    @supports (-webkit-appearance:none) and (display:flow-root) {
      display: block;
    }
  }
}

.fieldset-legend {
  font-size: .875rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  font-weight: normal;
  color: rgba($panel_text_color, .6);
}

.form-select {
  background: $form_select_icon;
  background-size: 25px;
  background-position: right 10px center;
  background-repeat: no-repeat;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;

  option {
    color: $black;
  }
}

/* Reduce contrast for fields against dark background. */
.form-select,
.form-text,
.form-tel,
.form-email,
.form-url,
.form-search,
.form-number,
.form-color,
.form-file,
.form-textarea,
.form-date,
.form-time {
  @include smooth-all-transition;
  color: inherit;
  font-size: 1rem;
  width: 100%;
  border-radius: $border_radius;
  padding: .65rem 1rem;
  border: 2px solid $tabs_bottom_border_color;
  background-color: transparent;
  box-shadow: none;

  &:hover {
    border-color: rgba($panel_text-color, .75);
  }

  &:focus {
    border-color: $panel_link_color;
    background-color: transparent;
    box-shadow: none;
    outline: 0;
  }
}

// Inline Entity Forms & Inline Containers with buttons.
.container-inline,
.ief-form .form-wrapper .form-wrapper:last-child[data-drupal-selector$="-actions"],
.ief-form > .fieldset-wrapper > .form-wrapper:last-child[data-drupal-selector$="-actions"] {
  display: flex;
  margin: 0 -1rem;

  > div {
    flex-grow: 1;
    padding: 0 1rem;
  }

  > input[type="submit"].button {
    margin-right: 1rem;
    margin-left: 1rem;
  }
}

.ief-form {
  background-color: rgba($panel_text_color, .035);
  padding: 1rem 2rem 2rem 2rem;
  border-radius: $border-radius;

  > legend {
    float: left;
  }
}

// IEF Entity Table
.ief-entity-table {
  tr:hover td {
    background-color: rgba($panel_text_color, .035);
  }

  .ief-row-entity td:last-child {
    width: 200px;
  }
}

// Operations table
.ief-entity-operations {
  display: flex;

  input[type="submit"].button {
    font-size: .85rem;
    padding: .5rem .75rem;
    margin: .5rem;
  }
}


// Fixes for CKEditor
.cke {
  background-color: $white;
}

.filter-wrapper .form-item {
  margin-bottom: .25rem;
}

.cke_reset_all,
.cke_reset_all *,
.cke_reset_all a,
.cke_reset_all textarea {
  color: $black;
}

.js-text-format-wrapper .form-type-textarea {
  margin-bottom: 0;
}

.filter-wrapper {
  border-radius: 0 0 $border-radius $border-radius;
}
