/* SELECTOR (FILTER INTERFACE) */

.selector {
  width: 800px;
  float: left;

  select {
    width: 380px;
    height: 17.2em;
  }
}

.selector-available {
  float: left;
  width: 380px;
  text-align: center;
  margin-bottom: 5px;
}

.selector-chosen {
  float: left;
  width: 380px;
  text-align: center;
  margin-bottom: 5px;

  select {
    border-top: none;
  }
}

.selector-available h2 {
  border: 1px solid $border-color;
  border-radius: 4px 4px 0 0;
}

.selector-chosen h2 {
  border: 1px solid $border-color;
  border-radius: 4px 4px 0 0;
  background: $primary;
  color: $light;
}

.selector {
  .selector-available h2 {
    background: $light;
    color: $body-color;
  }

  .selector-filter {
    border: 1px solid $border-color;
    border-width: 0 1px;
    padding: 8px;
    color: $body-color;
    font-size: 10px;
    margin: 0;
    text-align: left;

    label {
      float: left;
      margin: 7px 0 0;
      width: 18px;
      height: 18px;
      padding: 0;
      overflow: hidden;
      line-height: 1;
    }
  }
}

.inline-group .aligned .selector .selector-filter label {
  float: left;
  margin: 7px 0 0;
  width: 18px;
  height: 18px;
  padding: 0;
  overflow: hidden;
  line-height: 1;
}

.selector {
  .selector-available input {
    width: 320px;
    margin-left: 8px;
  }

  ul.selector-chooser {
    float: left;
    width: 22px;
    background-color: var(--selected-bg);
    border-radius: 10px;
    margin: 10em 5px 0 5px;
    padding: 0;
  }
}

.selector-chooser li {
  margin: 0;
  padding: 3px;
  list-style-type: none;
}

.selector select {
  padding: 0 10px;
  margin: 0 0 10px;
  border-radius: 0 0 4px 4px;
}

.selector-add,
.selector-remove {
  width: 16px;
  height: 16px;
  display: block;
  text-indent: -3000px;
  overflow: hidden;
  cursor: default;
  opacity: 0.55;
}

.active {
  &.selector-add,
  &.selector-remove {
    opacity: 1;
  }

  &.selector-add:hover,
  &.selector-remove:hover {
    cursor: pointer;
  }
}

.selector-add {
  background: url(../img/selector-icons.svg) 0 -96px no-repeat;
}

.active.selector-add {
  &:focus,
  &:hover {
    background-position: 0 -112px;
  }
}

.selector-remove {
  background: url(../img/selector-icons.svg) 0 -64px no-repeat;
}

.active.selector-remove {
  &:focus,
  &:hover {
    background-position: 0 -80px;
  }
}

a {
  &.selector-chooseall,
  &.selector-clearall {
    display: inline-block;
    height: 16px;
    text-align: left;
    margin: 1px auto 3px;
    overflow: hidden;
    font-weight: bold;
    line-height: 16px;
    color: $body-color;
    text-decoration: none;
    opacity: 0.55;
  }

  &.active {
    &.selector-chooseall,
    &.selector-clearall {
      opacity: 1;
    }

    &.selector-chooseall:hover,
    &.selector-clearall:hover {
      cursor: pointer;
    }
  }

  &.selector-chooseall {
    padding: 0 18px 0 0;
    background: url(../img/selector-icons.svg) right -160px no-repeat;
    cursor: default;
  }

  &.active.selector-chooseall {
    &:focus,
    &:hover {
      background-position: 100% -176px;
    }
  }

  &.selector-clearall {
    padding: 0 0 0 18px;
    background: url(../img/selector-icons.svg) 0 -128px no-repeat;
    cursor: default;
  }

  &.active.selector-clearall {
    &:focus,
    &:hover {
      background-position: 0 -144px;
    }
  }
}

/* STACKED SELECTORS */

.stacked {
  float: left;
  width: 490px;

  select {
    width: 480px;
    height: 10.1em;
  }

  .selector-available,
  .selector-chosen {
    width: 480px;
  }

  .selector-available {
    margin-bottom: 0;

    input {
      width: 422px;
    }
  }

  ul.selector-chooser {
    height: 22px;
    width: 50px;
    margin: 0 0 10px 40%;
    background-color: #eee;
    border-radius: 10px;
  }

  .selector-chooser li {
    float: left;
    padding: 3px 3px 3px 5px;
  }

  .selector-chooseall,
  .selector-clearall {
    display: none;
  }

  .selector-add {
    background: url(../img/selector-icons.svg) 0 -32px no-repeat;
    cursor: default;
  }

  .active.selector-add {
    background-position: 0 -32px;
    cursor: pointer;

    &:focus,
    &:hover {
      background-position: 0 -48px;
      cursor: pointer;
    }
  }

  .selector-remove {
    background: url(../img/selector-icons.svg) 0 0 no-repeat;
    cursor: default;
  }

  .active.selector-remove {
    background-position: 0 0px;
    cursor: pointer;

    &:focus,
    &:hover {
      background-position: 0 -16px;
      cursor: pointer;
    }
  }
}

.selector {
  .help-icon {
    background: url(../img/icon-unknown.svg) 0 0 no-repeat;
    display: inline-block;
    vertical-align: middle;
    margin: -2px 0 0 2px;
    width: 13px;
    height: 13px;
  }

  .selector-chosen .help-icon {
    background: url(../img/icon-unknown-alt.svg) 0 0 no-repeat;
  }

  .search-label-icon {
    background: url(../img/search.svg) 0 0 no-repeat;
    display: inline-block;
    height: 18px;
    width: 18px;
  }
}

/* DATE AND TIME */

p.datetime {
  line-height: 20px;
  margin: 0;
  padding: 0;
  color: $body-color;
  font-weight: bold;
}

.datetime {
  span {
    white-space: nowrap;
    font-weight: normal;
    font-size: 11px;
    color: $body-color;
  }

  input {
    margin-left: 5px;
    margin-bottom: 4px;
  }
}

.form-row .datetime input {
  &.vDateField,
  &.vTimeField {
    margin-left: 5px;
    margin-bottom: 4px;
  }
}

table p.datetime {
  font-size: 11px;
  margin-left: 0;
  padding-left: 0;
}

.datetimeshortcuts {
  .clock-icon,
  .date-icon {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    height: 16px;
    width: 16px;
    overflow: hidden;
  }

  .clock-icon {
    background: url(../img/icon-clock.svg) 0 0 no-repeat;
  }

  a {
    &:focus .clock-icon,
    &:hover .clock-icon {
      background-position: 0 -16px;
    }
  }

  .date-icon {
    background: url(../img/icon-calendar.svg) 0 0 no-repeat;
    top: -1px;
  }

  a {
    &:focus .date-icon,
    &:hover .date-icon {
      background-position: 0 -16px;
    }
  }
}

.timezonewarning {
  font-size: 11px;
  color: $body-color;
}

/* URL */

p.url {
  line-height: 20px;
  margin: 0;
  padding: 0;
  color: $body-color;
  font-size: 11px;
  font-weight: bold;
}

.url a {
  font-weight: normal;
}

/* FILE UPLOADS */

p.file-upload {
  line-height: 20px;
  margin: 0;
  padding: 0;
  color: $body-color;
  font-size: 11px;
  font-weight: bold;
}

.aligned p.file-upload {
  margin-left: 170px;
}

.file-upload {
  a {
    font-weight: normal;
  }

  .deletelink {
    margin-left: 5px;
  }
}

span.clearable-file-input label {
  color: $body-color;
  font-size: 11px;
  display: inline;
  float: none;
}

/* CALENDARS & CLOCKS */

.calendarbox {
  margin: 5px auto;
  font-size: 12px;
  width: 19em;
  text-align: center;
  background: $body-bg;
  color: $body-color;
  border: 1px solid $border-color;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  position: relative;
}

.clockbox {
  margin: 5px auto;
  font-size: 12px;
  width: 19em;
  text-align: center;
  background: $body-bg;
  color: $body-color;
  border: 1px solid $border-color;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  position: relative;
  width: auto;
}

.calendar {
  margin: 0;
  padding: 0;

  table {
    margin: 0;
    padding: 0;
    border-collapse: collapse;
    background: white;
    width: 100%;
  }

  caption {
    margin: 0;
    text-align: center;
    border-top: none;
    font-weight: 700;
    font-size: 12px;
    color: #333;
    background: $special;
  }
}

.calendarbox h2 {
  margin: 0;
  text-align: center;
  border-top: none;
  font-weight: 700;
  font-size: 12px;
  color: #333;
  background: $special;
}

.calendar {
  th {
    padding: 8px 5px;
    background: $light;
    border-bottom: 1px solid $border-color;
    font-weight: 400;
    font-size: 12px;
    text-align: center;
    color: $body-color;
  }

  td {
    font-weight: 400;
    font-size: 12px;
    text-align: center;
    padding: 0;
    border-top: 1px solid $border-color;
    border-bottom: none;

    &.selected a {
      background: $primary;
      color: $white;
    }

    &.nonday {
      background: $light;
    }

    &.today a {
      font-weight: 700;
    }

    a {
      display: block;
      font-weight: 400;
      padding: 6px;
      text-decoration: none;
      color: $body-color;
    }
  }
}

.timelist a {
  display: block;
  font-weight: 400;
  padding: 6px;
  text-decoration: none;
  color: $body-color;
}

.calendar td a:focus,
.timelist a:focus,
.calendar td a:hover,
.timelist a:hover {
  background: $primary;
  color: white;
}

.calendar td a:active,
.timelist a:active {
  background: $primary;
  color: white;
}

.calendarnav {
  font-size: 10px;
  text-align: center;
  color: #ccc;
  margin: 0;
  padding: 1px 3px;

  a:link {
    color: $body-color;
  }
}

#calendarnav a {
  &:visited,
  &:focus,
  &:hover {
    color: $body-color;
  }
}

.calendar-shortcuts {
  background: $body-bg;
  color: $body-color;
  font-size: 11px;
  line-height: 11px;
  border-top: 1px solid $border-color;
  padding: 8px 0;
}

.calendarbox {
  .calendarnav-previous,
  .calendarnav-next {
    display: block;
    position: absolute;
    top: 8px;
    width: 15px;
    height: 15px;
    text-indent: -9999px;
    padding: 0;
  }
}

.calendarnav-previous {
  left: 10px;
  background: url(../img/calendar-icons.svg) 0 0 no-repeat;
}

.calendarbox .calendarnav-previous {
  &:focus,
  &:hover {
    background-position: 0 -15px;
  }
}

.calendarnav-next {
  right: 10px;
  background: url(../img/calendar-icons.svg) 0 -30px no-repeat;
}

.calendarbox .calendarnav-next {
  &:focus,
  &:hover {
    background-position: 0 -45px;
  }
}

.calendar-cancel {
  margin: 0;
  padding: 4px 0;
  font-size: 12px;
  background: #eee;
  border-top: 1px solid $border-color;
  color: $body-color;

  &:focus,
  &:hover {
    background: #ddd;
  }

  a {
    color: black;
    display: block;
  }
}

ul.timelist {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.timelist {
  li {
    list-style-type: none;
    margin: 0;
    padding: 0;
  }

  a {
    padding: 2px;
  }
}

/* EDIT INLINE */

.inline-deletelink {
  float: right;
  text-indent: -9999px;
  background: url(../img/inline-delete.svg) 0 0 no-repeat;
  width: 16px;
  height: 16px;
  border: 0px none;

  &:focus,
  &:hover {
    cursor: pointer;
  }
}

/* RELATED WIDGET WRAPPER */

.related-widget-wrapper {
  float: left;

  /* display properly in form rows with multiple fields */
  overflow: hidden;

  /* clear floated contents */
}

.related-widget-wrapper-link {
  opacity: 0.3;

  &:link {
    opacity: 0.8;

    &:focus,
    &:hover {
      opacity: 1;
    }
  }
}

select + .related-widget-wrapper-link,
.related-widget-wrapper-link + .related-widget-wrapper-link {
  margin-left: 7px;
}
