// Copyright (C) 2026 The Android Open Source Project
//
// 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 "../../assets/theme.scss";

// Inline settings renderer
.pf-extension-servers-settings {
  &__header {
    margin-bottom: 12px;
  }

  &__empty {
    padding: 20px;
    text-align: center;
  }

  &__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  &__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--pf-minimal-background);
    border: 1px solid var(--pf-border);
    border-radius: 4px;

    &:hover {
      background: var(--pf-minimal-hover-background);
    }
  }

  &__item-content {
    flex: 1;
    min-width: 0;
  }

  &__item-url {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__item-info {
    font-size: 12px;
    color: var(--pf-text-secondary);
    margin-top: 4px;
  }

  &__item-actions {
    display: flex;
    gap: 4px;
    margin-left: 12px;
  }
}

// Add/Edit Extension Server modal
.pf-add-extension-server-modal {
  width: 100%;
  min-width: 350px;
  min-height: 450px;

  // Last form section (Modules) fills remaining space
  .pf-form__section:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  &__refresh {
    display: flex;
    justify-content: flex-end;
  }

  .pf-empty-state {
    flex: 1;

    &__title {
      word-wrap: break-word;
      white-space: normal;
    }
  }

  .pf-multiselect-panel {
    flex: 1;
    min-height: 0;
    width: 100%;
  }
}

// Error modal for extension server loading failures
.pf-ext-server-errors {
  max-height: 200px;
  overflow-y: auto;
}
