@import "vars";

.zwave-container {
  .no-items {
    padding: 2em;
    font-size: 1.5em;
    color: $no-items-color;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .params, .info-body {
    .row {
      &:nth-child(even) {
        background: $param-even-row-bg;
      }

      &:nth-child(odd) {
        background: $param-odd-row-bg;
      }

      &:hover {
        background: $hover-bg;
      }
    }
  }

  .node, .scene {
    .actions {
      .row {
        cursor: pointer;
      }
    }

    form {
      margin-bottom: 0;
    }
  }

  .params {
    background: $params-bg;
    padding-bottom: 1em;

    .title {
      font-size: 1.1em !important;
      margin: 0 !important;
    }

    .section {
      display: flex;
      flex-direction: column;
      padding: 0 1em;

      &:not(:first-child) {
        padding-top: 1em;
      }

      .header {
        display: flex;
        align-items: center;
        font-weight: bold;
        border-bottom: $param-section-header-border;

        .buttons {
          display: inline-flex;
          justify-content: right;
        }
      }
    }

    .row {
      display: flex;
      align-items: center;
      border-radius: 1em;
      padding: .3em;

      &:hover {
        background: $hover-bg;
      }
    }

    .param-name {
      display: inline-flex;
      width: 40%;
      margin-left: 1%;
      vertical-align: top;
      letter-spacing: .04em;
    }

    .param-value {
      display: inline-block;
      width: 58%;
      text-align: right;

      .value-edit {
        display: flex;
        align-items: center;
      }

      .value-data {
        display: inline-block;
        font-weight: bold;
      }

      .slider-container {
        display: flex;
        align-items: center;
      }

      .unit {
        font-size: .8em;
        margin-left: .5em;
        display: inline;
      }

      select {
        width: 100%;
      }

      .numeric {
        input.slider {
          text-align: left;
        }

        input[type=text] {
          text-align: right;
          width: 100%;
        }

        .row {
          background: none;
          &:hover {
            background: none;
          }
        }

        .value-min, .value-max {
          width: 50%;
          font-size: .85em;
          opacity: .75;
        }

        .value-min {
          text-align: left;
        }

        .value-max {
          text-align: right;
        }
      }

      .edit-cell {
        width: 100%;
        display: inline-flex;
        justify-content: right;
        align-items: center;

        .buttons {
          margin: 0;
        }
      }
    }
  }

  .row {
    display: flex;
    flex-wrap: wrap;

    @media screen and (max-width: $tablet) {
      .param-name {
        width: 100%;
        font-weight: bold;
      }

      .param-value {
        width: 100%;
        margin-left: 1%;
      }
    }

    @media screen and (min-width: $tablet) {
      .param-name {
        width: 40%;
      }

      .param-value {
        width: 58%;
        justify-content: right;
      }
    }

    .param-name {
      display: inline-flex;
      margin-left: 1%;
      vertical-align: top;
      letter-spacing: .04em;
    }

    .param-value {
      display: inline-flex;
      align-items: center;

      .value-edit {
        display: flex;
        align-items: center;
      }

      .value-data {
        display: inline-block;
        font-weight: bold;
      }

      .slider-container {
        display: flex;
        align-items: center;
      }

      .unit {
        font-size: .8em;
        margin-left: .5em;
        display: inline;
      }

      select {
        width: 100%;
      }

      .numeric {
        input.slider {
          text-align: left;
        }

        input[type=text] {
          text-align: right;
          width: 100%;
        }

        .row {
          background: none;
          &:hover {
            background: none;
          }
        }

        .value-min, .value-max {
          width: 50%;
          font-size: .85em;
          opacity: .75;
        }

        .value-min {
          text-align: left;
        }

        .value-max {
          text-align: right;
        }
      }
    }
  }

  .btn-default {
    border: 0;
    padding: 0 1em;

    &:hover {
      border: $default-border-2;
      border-radius: 1em;
    }
  }

  .buttons {
    text-align: right;
  }

  .view-container {
    width: 100%;
    height: calc(100% - #{$header-height});
    overflow: auto;
    display: flex;
    justify-content: center;
  }

  .view {
    height: max-content;
    background: $view-bg;
    border: $view-border;
    box-shadow: $view-box-shadow;
  }

  @media screen and (max-width: $desktop) {
    .view {
      width: 100%;
      border-radius: 0;
      margin-top: 0;
    }
  }

  @media screen and (min-width: $desktop) {
    .view {
      min-width: 400pt;
      max-width: 750pt;
      border-radius: 1.5em;
      margin-top: 1em;
    }
  }

  .item {
    border-bottom: $item-border;

    &.selected {
      box-shadow: $selected-item-box-shadow;
    }

    .name.header {
      padding: 1em !important;
      cursor: pointer;
      text-transform: uppercase;
      letter-spacing: .06em;

      &:hover {
        border-radius: 1.5em;
      }

      &.selected {
        background: $selected-bg;
        border-radius: 1.5em;
      }
    }

    .title {
      font-size: 1.2em;
      padding-left: .5em;
    }

    .buttons {
      margin: 0;
    }

    &:hover {
      background: $hover-bg;

      &.selected {
        background: $selected-bg;
      }
    }

    &:first-child {
      border-radius: 1.5em 1.5em 0 0;
    }

    &:last-child {
      border-radius: 0 0 1.5em 1.5em;
    }

    .params {
      .section {
        padding: 1.5em 0 0 0;
      }
    }

    .value {
      .param-name {
        display: inline-block;

        .name {
          font-family: monospace;
          font-size: .8em;
          text-transform: unset;
          padding: 0;

          &:before {
            content: '[';
          }

          &:after {
            content: ']';
          }
        }

        .unit {
          font-size: .8em;
          &:before {
            content: ' [unit: ';
          }

          &:after {
            content: ']';
          }
        }
      }

      .param-value {
        label {
          width: 90%;
        }

        input {
          width: 100%;
        }
      }
    }

    button {
      border: 0;
      background: none;
      padding: 0 .5em;

      &:hover {
        color: $default-hover-fg;
      }
    }

    @media screen and (max-width: $tablet) {
      .name-edit {
        justify-content: left;
      }
    }

    @media screen and (min-width: $tablet) {
      .name-edit {
        justify-content: right;
      }
    }

    .name-edit {
      width: 100%;
      display: inline-flex;
      align-items: center;

      form {
        width: 100%;
        display: inline-flex;
        align-items:center;
        justify-content: right;
        flex-direction: row;
      }

      .buttons {
        display: inline-flex;
        justify-content: right;
        margin: 0 0 0 .5em;
      }

      form {
        background: none;
        padding: 0;
        border: none;
        box-shadow: none;
      }
    }
  }

  .btn-value-name-edit {
    padding: 0;
  }

  .modal {
    .section {
      .header {
        background: none;
        padding: .5em 0;
      }

      .body {
        padding: 0;
      }
    }

    .network-info {
      min-width: 600pt;
    }
  }

  .error {
    color: $error-color;
  }

  form {
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  button {
    background: none;
    border: none;
    padding: 0 .75em;

    &:hover {
      color: $default-hover-fg;
    }
  }

  .buttons {
    display: inline-flex;
    margin: 0;

    .dropdown {
      .item {
        padding: .5em 2em .5em .5em;
      }
    }
  }

  select {
    width: 100%;
  }

  .clickable {
    cursor: pointer;
  }

  .buttons {
    button {
      background: none !important;
    }
  }

  .view {
    &.values {
      .node-container {
        &:first-child {
          border-radius: 1.5em 1.5em 0 0;
        }

        &:last-child {
          border-radius: 0 0 1.5em 1.5em;
        }

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