/* ============================================================
   sticker.css — Sticker Creator (drop-up above the pinned bar)
   Light card skin like the activity windows. Rules are scoped to
   #sticker-dropup with !important on colours so themes can't
   repaint them.
   ============================================================ */

#sticker-dropup.sticker-dropup {
    --stk-ink: #1e293b;
    --stk-muted: #64748b;
    --stk-line: #e2e8f0;
    --stk-soft: #f8fafc;
    --stk-accent: #f59e0b;
    --stk-accent-2: #ec4899;
    --stk-focus: #6366f1;
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 640px;
    max-width: calc(var(--app-vw, 100vw) - 24px);
    max-height: min(78vh, calc(var(--app-vh, 100vh) - 120px));
    display: none;
    flex-direction: column;
    background: #ffffff !important;
    color: var(--stk-ink) !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28), 0 2px 8px rgba(15, 23, 42, .08);
    overflow: hidden;
    z-index: var(--z-dropdown, 1000);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .25s cubic-bezier(.2, .9, .3, 1.1);
    font-family: 'Outfit', 'Cairo', system-ui, sans-serif;
    text-align: start;
    -webkit-tap-highlight-color: transparent;
}
#sticker-dropup.sticker-dropup.show {
    display: flex;
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}
#sticker-dropup * { box-sizing: border-box; }
#sticker-dropup i { -webkit-text-fill-color: currentColor; }

/* ── Header ────────────────────────────────────────────────── */
#sticker-dropup .stk-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 12px;
    flex-shrink: 0;
}
#sticker-dropup .stk-logo {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--stk-accent), var(--stk-accent-2)) !important;
    color: #fff !important;
    font-size: 18px;
    box-shadow: 0 6px 14px rgba(236, 72, 153, .3);
    flex-shrink: 0;
}
#sticker-dropup .stk-titles { flex: 1; min-width: 0; }
#sticker-dropup .stk-title {
    font-size: 17px; font-weight: 700; line-height: 1.2;
    color: var(--stk-ink) !important;
    -webkit-text-fill-color: var(--stk-ink) !important;
}
#sticker-dropup .stk-subtitle {
    font-size: 12.5px;
    color: var(--stk-muted) !important;
    margin-top: 2px;
}
#sticker-dropup .stk-close {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: none !important;
    background: transparent !important;
    color: var(--stk-muted) !important;
    font-size: 16px;
    cursor: pointer;
    display: grid; place-items: center;
    flex-shrink: 0;
}
#sticker-dropup .stk-close:hover { background: #f1f5f9 !important; color: var(--stk-ink) !important; }

#sticker-dropup .stk-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Create box ────────────────────────────────────────────── */
#sticker-dropup .stk-create {
    border: 1.5px solid var(--stk-line);
    border-radius: 16px;
    background: var(--stk-soft) !important;
    padding: 10px;
    transition: border-color .15s, box-shadow .15s;
}
#sticker-dropup .stk-create:focus-within {
    border-color: var(--stk-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}
#sticker-dropup .stk-input-row { display: flex; gap: 8px; align-items: stretch; }
#sticker-dropup .stk-input {
    flex: 1;
    min-width: 0;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    color: var(--stk-ink) !important;
    -webkit-text-fill-color: var(--stk-ink) !important;
    box-shadow: none !important;
    font: 500 15px/1.4 'Outfit', 'Cairo', system-ui, sans-serif;
    padding: 8px 6px;
}
#sticker-dropup .stk-input::placeholder { color: #94a3b8 !important; -webkit-text-fill-color: #94a3b8 !important; }
#sticker-dropup .stk-go {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0 18px;
    min-height: 42px;
    border: none !important;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--stk-accent), var(--stk-accent-2)) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font: 700 14.5px 'Outfit', 'Cairo', system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(236, 72, 153, .28);
    transition: transform .12s, filter .12s, opacity .12s;
    white-space: nowrap;
}
#sticker-dropup .stk-go:hover { filter: brightness(1.05); transform: translateY(-1px); }
#sticker-dropup .stk-go:active { transform: scale(.97); }
#sticker-dropup .stk-go:disabled { opacity: .6; cursor: wait; transform: none; }

#sticker-dropup .stk-opts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--stk-line);
}
#sticker-dropup .stk-opt-label {
    font-size: 12px; font-weight: 600;
    color: var(--stk-muted) !important;
    margin-inline-end: 2px;
}
#sticker-dropup .stk-seg {
    display: inline-flex;
    background: #eef2f7 !important;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
#sticker-dropup .stk-seg button {
    border: none !important;
    background: transparent !important;
    color: var(--stk-muted) !important;
    -webkit-text-fill-color: var(--stk-muted) !important;
    font: 600 12.5px 'Outfit', 'Cairo', system-ui, sans-serif;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
#sticker-dropup .stk-seg button.on {
    background: #ffffff !important;
    color: var(--stk-ink) !important;
    -webkit-text-fill-color: var(--stk-ink) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
#sticker-dropup .stk-spacer { flex: 1; }
#sticker-dropup .stk-switch {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12.5px; font-weight: 600;
    color: var(--stk-muted) !important;
    cursor: pointer;
    user-select: none;
}
#sticker-dropup .stk-switch input { display: none; }
#sticker-dropup .stk-track {
    width: 32px; height: 18px;
    border-radius: 99px;
    background: #cbd5e1 !important;
    position: relative;
    transition: background .15s;
    flex-shrink: 0;
}
#sticker-dropup .stk-track::after {
    content: '';
    position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: transform .15s;
}
#sticker-dropup .stk-switch input:checked + .stk-track { background: var(--stk-focus) !important; }
#sticker-dropup .stk-switch input:checked + .stk-track::after { transform: translateX(14px); }
#sticker-dropup .stk-note {
    margin-top: 8px;
    font-size: 11.5px;
    color: #b45309 !important;
    display: flex; gap: 6px; align-items: center;
}
#sticker-dropup .stk-note[hidden] { display: none; }

/* ── Ideas ─────────────────────────────────────────────────── */
#sticker-dropup .stk-section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-bottom: 8px;
}
#sticker-dropup .stk-h {
    font-size: 13px; font-weight: 700;
    letter-spacing: .02em;
    color: var(--stk-ink) !important;
    -webkit-text-fill-color: var(--stk-ink) !important;
}
#sticker-dropup .stk-h small { font-weight: 500; color: var(--stk-muted) !important; -webkit-text-fill-color: var(--stk-muted) !important; margin-inline-start: 4px; }
#sticker-dropup .stk-tabs {
    display: flex; gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    margin-bottom: 10px;
}
#sticker-dropup .stk-tabs::-webkit-scrollbar { display: none; }
#sticker-dropup .stk-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: 99px;
    border: 1px solid var(--stk-line) !important;
    background: #fff !important;
    color: var(--stk-muted) !important;
    -webkit-text-fill-color: var(--stk-muted) !important;
    font: 600 12.5px 'Outfit', 'Cairo', system-ui, sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
#sticker-dropup .stk-tab i { color: var(--c) !important; }
#sticker-dropup .stk-tab:hover { border-color: var(--c) !important; }
#sticker-dropup .stk-tab.on {
    background: var(--c) !important;
    border-color: var(--c) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}
#sticker-dropup .stk-tab.on i { color: #fff !important; }

#sticker-dropup .stk-ideas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
}
#sticker-dropup .stk-idea {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--stk-line) !important;
    background: #fff !important;
    color: var(--stk-ink) !important;
    -webkit-text-fill-color: var(--stk-ink) !important;
    font: 600 13px 'Outfit', 'Cairo', system-ui, sans-serif;
    cursor: pointer;
    text-align: start;
    transition: transform .12s, box-shadow .12s, border-color .12s;
    min-width: 0;
}
#sticker-dropup .stk-idea span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sticker-dropup .stk-idea i {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: grid; place-items: center;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--c) !important;
    background: color-mix(in srgb, var(--c) 14%, #fff) !important;
}
#sticker-dropup .stk-idea:hover {
    border-color: var(--c) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
#sticker-dropup .stk-idea:disabled { opacity: .5; cursor: wait; transform: none; }

/* ── My stickers ───────────────────────────────────────────── */
#sticker-dropup .stk-tools { display: flex; align-items: center; gap: 6px; }
#sticker-dropup .stk-search {
    display: flex; align-items: center; gap: 6px;
    height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--stk-line) !important;
    background: #fff !important;
    width: 170px;
}
#sticker-dropup .stk-search i { color: #94a3b8 !important; font-size: 12px; }
#sticker-dropup .stk-search input {
    border: none !important; outline: none !important; box-shadow: none !important;
    background: transparent !important;
    color: var(--stk-ink) !important;
    -webkit-text-fill-color: var(--stk-ink) !important;
    font: 500 13px 'Outfit', 'Cairo', system-ui, sans-serif;
    width: 100%; min-width: 0; padding: 0;
}
#sticker-dropup .stk-icon-btn {
    width: 32px; height: 32px;
    border-radius: 10px;
    border: 1px solid var(--stk-line) !important;
    background: #fff !important;
    color: var(--stk-muted) !important;
    cursor: pointer;
    display: grid; place-items: center;
    font-size: 13px;
}
#sticker-dropup .stk-icon-btn:hover { color: var(--stk-ink) !important; border-color: #cbd5e1 !important; }
#sticker-dropup .stk-icon-btn.danger:hover { color: #dc2626 !important; border-color: #fecaca !important; background: #fef2f2 !important; }

.stk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
}
.stk-tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: 14px;
    border: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    background-image:
        linear-gradient(45deg, #eef2f7 25%, transparent 25%, transparent 75%, #eef2f7 75%),
        linear-gradient(45deg, #eef2f7 25%, transparent 25%, transparent 75%, #eef2f7 75%) !important;
    background-size: 16px 16px !important;
    background-position: 0 0, 8px 8px !important;
    cursor: pointer;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    animation: stkIn .3s ease-out both;
}
@keyframes stkIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.stk-tile img {
    position: absolute; inset: 8px;
    width: calc(100% - 16px); height: calc(100% - 16px);
    object-fit: contain;
    pointer-events: none;
}
.stk-tile:hover {
    transform: translateY(-2px);
    border-color: #a5b4fc !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}
.stk-tile-name {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 14px 8px 6px;
    font: 600 11.5px 'Outfit', 'Cairo', system-ui, sans-serif;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: linear-gradient(to top, rgba(15, 23, 42, .75), transparent) !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0;
    transition: opacity .15s;
}
.stk-tile-add {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
}
.stk-tile-add span {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: 99px;
    background: #6366f1 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font: 700 12px 'Outfit', 'Cairo', system-ui, sans-serif;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
}
.stk-tile-actions {
    position: absolute; top: 6px; right: 6px;
    display: flex; gap: 4px;
    opacity: 0;
    transition: opacity .15s;
}
.stk-tile-actions button {
    width: 26px; height: 26px;
    border-radius: 8px;
    border: none !important;
    background: rgba(255, 255, 255, .95) !important;
    color: #475569 !important;
    font-size: 11px;
    cursor: pointer;
    display: grid; place-items: center;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
}
.stk-tile-actions button:hover { color: #0f172a !important; }
.stk-tile-actions button.del:hover { color: #dc2626 !important; }
.stk-tile:hover .stk-tile-name,
.stk-tile:hover .stk-tile-add,
.stk-tile:hover .stk-tile-actions { opacity: 1; }
@media (hover: none) {
    .stk-tile-actions, .stk-tile-name { opacity: 1; }
}

/* placeholder while the AI draws */
.stk-tile.stk-busy {
    cursor: default;
    display: grid; place-items: center;
    background: linear-gradient(110deg, #f1f5f9 30%, #ffffff 50%, #f1f5f9 70%) !important;
    background-size: 220% 100% !important;
    animation: stkShimmer 1.3s linear infinite;
    border-style: dashed !important;
}
.stk-busy-inner {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 8px;
    text-align: center;
    font: 600 11.5px 'Outfit', 'Cairo', system-ui, sans-serif;
    color: #6366f1 !important;
    -webkit-text-fill-color: #6366f1 !important;
}
.stk-busy-inner i { font-size: 20px; animation: stkBob 1s ease-in-out infinite; }
.stk-busy-inner em { font-style: normal; color: #94a3b8 !important; -webkit-text-fill-color: #94a3b8 !important; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes stkShimmer { to { background-position: -120% 0; } }
@keyframes stkBob { 50% { transform: translateY(-3px) rotate(-8deg); } }

.stk-empty {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 22px 12px;
    border: 1.5px dashed #e2e8f0;
    border-radius: 14px;
    text-align: center;
    color: #94a3b8 !important;
    font-size: 13px;
}
.stk-empty i { font-size: 24px; color: #cbd5e1 !important; }

/* ── All stickers window ───────────────────────────────────── */
.stk-all-overlay {
    position: fixed;
    top: 0; left: 0;
    width: var(--app-vw, 100vw);
    height: var(--app-vh, 100vh);
    z-index: 2147483000;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 20px;
    font-family: 'Outfit', 'Cairo', system-ui, sans-serif;
}
.stk-all-overlay.show { display: flex; animation: cmFadeIn .2s ease-out; }
.stk-all-box {
    width: min(920px, 100%);
    max-height: 100%;
    display: flex; flex-direction: column;
    background: #fff !important;
    color: #1e293b !important;
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
    overflow: hidden;
}
.stk-all-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #eef2f7;
}
.stk-all-head .stk-all-title {
    flex: 1;
    font-size: 18px; font-weight: 700;
    color: #1e293b !important;
    -webkit-text-fill-color: #1e293b !important;
}
.stk-all-head input {
    width: 220px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #1e293b !important;
    -webkit-text-fill-color: #1e293b !important;
    font: 500 14px 'Outfit', 'Cairo', system-ui, sans-serif;
    outline: none;
}
.stk-all-head button {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: none !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    cursor: pointer;
}
.stk-all-overlay .stk-grid {
    padding: 18px;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

#sticker-dropup .stk-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
#sticker-dropup .stk-seg::-webkit-scrollbar { display: none; }
#sticker-dropup .stk-h small { white-space: nowrap; }

@media (max-width: 640px) {
    #sticker-dropup .stk-search { width: 110px; }
    #sticker-dropup .stk-spacer { display: none; }
    #sticker-dropup .stk-go .stk-go-text { display: none; }
}

/* ── Arabic (RTL) ──────────────────────────────────────────── */
[dir="rtl"] #sticker-dropup .stk-track::after { left: auto; right: 2px; }
[dir="rtl"] #sticker-dropup .stk-switch input:checked + .stk-track::after { transform: translateX(-14px); }
[dir="rtl"] .stk-tile-actions { right: auto; left: 6px; }
[dir="rtl"] .stk-tile-name { text-align: right; }
[dir="rtl"] #sticker-dropup .stk-input::placeholder { text-align: right; }
