/* XCHAT_CHAT_PHOTO_CSS_V2_2R1 */

.xchat-photo-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 134px;
  max-height: 102px;
  margin: 2px 1px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 3px;
  background: rgba(0,0,0,.16);
  vertical-align: middle;
  cursor: zoom-in;
  appearance: none;
  -webkit-appearance: none;
}

.xchat-photo-thumb:hover {
  border-color: rgba(255,255,255,.58);
}

.xchat-photo-thumb img {
  display: block;
  width: auto;
  height: auto;
  max-width: 128px;
  max-height: 96px;
  object-fit: contain;
}

.xchat-photo-expired {
  opacity: .62;
  font-style: italic;
  white-space: nowrap;
}


#sendForm > #xchatPhotoButton:not([hidden]) {
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 1px solid rgba(52,137,255,.72) !important;
  border-radius: 6px !important;
  background:
    linear-gradient(
      180deg,
      rgba(15,39,91,.98),
      rgba(5,15,50,.99)
    ) !important;
  color: #dcecff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 0 0 13px rgba(31,88,209,.05),
    0 0 4px rgba(35,111,255,.18)
    !important;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    transform 90ms ease
    !important;
  cursor: pointer !important;
}

#sendForm > #xchatPhotoButton:hover {
  border-color: rgba(93,195,255,.98) !important;
  background:
    linear-gradient(
      180deg,
      rgba(20,55,123,.99),
      rgba(7,25,72,.99)
    ) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.09),
    0 0 8px rgba(49,160,255,.55),
    0 0 18px rgba(25,89,255,.14)
    !important;
}

#sendForm > #xchatPhotoButton:focus-visible {
  outline: 1px solid rgba(112,211,255,.95) !important;
  outline-offset: 2px !important;
}

#sendForm > #xchatPhotoButton:disabled {
  opacity: .58 !important;
  cursor: wait !important;
}

#xchatPhotoButton .xchat-photo-clip-icon {
  pointer-events: none;
  filter:
    drop-shadow(
      0 1px 1px
      rgba(0,0,0,.35)
    );
}


/*
 * XCHAT_MOBILE_VIP_CLIP_HIDDEN_V1
 *
 * The presence of the DOM node must never reserve a composer
 * column for a user without chat-photo capability.
 */

.xchat-mobile-photo-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
  pointer-events: none;
}

.xchat-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0,0,0,.87);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.xchat-photo-lightbox[hidden] {
  display: none !important;
}

.xchat-photo-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow:
    0 12px 44px
    rgba(0,0,0,.5);
}

.xchat-photo-lightbox-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(20,20,20,.75);
  font: 32px/40px Arial,sans-serif;
  cursor: pointer;
}

.xchat-photo-lightbox-status {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(90vw,520px);
  padding: 7px 11px;
  border-radius: 4px;
  color: #fff;
  background: rgba(0,0,0,.68);
  font: 13px/1.35 Verdana,Arial,sans-serif;
  text-align: center;
}

.xchat-photo-drop {
  position: fixed;
  inset: 18px;
  z-index: 2147481900;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  border: 2px dashed rgba(255,255,255,.72);
  border-radius: 8px;
  background: rgba(22,30,52,.75);
  color: #fff;
  font: 700 18px/1.3 Verdana,Arial,sans-serif;
  text-shadow: 0 1px 2px #000;
}

.xchat-photo-drop.is-visible {
  display: flex;
}

.xchat-photo-toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  z-index: 2147482000;
  transform: translateX(-50%);
  max-width: min(88vw,520px);
  padding: 7px 11px;
  border-radius: 4px;
  color: #fff;
  background: rgba(0,0,0,.84);
  font: 12px/1.35 Verdana,Arial,sans-serif;
  text-align: center;
  pointer-events: none;
}

@media (max-width:700px) {
  .xchat-photo-thumb {
    max-width: 140px;
    max-height: 106px;
  }

  .xchat-photo-thumb img {
    max-width: 134px;
    max-height: 100px;
  }

  .xchat-photo-lightbox {
    padding: 12px;
  }

  .xchat-photo-lightbox img {
    max-width: 96vw;
    max-height: 88vh;
  }

  .xchat-photo-toast {
    bottom: 82px;
    font-family: system-ui,sans-serif;
  }
}


/* ==========================================================
 * XCHAT_CHAT_PHOTO_DELETE_V1
 * Author-only delete control.
 * ========================================================== */

.xchat-photo-frame {
  position: relative;

  display: inline-flex;

  max-width: 100%;

  vertical-align: middle;
}


.xchat-photo-delete {
  position: absolute;

  top: -6px;
  right: -6px;

  z-index: 2;

  display: inline-grid;
  place-items: center;

  width: 19px;
  height: 19px;

  padding: 0;

  border:
    1px solid
    rgba(255,255,255,.66);

  border-radius: 50%;

  background:
    rgba(9,18,42,.96);

  color: #fff;

  box-shadow:
    0 1px 5px
    rgba(0,0,0,.52);

  font:
    700 16px/17px
    Arial,
    sans-serif;

  cursor: pointer;

  opacity: .34;

  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background 120ms ease;
}


.xchat-photo-frame:hover
.xchat-photo-delete,
.xchat-photo-delete:focus-visible {
  opacity: 1;
}


.xchat-photo-delete:hover {
  background:
    rgba(139,27,42,.97);

  transform:
    scale(1.07);
}


.xchat-photo-delete:active {
  transform:
    scale(.94);
}


.xchat-photo-delete:disabled {
  opacity: .52;

  cursor: wait;

  transform: none;
}


@media (max-width: 700px) {
  .xchat-photo-delete {
    top: -7px;
    right: -7px;

    width: 23px;
    height: 23px;

    font-size: 18px;
    line-height: 21px;

    opacity: .94;
  }
}

/* XCHAT_RESPONSIVE_INPUT_V3: optional fifth track, no empty VIP column. */
@media (max-width: 1024px) {
  #sendForm:has(> #xchatPhotoButton:not([hidden])) {
    --xchat-photo-track: 36px;
    --xchat-smile-column: 4;
    --xchat-send-column: 5;
  }
}
