@use '../../../../shared/styles/settings-shared' as settings;

.settings-card {
  @include settings.settings-card;
}

.section-header {
  @include settings.settings-section-header;
}

.section-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;

  @media (max-width: 767px) {
    flex-direction: column;
    align-items: stretch;

    p-button {
      align-self: flex-end;
    }
  }
}

.section-header-text {
  flex: 1;
}

.section-title {
  @include settings.settings-section-title;
}

.section-description {
  @include settings.settings-section-description;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

// Empty state
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--p-text-muted-color);
  background: color-mix(in srgb, var(--ground-background) 50%, var(--p-surface-800) 50%);
  border-radius: 6px;

  .pi {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
  }

  .empty-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--p-text-color);
  }

  .empty-subtitle {
    font-size: settings.$settings-section-description-size;
    margin: 0;
  }
}

// Recipients list
.recipients-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recipient-item {
  background: color-mix(in srgb, var(--ground-background) 50%, var(--p-surface-800) 50%);
  border: 1px solid var(--p-content-border-color);
  border-left: 3px solid var(--p-content-border-color);
  border-radius: 6px;
  padding: 0.875rem 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;

  &:hover {
    background: color-mix(in srgb, var(--ground-background) 40%, var(--p-surface-800) 60%);
  }

  &.is-default {
    border-left-color: var(--p-primary-color);
  }
}

.recipient-content {
  display: flex;
  align-items: center;
  gap: 1rem;

  @media (max-width: 767px) {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
}

.recipient-select {
  flex-shrink: 0;

  @media (max-width: 767px) {
    align-self: flex-start;
  }
}

.recipient-info {
  flex: 1;
  min-width: 0;
}

.recipient-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.recipient-email {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--p-text-color);

  .pi {
    font-size: 0.875rem;
    color: var(--p-primary-color);
  }
}

.recipient-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: settings.$settings-description-size;
  color: var(--p-text-muted-color);

  .pi {
    font-size: 0.75rem;
    color: var(--p-text-muted-color);
  }
}

.default-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  background: color-mix(in srgb, var(--p-primary-color) 15%, transparent);
  color: var(--p-primary-color);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

// Edit form
.edit-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;

  @media (max-width: 767px) {
    flex-direction: column;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 180px;

  input {
    width: 100%;
  }
}

.field-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: settings.$settings-description-size;
  font-weight: 500;
  color: var(--p-text-muted-color);

  .pi {
    font-size: 0.75rem;
    color: var(--p-primary-color);
  }
}

.recipient-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;

  @media (max-width: 767px) {
    justify-content: flex-end;
  }
}
