/**
 * @license
 * Copyright 2024 The Model Explorer Authors. All Rights Reserved.
 *
 * 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.
 * ==============================================================================
 */

$sync_highlight_color: #004fb8;

@keyframes rotating {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.container {
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 11px;
  cursor: pointer;
  color: #777;
  padding: 0 5px;
  background-color: white;
  border-radius: 99px;
  border: 1px solid #ccc;
  box-sizing: border-box;

  .content {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;

    &:hover {
      opacity: 1;
    }
  }

  &.enabled {
    background-color: $sync_highlight_color;
    color: white;

    mat-icon {
      color: white;
    }
  }

  mat-icon {
    font-size: 18px;
    height: 18px;
    width: 18px;

    &.loading {
      animation: rotating 2s linear infinite;
    }
  }
}

::ng-deep .model-explorer-sync-navigation-dropdown {
  font-size: 12px;
  background-color: white;
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;

  .section-label {
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 11px;
    background: #f1f1f1;
    font-weight: 500;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .right {
      display: flex;
      align-items: center;
      gap: 4px;

      .icon-container {
        display: flex;
        cursor: pointer;
        opacity: 0.8;

        &:hover {
          opacity: 1;
        }
      }

      mat-icon {
        font-size: 18px;
        height: 18px;
        width: 18px;
        color: #999;
      }
    }
  }

  .section {
    padding-right: 16px;
  }

  mat-radio-button {
    cursor: pointer;

    &.cns {
      margin-top: 8px;
    }

    > div[mat-internal-form-field] {
      height: 24px;
    }

    div:has(> input[type='radio']) {
      transform: scale(0.7);
      margin-right: -8px;
    }

    label {
      letter-spacing: normal;
      cursor: pointer;
      font-size: 12px;
      font-family: 'Google Sans Text', 'Google Sans', Arial, Helvetica,
        sans-serif;
    }
  }

  .select-container {
    display: flex;
    flex-direction: column;
  }

  .upload-mapping-button {
    margin: 2px 0 0 36px;
    width: 90px;
    height: 30px;
    /* stylelint-disable-next-line declaration-no-important -- override MDC */
    font-size: 12px !important;
    /* stylelint-disable-next-line declaration-no-important -- override MDC */
    letter-spacing: normal !important;

    &.cns {
      margin-top: 4px;
    }

    ::ng-deep .mat-mdc-button-touch-target {
      display: none;
    }
  }

  .upload-mapping-input {
    display: none;
  }

  .uploaded-file-name {
    margin-left: 36px;
    color: #999;
    line-break: anywhere;
    line-height: 14px;
  }

  textarea {
    height: 48px;
    box-sizing: border-box;
    margin: 4px 0 0 36px;
    resize: none;
    border-radius: 3px;
    font-family: sans-serif;
    font-size: 11px;
    padding: 2px;
    line-break: anywhere;
  }
}
