/* Root styles */
.root {
  height: 100%;
  color: var(--mantine-color-white);

  &:hover {
    .image {
      transform: scale(1.05);
    }

    &:after {
      transform: scale(1.05);
      opacity: 0;
    }
  }
}

/* Image styles */
.image {
  height: 100% !important;
  object-fit: cover;
  /* TODO: Mantine7: this needs to be set based on the aspect ratio */
  object-position: top center;
  transition: transform 400ms ease;
  min-width: 100%;
}

/* Header styles */
.header {
  padding: 12px;
  background: light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-7));
  width: 100%;
}

/* Content styles */
.content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0;
  transition: var(--mantine-transition-fadeIn);
}

/* No image styles */
.noImage {
  background-color: light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-6));
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  }
}

/* Gradient overlay */
.gradientOverlay {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

/* Full overlay */
.fullOverlay {
  display: flex;
  justify-content: end;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

/* Content overlay */
.contentOverlay {
  position: absolute;
  width: 100%;
  left: 0;
  z-index: 10;
  padding: var(--mantine-spacing-sm);
}

/* Top and bottom positioning */
.top {
  top: 0;
}

.bottom {
  bottom: 0;
}

/* Icon badge */
.iconBadge {
  color: var(--mantine-color-white);
  background-color: rgba(0, 0, 0, 0.31);
}

/* Info chip */
.infoChip {
  border-radius: var(--mantine-radius-sm);
  background-color: rgba(0, 0, 0, 0.31);
  color: var(--mantine-color-white);
  font-weight: bold;

  & .mantine-Badge-label {
    display: flex;
    overflow: visible;
  }

  .mantine-Divider-root {
    margin: -4px 8px;
    border-left-color: rgba(255, 255, 255, 0.31);
    border-right-color: rgba(0, 0, 0, 0.2);
    border-right-width: 1px;
    border-right-style: solid;
  }
}

/* For moderation */
.forMod {
  background-color: rgba(224, 187, 228, 0.8);
  /* Light violet color */
  color: var(--mantine-color-white);
}

/* Reactions */
.reactions {
  border-radius: var(--mantine-radius-sm);
  background-color: rgba(0, 0, 0, 0.31);
  box-shadow: 0 -2px 6px 1px rgba(0, 0, 0, 0.16);
  height: 28px;
  padding-right: 3px;
}

/* Stat chip */
.statChip {
  border-radius: var(--mantine-radius-sm);
  background-color: rgba(0, 0, 0, 0.31);
  align-self: flex-start;
  color: var(--mantine-color-white);
  font-weight: bold;

  & .mantine-Badge-label {
    display: flex;
    overflow: visible;
    gap: var(--mantine-spacing-xs);
  }

  &[data-reviewed="true"] {
    background-color: alpha(var(--mantine-color-success-5), 0.2);
  }
}

/* Chip */
.chip {
  border-radius: var(--mantine-radius-xl);
  height: 26px;

  > * {
    font-weight: bold !important;
  }
}

/* No hover */
.noHover {
  &:hover {
    .image {
      transform: initial;
    }
  }
}

/* Image group container */
.imageGroupContainer {
  display: flex;
  flex-wrap: wrap;
  box-sizing: border-box;
  width: 100%;
  height: 100%;

  &>img,
  &>canvas {
    width: 50%;
    height: auto;
    flex-grow: 1;
    min-width: 50%;
    min-height: 50%;
  }
}

/* Image group container 4x4 */
.imageGroupContainer4x4 {

  &>img,
  &>canvas {
    height: 50%;
  }
}

/* Link */
.link {
  &:has(~ .frame-decor) .bottom {
    padding-bottom: 36px !important;
  }
}

/* Drop shadow */
.dropShadow {
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.8));
}

/* Winner styles */
.winnerFirst,
.winnerSecond,
.winnerThird {
  position: relative;
  width: 100%;

  &::before {
    content: '';
    position: absolute;
    background-size: 200% !important;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    filter: blur(8px);
    z-index: -1;
    & :global {
      animation: glowing 20s linear infinite;
    }
  }
}

.winnerFirst::before {
  background: linear-gradient(to right,
      #b97010 1%,
      #ad790a 17%,
      #ffd02a 31%,
      #fffbc2 47%,
      #ffd02a 64%,
      #ad8223 81%,
      #a36700 98%);
}

.winnerSecond::before {
  background: linear-gradient(to right,
      #808080 1%,
      #454349 17%,
      #7f8081 31%,
      #e9e9e9 47%,
      #7f8081 64%,
      #6b6970 81%,
      #606060 98%);
}

.winnerThird::before {
  background: linear-gradient(to right,
      #451500 1%,
      #6a2d06 17%,
      #995a2d 31%,
      #ffb382 47%,
      #995a2d 64%,
      #6a2d06 81%,
      #451500 98%);
}
