/*
  dumps.fm (rebuild) - Chat Styles
  Purpose: Chat feed + dumps row styling, including inline image rules.
  Dependencies: `public/css/main.css` variables.
  Dependents: `public/index.html`.
*/

.chat {
  background: var(--bg-chat);
  overflow: hidden;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat__feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
}

.dumps {
  position: relative;
  margin: 0 0 14px 0;
  padding: 0;
}

.dumps__header {
  display: inline;
}

.dumps__username {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  margin-right: 4px;
}

.dumps__heart {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-right: 6px;
}

.dumps__fav {
  border: 0;
  background: transparent;
  padding: 0;
  margin-left: 6px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dumps__fav img {
  width: 25px;
  height: 25px;
  display: block;
  image-rendering: pixelated;
}

.dumps__fav-count {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  line-height: 1;
  pointer-events: none;
}

.dumps__fav-text {
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.dumps__fav--corner {
  position: absolute;
  top: -6px;
  right: -6px;
  margin-left: 0;
}

.dumps__modbtn {
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 16px;
  border: 1px solid var(--border-dark);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  display: none; /* do not reserve space when hidden (prevents huge gap before text) */
  opacity: 0.0;
  transition: opacity 120ms ease;
}

.dumps:hover .dumps__modbtn,
.dumps:focus-within .dumps__modbtn {
  display: inline-block;
  opacity: 0.9;
}

.dumps__modbtn--danger {
  border-color: #ff8989;
}

.dumps__content {
  display: inline;
  font-size: 14px;
}

.dumps__text {
  font-family: var(--font-mono);
}

.dumps__images {
  display: inline;
  font-size: 0; /* eliminate whitespace between inline-block images */
}

.dumps__images img {
  max-width: 500px;
  max-height: 500px;
  width: auto;
  height: auto;
  display: inline-block;
  vertical-align: text-bottom;
  margin: 0;
  padding: 0;
}

.dumps__images .dumps__media {
  display: inline-block;
  vertical-align: text-bottom;
  margin: 0;
  padding: 0;
  max-width: 500px;
}

.dumps__images .dumps__media--video {
  max-height: 500px;
}

.dumps__images img.dumps__img--dead {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  object-fit: contain;
  image-rendering: auto;
  opacity: 0.9;
  margin-left: 2px;
}

body.night-mode .dumps__images img.dumps__img--dead {
  filter: invert(1) brightness(1.1) contrast(1.1);
  opacity: 0.85;
}

body.hide-images .dumps__images {
  display: none;
}

body.hide-text .dumps__text {
  display: none;
}

.dumps__fav-overlay {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 9;
  background-image: url("../assets/animations/fav-overlay.gif");
  background-repeat: repeat;
  background-position: 0 0;
  background-size: 96px 96px;
}



@keyframes fav-float-up {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
  18% {
    opacity: 0.95;
    transform: translateY(-22px) translateX(calc(0.25 * var(--drift-x, 0px)));
  }
  55% {
    opacity: 0.65;
    transform: translateY(calc(-0.5 * var(--float-distance, 160px))) translateX(calc(0.5 * var(--drift-x, 0px)));
  }
  100% {
    opacity: 0;
    transform: translateY(calc(-1 * var(--float-distance, 160px))) translateX(var(--drift-x, 0px));
  }
}



.notif-stack {
  position: fixed;
  right: 22px;
  bottom: 62px;
  top: auto;
  left: auto;
  width: 240px;
  height: 140px;
  overflow: hidden;
  pointer-events: none;
  z-index: 9;
}

.fav-notification {
  position: absolute;
  right: 0;
  background: rgba(231, 23, 23, 0.95);
  border: 1.5px rounded solid var(--border-primary);
  padding: 6px 10px;
  font-size: 12px;
  z-index: 5;
  animation: fav-float-up 9.0s ease-out forwards;
  max-width: 100%;
  overflow-wrap: normal;
  will-change: transform, opacity;
}

body.sunset-mode .fav-notification {
  background: rgb(167, 26, 255);
  border-color: rgb(255, 255, 255);
  color: var(--text-primary);
}

body.sunrise-mode .fav-notification {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(58, 42, 34, 0.16);
  color: var(--text-primary);
}
