/* ======================================================
   EMOJI STRIP + SMAJLIĆI U CHATU
   Nova varijanta – pill bar iznad inputa
   ====================================================== */

/* Wrapper drži traku odvojenu od poruka i forme za slanje. */
.emoji-strip-wrapper {
  position: relative;
  z-index: 4;

  margin-top: 7px;
  margin-bottom: 6px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;

  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* Topli jantarni akcent dopunjuje tirkiznu formu za slanje. */
#emojiStrip,
.emoji-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;

  gap: 15px;

  max-width: 100%;
  padding: 7px 13px;

  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(245, 158, 11, .09), transparent 26%),
    rgba(11, 16, 27, .94);
  border: 1px solid rgba(251, 191, 36, .2);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, .24),
    inset 3px 0 0 rgba(245, 158, 11, .72),
    inset 0 1px 0 rgba(255, 255, 255, .035);

  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, .55) transparent;

  white-space: nowrap;
}

/* Scrollbar (WebKit) – tanak, diskretan */
#emojiStrip::-webkit-scrollbar,
.emoji-strip::-webkit-scrollbar {
  height: 4px;
}
#emojiStrip::-webkit-scrollbar-track,
.emoji-strip::-webkit-scrollbar-track {
  background: transparent;
}
#emojiStrip::-webkit-scrollbar-thumb,
.emoji-strip::-webkit-scrollbar-thumb {
  background: linear-gradient(
    90deg,
    rgba(245, 158, 11, .72),
    rgba(251, 191, 36, .88)
  );
  border-radius: 999px;
}

/* Pojedinačni smajlić – samo ikona, bez pozadine i okvira */
.emoji-strip-item {
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transform-origin: center;
  transition:
    transform 0.12s ease-out,
    filter 0.16s ease-out,
    opacity 0.18s ease-out;

  opacity: 0;
  animation: emoji-strip-in 0.22s cubic-bezier(0.22,0.61,0.36,1) forwards;
}

/* Ikonica u traci – veća, xat feeling, ali čisto */
.emoji-strip-item img {
  display: block;
  width: 32px;
  height: 32px;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
}

/* Lagani hover/tap efekt – samo pop + glow, bez kružića oko */
@media (hover:hover) and (pointer:fine) {
  .emoji-strip-item:hover,
  .emoji-strip-item:focus-visible {
    transform: translateY(-1px) scale(1.1);
    filter:
      drop-shadow(0 0 4px rgba(251, 191, 36, .62))
      drop-shadow(0 7px 15px rgba(0, 0, 0, .75));
  }
}

.emoji-strip-item:active {
  transform: translateY(0) scale(0.95);
  filter:
    drop-shadow(0 0 2px rgba(15,23,42,0.9))
    drop-shadow(0 3px 8px rgba(0,0,0,0.8));
}

/* Stagger ulaza za prvih 16 smajlića – suptilno */
.emoji-strip-item:nth-child(1)  { animation-delay: 0.02s; }
.emoji-strip-item:nth-child(2)  { animation-delay: 0.04s; }
.emoji-strip-item:nth-child(3)  { animation-delay: 0.06s; }
.emoji-strip-item:nth-child(4)  { animation-delay: 0.08s; }
.emoji-strip-item:nth-child(5)  { animation-delay: 0.10s; }
.emoji-strip-item:nth-child(6)  { animation-delay: 0.12s; }
.emoji-strip-item:nth-child(7)  { animation-delay: 0.14s; }
.emoji-strip-item:nth-child(8)  { animation-delay: 0.16s; }
.emoji-strip-item:nth-child(9)  { animation-delay: 0.18s; }
.emoji-strip-item:nth-child(10) { animation-delay: 0.20s; }
.emoji-strip-item:nth-child(11) { animation-delay: 0.22s; }
.emoji-strip-item:nth-child(12) { animation-delay: 0.24s; }
.emoji-strip-item:nth-child(13) { animation-delay: 0.26s; }
.emoji-strip-item:nth-child(14) { animation-delay: 0.28s; }
.emoji-strip-item:nth-child(15) { animation-delay: 0.30s; }
.emoji-strip-item:nth-child(16) { animation-delay: 0.32s; }

@keyframes emoji-strip-in {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ======================================================
   SMAJLIĆI UNUTAR CHAT PORUKA
   – čista ikona, bez kruga/okvira
   ====================================================== */

.chat-emoji {
  width: 21px;
  height: 21px;
  vertical-align: middle;
  margin: -1px 1px 0 1px;
  image-rendering: -webkit-optimize-contrast;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 0 2px rgba(15,23,42,0.95));
}

#msg[contenteditable="true"] {
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  line-height: 1.45;
}

#msg[contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  opacity: .9;
  pointer-events: none;
}

#msg .composer-emoji {
  display: inline-block;
  width: 27px;
  height: 27px;
  object-fit: contain;
  vertical-align: middle;
  margin: -3px 2px -2px;
  user-select: none;
}

@media (max-width: 640px) {
  #msg .composer-emoji {
    width: 25px;
    height: 25px;
  }
}

/* Desktop: malo veći emoji u porukama */
@media (min-width: 900px) {
  .chat-emoji {
    width: 24px;
    height: 24px;
    margin: -2px 1px 0 1px;
  }
}

/* Ako je poruka praktično samo emoji, povećaj ga još malo */
.msg span:only-child .chat-emoji:only-child {
  width: 30px;
  height: 30px;
  margin-top: -4px;
}

/* ======================================================
   MOBILNI / TABLET PRILAGODBE
   ====================================================== */

@media (max-width: 640px) {
  .emoji-strip-wrapper {
    margin-top: 6px;
    margin-bottom: 4px;
    padding: 0 2px;
    justify-content: center;
  }

  #emojiStrip,
  .emoji-strip {
    padding: 6px 10px;
    gap: 13px;
    max-width: 100%;
    border-radius: 12px;
    box-shadow:
      0 6px 16px rgba(0, 0, 0, .25),
      inset 3px 0 0 rgba(245, 158, 11, .72),
      inset 0 1px 0 rgba(255, 255, 255, .035);
    scrollbar-width: none;
  }

  #emojiStrip::-webkit-scrollbar,
  .emoji-strip::-webkit-scrollbar {
    height: 0;
  }

  .emoji-strip-item img {
    width: 24px;
    height: 24px;
  }

  .chat-emoji {
    width: 18px;
    height: 18px;
    margin: -1px 1px 0 1px;
  }
}

/* Tablet – između mobitela i desktopa */
@media (min-width: 641px) and (max-width: 900px) {
  .emoji-strip-wrapper {
    margin-top: 9px;
    margin-bottom: 8px;
  }

  #emojiStrip,
  .emoji-strip {
    padding: 5px 12px;
    gap: 16px;
  }

  .emoji-strip-item img {
    width: 28px;
    height: 28px;
  }

  .chat-emoji {
    width: 22px;
    height: 22px;
  }
}
