/* 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/. */

@import url("chrome://global/skin/design-system/text-and-typography.css");

:host {
  --avatar-size: 80px;
}

.profile-card {
  height: 185px;
  width: 200px;

  color: var(--button-text-color);
  border: var(--button-border);
  border-radius: var(--border-radius-medium);
  background-color: var(--button-background-color);
  box-shadow: var(--box-shadow-10);

  /* The profile card acts like a button but we don't want the hover styles to
   * apply to the card when we are hovering the child button elements. */
  &:hover:not(:has(moz-button:hover)) {
    background-color: var(--button-background-color-hover);
    border-color: var(--button-border-color-hover);
    color: var(--button-text-color-hover);
  }

  /* The profile card acts like a button but we don't want the active styles to
   * apply to the card when we are active on the child button elements. */
  &:hover:active:not(:has(moz-button:hover:active)) {
    background-color: var(--button-background-color-active);
    border-color: var(--button-border-color-active);
    color: var(--button-text-color-active);
  }

  &:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
  }
}

.new-profile-card.profile-card {
  border: var(--border-width) dashed currentColor !important;

  .profile-background-image {
    background-size: 33%;
  }

  .profile-details {
    border-top: var(--border-width) dashed currentColor;;
  }
}

.profile-background-container {
  position: relative;
  width: 200px;
  height: 136px;

  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-background-image {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url("chrome://global/skin/icons/plus.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  -moz-context-properties: fill, stroke;
  fill: currentColor;

  border-radius: var(--border-radius-medium) var(--border-radius-medium) 0 0;
}

.profile-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  z-index: 1;

  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  -moz-context-properties: fill, stroke;
}

.profile-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 49px;
  padding: 0 var(--space-large);
}
