/* Add Emoji on Face  additions on top of app.css */
.aef-root { padding-top: 1rem; padding-bottom: 3rem; }

.aef-info-list { list-style: none; padding: 0; margin: 1rem 1rem 0; text-align: left; }
.aef-info-list li { padding: .5rem 0 .5rem 1.5rem; position: relative; color: #4b5563; font-size: .95rem; line-height: 1.5; }
.aef-info-list li::before { content: ""; position: absolute; left: 0; top: .85rem; width: 8px; height: 8px; border-radius: 50%; background-image: linear-gradient(to right, var(--gradient-primary), var(--gradient-secondary)); }

.workspace.aef-workspace { display: none; }
.workspace.aef-workspace.aef-open { display: block; }

.aef-image-section {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 400px; position: relative;
  background-color: #fff;
}
.aef-canvas-wrap { display: inline-block; max-width: 100%; position: relative; }
.aef-canvas { position: relative; line-height: 0; box-shadow: 0 6px 18px rgba(0,0,0,.08); border-radius: 6px; overflow: hidden; background: #fff; display: inline-block; }
.aef-base-img { display: block; max-width: 100%; max-height: 65vh; width: auto; height: auto; }
.aef-base-img:not([src]) { display: none; }
.aef-layers { position: absolute; inset: 0; }
.aef-hint { font-size: .8rem; color: #6a7280; }

/* Layer */
.aef-layer { position: absolute; touch-action: none; cursor: move; will-change: transform; user-select: none; -webkit-user-select: none; }
.aef-layer.aef-selected { outline: 2px solid var(--gradient-primary); outline-offset: 0; }
.aef-layer .aef-layer-emoji {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
  user-select: none; -webkit-user-select: none;
}
.aef-layer .aef-layer-img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.aef-handle { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--gradient-primary); border-radius: 50%; display: none; z-index: 3; }
.aef-layer.aef-selected .aef-handle { display: block; }
.aef-handle.aef-h-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.aef-handle.aef-h-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.aef-handle.aef-h-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.aef-handle.aef-h-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.aef-handle.aef-h-rot { top: -30px; left: 50%; transform: translateX(-50%); cursor: grab; background: var(--gradient-primary); border-color: #fff; }
.aef-handle.aef-h-rot::after { content: ""; position: absolute; left: 50%; top: 12px; width: 1px; height: 15px; background: var(--gradient-primary); transform: translateX(-50%); }

/* Right panel */
.aef-options { min-height: 500px; }

.aef-tabs .button { padding: 8px 4px; font-size: 12px; flex-direction: column; gap: 2px; }
.aef-tabs .button svg { height: 16px; width: 16px; margin-right: 0; }
.aef-tabs .button span { font-size: 11px; }
.aef-tabs :nth-child(3) { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }

.aef-panel-hint { color: #6a7280; font-size: .85rem; margin-bottom: .75rem; }

/* Emoji picker */
.aef-emoji-search { margin-bottom: .5rem !important; }
.aef-cat-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: .5rem;
  scrollbar-width: none;
}
.aef-cat-tabs::-webkit-scrollbar { display: none; }
.aef-cat-btn {
  flex: 0 0 auto;
  border: 1px solid #e4e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: border-color .15s ease, background .15s ease;
}
.aef-cat-btn:hover { border-color: var(--gradient-primary); }
.aef-cat-btn.aef-cat-active { border-color: var(--gradient-primary); background: rgba(101,87,255,.08); }

.aef-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 340px;
  overflow-y: auto;
  padding: 2px;
}
.aef-emoji-btn {
  aspect-ratio: 1/1;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 22px;
  padding: 0;
  transition: background .12s ease, border-color .12s ease;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
  line-height: 1;
}
.aef-emoji-btn:hover { background: rgba(101,87,255,.08); border-color: rgba(101,87,255,.3); }
.aef-emoji-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #8892a3;
  font-size: .85rem;
  padding: 1.5rem 0;
}

/* Layer list */
.aef-layer-list { list-style: none; padding: 0; margin: 0 0 .5rem; max-height: 220px; overflow-y: auto; }
.aef-layer-list li {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  background: #fff;
  margin-bottom: .35rem;
  font-size: .85rem;
  cursor: pointer;
}
.aef-layer-list li:hover { border-color: #cfc9ff; }
.aef-layer-list li.aef-li-selected { border-color: var(--gradient-primary); box-shadow: 0 0 0 2px rgba(101,87,255,.1); }
.aef-layer-list li .aef-thumb {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: #f4f4f5;
  border-radius: 6px;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  overflow: hidden;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}
.aef-layer-list li .aef-thumb img { width: 100%; height: 100%; object-fit: cover; }
.aef-layer-list li .aef-li-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #222b3a; }
.aef-layer-list li .aef-li-del { border: none; background: transparent; color: #b42318; cursor: pointer; padding: 4px; border-radius: 4px; }
.aef-layer-list li .aef-li-del:hover { background: #fff1f0; }
.aef-layer-list li.aef-li-empty { border: 1px dashed #e4e7eb; color: #8892a3; justify-content: center; cursor: default; font-style: italic; }

/* Props block */
.aef-props { background: #fff; border: 1px solid #e4e7eb; border-radius: 10px; padding: 12px 14px; }
.aef-props .ep-header { padding: 0 0 8px; }
.aef-props .ep-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: #55606f; }
.aef-props .option-label { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; margin-bottom: 6px; }
.aef-num { font-size: .8rem; color: #222b3a; font-weight: 600; }
.aef-mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.aef-mini { font-size: .82rem; padding: 8px 12px; width: 100%; }
.aef-mini-danger { background: #b42318 !important; }

/* Download */
.aef-download-block .editor-panel { border: 1px solid #e4e7eb; border-radius: 10px; padding: 12px 14px; background: #fff; }
.aef-download-block .ep-header { padding: 0 0 8px; }
.aef-download-block .ep-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: #55606f; }
.aef-fmt-tabs { margin-top: .5rem; }
.aef-fmt-tabs :nth-child(3) { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.aef-reset-btn { width: 100%; }

@media (max-width: 767px) {
  .aef-image-section { min-height: 320px; padding: 12px !important; }
  .aef-emoji-grid { grid-template-columns: repeat(7, 1fr); }
}
