// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC Sucursal en España SL

@use "refactor/common-refactor.scss" as deprecated;
@use "ds/typography.scss" as t;
@use "ds/spacing.scss" as *;
@use "ds/_sizes.scss" as *;
@use "ds/_utils.scss" as *;

.modal-overlay {
  @extend %modal-overlay-base;
}

.modal-container {
  @extend %modal-container-base;

  display: flex;
  flex-direction: column;
  min-width: deprecated.$s-408;
}

.modal-header {
  margin-bottom: deprecated.$s-24;
}

.modal-title {
  @include deprecated.uppercase-title-typography;

  color: var(--modal-title-foreground-color);
}

.modal-close-btn {
  @extend %modal-close-btn-base;
}

.modal-content {
  @include deprecated.flex-column;
  @include deprecated.body-small-typography;

  flex: 1 1 auto;
  min-height: 0;
  gap: deprecated.$s-24;
  margin-bottom: deprecated.$s-24;
}

.warning-notice {
  flex-shrink: 0;
}

.fields-row {
  @include deprecated.flex-column;
}

.select-title {
  @include deprecated.body-small-typography;

  color: var(--modal-title-foreground-color);
}

.organizations-section {
  @include t.use-typography("body-medium");

  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: var(--sp-l);
}

.organizations-section-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-xs);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.organizations-section-title {
  color: var(--color-accent-tertiary);
}

.organizations-section-arrow {
  color: var(--color-accent-tertiary);
  transition: transform 0.15s ease;
}

.organizations-section-arrow.expanded {
  transform: rotate(90deg);
}

.organization-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: var(--sp-l);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.organization-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-s);
}

.organization-info {
  display: flex;
  flex-direction: column;
}

.organization-name {
  color: var(--modal-title-foreground-color);
}

.organization-counts {
  display: flex;
  flex-direction: row;
  gap: var(--sp-s);
  color: var(--df-secondary);
}

.action-buttons {
  @extend %modal-action-btns;
}

.cancel-button {
  @extend %modal-cancel-btn;
}

.accept-button {
  @extend %modal-accept-btn;

  &.danger {
    @extend %modal-danger-btn;
  }
}
