/**
 * Copyright © 2016-2026 The Thingsboard Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@import "../../../../scss/constants";

$containerHeight: 96px !default;

:host {
  .tb-container {
    margin-top: 0;
    padding: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    label.tb-title {
      display: block;
      padding-bottom: 0;
    }
  }

  .tb-scada-symbol-select-container {
    width: 100%;
    height: $containerHeight;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    &.disabled {
      width: $containerHeight;
      .tb-scada-symbol-container {
        width: $containerHeight - 2px;
        border-right: none;
      }
    }
  }

  .tb-scada-symbol-container {
    width: $containerHeight - 1px;
    height: $containerHeight - 2px;
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    border-right: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    overflow: hidden;
  }

  .tb-scada-symbol-preview {
    width: auto;
    max-width: $containerHeight - 2px;
    height: auto;
    max-height: $containerHeight  - 2px;
  }

  .tb-no-symbol {
    text-align: center;
    color: rgba(0, 0, 0, 0.38);
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 16px;
    letter-spacing: 0.4px;
  }

  .tb-scada-symbol-info-container {
    display: flex;
    flex: 1;
    align-self: stretch;
    padding: 0 8px;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    .tb-resource-scada-symbol-container {
      padding: 8px;
      display: flex;
      flex: 1;
      align-self: stretch;
      justify-content: center;
      align-items: flex-start;
      flex-direction: column;
      gap: 4px;
      .tb-scada-symbol-title {
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        font-size: 18px;
        font-style: normal;
        font-weight: 500;
        line-height: 24px;
        letter-spacing: 0.25px;
      }
      &.loading {
        align-items: center;
      }
    }

    .tb-scada-symbol-clear-btn {
      color: rgba(0,0,0,0.38);
    }
  }

  .tb-scada-symbol-select-buttons-container {
    display: flex;
    flex: 1;
    align-self: stretch;
    padding: 8px;
    gap: 8px;
    justify-content: center;
    align-items: flex-start;
    .tb-scada-symbol-select-button {
      width: 100%;
      height: 100%;
      align-self: stretch;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 4px;
      padding: 8px;
      line-height: normal;
      font-size: 12px;
      @media #{$mat-gt-xs} {
        padding: 16px;
      }
      .mat-icon {
        width: 24px;
        height: 24px;
        font-size: 24px;
        margin: 0;
      }
    }
  }
}
