/* The emoji picker (js/Common/EmojiPicker.js): the panel of the chat composer (placed in chat.css) and the emoji button of the SMS fields (textarea data-emoji) */

/* the panel; it uses the colors of the chat (--zc-*), which .zchat and .zemoji-field define */
.zc-emoji-char { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif; font-style: normal; line-height: 1; }
.zc-emoji { background: var(--zc-card); border: 1px solid var(--zc-line-strong); border-radius: 14px; box-shadow: 0 10px 28px rgba(24, 28, 50, .18); display: flex; flex-direction: column; overflow: hidden; animation: zc-emoji-in .14s ease-out; }
@keyframes zc-emoji-in { from { opacity: 0; transform: translateY(6px); } }
.zc-emoji-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--zc-line); }
.zc-emoji-tab { flex: 1; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 8px 8px 0 0; cursor: pointer; color: var(--zc-muted); font-size: 19px; position: relative; padding: 0; }
.zc-emoji-tab svg { width: 19px; height: 19px; }
.zc-emoji-tab .zc-emoji-char { filter: grayscale(1); opacity: .65; transition: filter .12s, opacity .12s; }
.zc-emoji-tab:hover { background: var(--zc-soft); }
.zc-emoji-tab:hover .zc-emoji-char, .zc-emoji-tab.zc-active .zc-emoji-char { filter: none; opacity: 1; }
.zc-emoji-tab.zc-active { color: var(--zc-primary-text); }
.zc-emoji-tab.zc-active::after { content: ""; position: absolute; inset-inline: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--zc-primary); }
.zc-emoji-title { font-size: 12px; font-weight: 600; color: var(--zc-muted); padding: 8px 12px 2px; }
.zc-emoji-grid { display: grid; grid-template-columns: repeat(var(--zc-emoji-cols, 8), 1fr); gap: 2px; padding: 4px 8px 10px; height: 236px; overflow-y: auto; align-content: start; overscroll-behavior: contain; }
.zc-emoji-grid button { aspect-ratio: 1; min-height: 36px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 23px; padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: transform .1s, background .1s; }
.zc-emoji-grid button:hover { background: var(--zc-soft); transform: scale(1.18); }
.zc-emoji-grid button:active { transform: scale(.92); }
.zc-emoji button:focus-visible { outline: 2px solid var(--zc-primary); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .zc-emoji { animation: none; } .zc-emoji-grid button, .zc-emoji-tab .zc-emoji-char { transition: none; } .zc-emoji-grid button:hover { transform: none; } }

/* a text field with the emoji button: the button sits in its bottom corner at the end of the line, the panel opens under it */
.zemoji-field {
    --zc-card: #FFFFFF;
    --zc-soft: #F3F6F9;
    --zc-line: #E4E6EF;
    --zc-line-strong: #D5DAE3;
    --zc-muted: #5E6278;
    --zc-primary: #1173D4;
    --zc-primary-text: #0B5CAD;
    --zc-primary-soft: #E1F0FF;
    position: relative;
}
html[data-theme=dark] .zemoji-field {
    --zc-card: #1E1E2D;
    --zc-soft: #2B2B40;
    --zc-line: #2B2B40;
    --zc-line-strong: #474761;
    --zc-muted: #A1A5B7;
    --zc-primary: #1173D4;
    --zc-primary-text: #7DBBFA;
    --zc-primary-soft: #1B3550;
}
.zemoji-field > textarea { padding-inline-end: 40px; }
/* a hidden field hides its button too */
.zemoji-field:has(> textarea.kt-hide), .zemoji-field:has(> textarea.d-none), .zemoji-field:has(> textarea[hidden]) { display: none; }
.zemoji-toggle { position: absolute; bottom: 6px; inset-inline-end: 6px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--zc-muted); cursor: pointer; z-index: 2; }
.zemoji-toggle svg { width: 20px; height: 20px; }
.zemoji-toggle:hover { background: var(--zc-soft); color: var(--zc-primary-text); }
.zemoji-toggle.zc-on { background: var(--zc-primary-soft); color: var(--zc-primary-text); }
.zemoji-toggle:focus { outline: none; }
.zemoji-toggle:focus-visible { outline: 2px solid var(--zc-primary); outline-offset: 1px; }
.zemoji-field .zc-emoji { position: absolute; top: calc(100% + 4px); bottom: auto; inset-inline-start: auto; inset-inline-end: 0; width: 336px; max-width: 100%; z-index: 1060; text-align: start; }
.zemoji-field.zemoji-up .zc-emoji { top: auto; bottom: calc(100% + 4px); }
/* on a phone the panel takes the width of the field and the emoji are bigger to touch */
@media (max-width: 575.98px) {
    .zemoji-field .zc-emoji { width: 100%; }
    .zemoji-field .zc-emoji-grid { height: 200px; }
    .zemoji-field .zc-emoji-grid button { font-size: 26px; }
    .zemoji-toggle { width: 36px; height: 36px; bottom: 4px; inset-inline-end: 4px; }
}
