@use 'dotdotdot.scss';

:host {
  display: flex;
  flex-direction: column;
  justify-content: center;

  // Ensure error messages are selectable.
  user-select: text;
  // Safari only has prefixed support.
  -webkit-user-select: text;
}

:host(:not([overlay])) {
  height: 100%;
  width: 100%;

  background: var(--advanced-camera-card-message-background);
  color: var(--advanced-camera-card-message-color);
}

:host([overlay]) {
  position: absolute;
  inset: 5%;

  background: var(--advanced-camera-card-message-overlay-background);
  color: var(--advanced-camera-card-message-overlay-color);
}

div.wrapper {
  height: 100%;
}

div.message {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  height: 100%;
}

div.message.padded {
  padding: 20px;
}

div.message div.contents {
  display: flex;
  flex-direction: column;
  padding: 10px;
  margin-top: auto;
  margin-bottom: auto;
  min-width: 0;
}

div.message div.icon {
  padding: 10px;
}

.vertical {
  flex-direction: column;
}

a {
  word-break: break-word;
}

:host(:not([overlay])) a {
  color: var(--advanced-camera-card-message-color);
}

:host([overlay]) a {
  color: var(--advanced-camera-card-message-overlay-color);
}

.message pre {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px dotted var(--advanced-camera-card-divider-color);
  padding: 1em;
}
