/* Styles for emoticons inserted via SA Emoticon Picker plugin */
.sa-emoticon {
  width: 72px;
  max-width: 72px;
  height: auto;
  display: inline-block;
  vertical-align: middle;
  margin: 2px 4px;
  border-radius: 6px;
  object-fit: contain;
}

/* Styles for the comment picker button and modal used for KBoard integration */
.sa-emo-comment-button {
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1;
  background-color: #f5f7fa;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* Hover state for the comment button */
.sa-emo-comment-button:hover {
  background-color: #e8ebf0;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Wrapper around the comment button. By setting display:block and margin,
   we ensure the button appears on its own row above the comment textarea
   instead of inline with other elements. */
.sa-emo-comment-button-wrapper {
  display: block;
  margin-bottom: 8px;
}

.sa-emo-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sa-emo-modal .sa-emo-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.sa-emo-modal .sa-emo-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: 0.15s ease;
}

.sa-emo-modal .sa-emo-item:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sa-emo-modal .sa-emo-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}

.sa-emo-modal .sa-emo-name {
  font-size: 12px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .sa-emoticon {
    width: 56px;
    max-width: 56px;
  }
}