/* ============================================================
   TRENDTER — Emoji Picker
   assets/css/emoji-picker.css
   ============================================================ */

.ep-wrap {
  position: fixed;
  z-index: 9999;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  width: 336px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-body, system-ui, sans-serif);
  animation: ep-appear 0.12s ease-out both;
}
@keyframes ep-appear {
  from { opacity:0; transform: scale(0.94) translateY(4px); }
  to   { opacity:1; transform: scale(1)    translateY(0); }
}

/* ── Search ──────────────────────────────────────────────── */
.ep-search {
  padding: 10px 12px 6px;
  flex-shrink: 0;
}
.ep-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 50px;
  background: var(--bg2, #f5f5f5);
  color: var(--text, #111);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.ep-search input:focus { border-color: var(--accent, #FF662E); }
.ep-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text3, #999);
  pointer-events: none;
}
.ep-search-wrap { position: relative; }

/* ── Category tabs ───────────────────────────────────────── */
.ep-tabs {
  display: flex;
  align-items: center;
  padding: 0 6px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 2px;
}
.ep-tabs::-webkit-scrollbar { display: none; }

.ep-tab {
  padding: 7px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 17px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: background 0.12s, border-color 0.12s;
  flex-shrink: 0;
  line-height: 1;
}
.ep-tab:hover { background: var(--bg2, #f5f5f5); }
.ep-tab.active {
  border-bottom-color: var(--accent, #FF662E);
  background: var(--accent-bg, rgba(255,102,46,0.07));
}

/* ── Body / Scrollable area ──────────────────────────────── */
.ep-body {
  overflow-y: auto;
  flex: 1;
  padding: 6px 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border, #ddd) transparent;
}
.ep-body::-webkit-scrollbar { width: 4px; }
.ep-body::-webkit-scrollbar-track { background: transparent; }
.ep-body::-webkit-scrollbar-thumb { background: var(--border, #ddd); border-radius: 2px; }

/* ── Category title ──────────────────────────────────────── */
.ep-cat-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3, #999);
  padding: 8px 2px 4px;
}

/* ── Emoji grid ──────────────────────────────────────────── */
.ep-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
}

.ep-btn {
  width: 36px;
  height: 36px;
  font-size: 20px;
  background: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, transform 0.08s;
  line-height: 1;
}
.ep-btn:hover {
  background: var(--bg2, #f5f5f5);
  transform: scale(1.2);
}
.ep-btn:active { transform: scale(1.0); }

/* ── Empty state (search no results) ────────────────────── */
.ep-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text3, #999);
  font-size: 13px;
}
.ep-empty-icon { font-size: 28px; margin-bottom: 6px; }

/* ── Mobile: full-bottom-sheet on small screens ──────────── */
@media (max-width: 480px) {
  .ep-wrap {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-height: 60vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    animation: ep-slide-up 0.2s ease-out both;
  }
  @keyframes ep-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .ep-grid { grid-template-columns: repeat(9, 1fr); }
  .ep-btn  { width: 38px; height: 38px; }
}

/* ── Trigger button (the 😊 button in composer) ──────────── */
.ep-trigger-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}
.ep-trigger-btn:hover { background: var(--bg2, #f5f5f5); }
.ep-trigger-btn svg { width: 18px; height: 18px; stroke: var(--accent, #FF662E); }