/* ==========================================================================
   08-stickers.css — Static Stickers & Sound Tray for Sorry Kitty Chat (v2.1.0)
   Features: Transparent Tray + Clean White Floating Frames + Interactive Mute Toggle
   ========================================================================== */

/* ── Sticker Tray Container (Transparent, only floating white tiles) ───── */
.sticker-tray {
  position: relative;
  z-index: 12;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.22s ease;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

.sticker-tray.is-open {
  max-height: 110px;
  opacity: 1;
  pointer-events: auto;
}

/* ── Horizontal Scroll Inner Row ───────────────────────────────────────── */
.sticker-tray-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
  background: transparent !important;
}
.sticker-tray-inner::-webkit-scrollbar {
  display: none;
}

/* ── Individual Sticker Tile (Crisp White Framed Square) ───────────────── */
.sticker-tile {
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  background: #ffffff;
  border: 1.5px solid rgba(196, 130, 42, 0.18);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(61, 26, 0, 0.08);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease,
              border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;
}

.sticker-tile:hover {
  transform: translateY(-3px) scale(1.06);
  border-color: #ff7a65;
  box-shadow: 0 8px 20px rgba(255, 107, 84, 0.22);
}

.sticker-tile:active {
  transform: translateY(0) scale(0.94);
  box-shadow: 0 2px 6px rgba(61, 26, 0, 0.1);
}

.sticker-tile:focus-visible {
  outline: 2.5px solid #ff6b54;
  outline-offset: 2px;
}

/* ── Skeleton Shimmer Loading States for Stickers ──────────────────────── */
.skel-sticker-tile {
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  border-radius: 18px;
  background: linear-gradient(90deg, #f5e6cc 25%, #fdf6ec 50%, #f5e6cc 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s infinite linear;
  box-shadow: 0 4px 14px rgba(61, 26, 0, 0.05);
}

.skel-sticker-shimmer {
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  background: linear-gradient(90deg, #f5e6cc 25%, #fdf6ec 50%, #f5e6cc 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s infinite linear;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.2s ease;
}

.sticker-tile.is-loading {
  background: #ffffff;
}

/* ── Sticker Image inside Tile ─────────────────────────────────────────── */
.sticker-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.4, 1);
}

.sticker-tile img.loaded {
  opacity: 1;
}

/* ── Nano Speaker / Mute Toggle Button on Sticker Tile ─────────────────── */
.sticker-mute-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(196, 130, 42, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 2px 6px rgba(61, 26, 0, 0.12);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.15s ease,
              border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  outline: none;
}

.sticker-mute-btn:hover {
  transform: scale(1.18);
  background: #ffffff;
  border-color: #ff6b54;
  box-shadow: 0 3px 8px rgba(255, 107, 84, 0.25);
}

.sticker-mute-btn:active {
  transform: scale(0.9);
}

.sticker-mute-btn.is-muted {
  background: #fff0f0;
  border-color: #ff5252;
  box-shadow: 0 2px 6px rgba(255, 82, 82, 0.25);
}

.sticker-mute-btn .mute-icon {
  user-select: none;
  pointer-events: none;
  display: block;
}

/* ── Sticker Chat Bubble Rendering ─────────────────────────────────────── */
.moment-bubble.is-sticker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative;
}

.moment-bubble.is-sticker .moment-bubble-sender {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 8px;
  border-radius: 10px;
}

.skel-bubble-sticker {
  width: min(130px, 42vw);
  height: 120px;
  border-radius: 16px;
  background: linear-gradient(90deg, #f5e6cc 25%, #fdf6ec 50%, #f5e6cc 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s infinite linear;
  box-shadow: 0 4px 14px rgba(61, 26, 0, 0.08);
}

.moment-bubble.is-sticker .moment-sticker-img {
  width: min(130px, 42vw);
  height: auto;
  max-height: 130px;
  object-fit: contain;
  border-radius: 14px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 6px 16px rgba(61, 26, 0, 0.18));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.moment-bubble.is-sticker:hover .moment-sticker-img {
  transform: scale(1.06);
}

.moment-bubble.is-sticker:active .moment-sticker-img {
  transform: scale(0.95);
}

/* Tiny sound / muted badge on bubble */
.moment-bubble-sound-badge {
  position: absolute;
  bottom: 2px;
  right: 6px;
  font-size: 12px;
  opacity: 0.7;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.8));
  pointer-events: none;
}

/* ── Mobile Optimization ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .sticker-tray.is-open {
    max-height: 98px;
  }
  .sticker-tray-inner {
    gap: 8px;
    padding: 6px 12px;
  }
  .sticker-tile, .skel-sticker-tile {
    flex: 0 0 66px;
    width: 66px;
    height: 66px;
    border-radius: 16px;
    padding: 5px;
  }
  .sticker-mute-btn {
    width: 20px;
    height: 20px;
    font-size: 10px;
    bottom: 3px;
    right: 3px;
  }
  .moment-bubble.is-sticker .moment-sticker-img, .skel-bubble-sticker {
    width: min(115px, 40vw);
    max-height: 115px;
  }
}
