/* ============================================
   NEET HUB — Sticker System Styles v2.0
   ============================================
   Major upgrade: bigger picker, hover preview, search bar,
   animated stickers, submission UI, improved grid.
*/

/* ---- STICKER BUTTON ---- */
.sticker-btn {
    position: relative;
}

/* ---- STICKER PICKER ---- */
.sticker-picker {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 420px;
    max-height: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    border-radius: 14px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 245, 255, 0.1);
    z-index: 800;
    flex-direction: column;
    overflow: hidden;
    animation: stickerPickerIn 0.2s ease-out;
}

.sticker-picker.open {
    display: flex;
}

@keyframes stickerPickerIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- PICKER TABS ---- */
.sticker-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.sticker-tab {
    flex: 1;
    padding: 0.6rem 0.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.sticker-tab:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.02);
}

.sticker-tab.active {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
}

/* ---- PACK SEARCH BAR ---- */
.sticker-pack-search-wrap {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    flex-shrink: 0;
}

.sticker-pack-search {
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    outline: none;
    transition: border-color 0.2s;
}

.sticker-pack-search:focus {
    border-color: var(--border-glow);
}

.sticker-pack-search::placeholder {
    color: var(--text-muted);
}

/* ---- GIF SEARCH BAR ---- */
.sticker-search-wrap {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sticker-search {
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
}

.sticker-search:focus {
    border-color: var(--border-glow);
}

.sticker-search::placeholder {
    color: var(--text-muted);
}

/* ---- PACK SELECTOR ---- */
.sticker-pack-bar {
    display: flex;
    gap: 2px;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    overflow-x: auto;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sticker-pack-bar::-webkit-scrollbar {
    height: 4px;
}

.sticker-pack-bar::-webkit-scrollbar-track {
    background: transparent;
}

.sticker-pack-bar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.sticker-pack-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.sticker-pack-btn:hover {
    background: rgba(255,255,255,0.06);
    transform: scale(1.1);
}

.sticker-pack-btn.active {
    background: rgba(0, 245, 255, 0.1);
    border-color: rgba(0, 245, 255, 0.3);
    box-shadow: 0 0 8px rgba(0, 245, 255, 0.15);
}

/* ---- TAB CONTENT (must flex to allow inner scroll) ---- */
.sticker-tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.sticker-tab-content.sticker-tab-active {
    display: flex !important;
}

/* ---- STICKER GRID ---- */
.sticker-grid-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sticker-grid-wrap::-webkit-scrollbar {
    width: 5px;
}

.sticker-grid-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.sticker-grid-wrap::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.sticker-grid-label {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.2rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sticker-pack-count {
    font-size: 0.6rem;
    background: rgba(0, 245, 255, 0.1);
    color: var(--neon-cyan);
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid rgba(0, 245, 255, 0.2);
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.sticker-item {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.15s;
    background: rgba(255,255,255,0.02);
    position: relative;
}

.sticker-item:hover {
    border-color: var(--border-glow);
    background: rgba(0, 245, 255, 0.08);
    transform: scale(1.12);
    z-index: 2;
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.15);
}

.sticker-item:active {
    transform: scale(0.92);
}

/* Emoji stickers in picker */
.sticker-item .sticker-emoji {
    font-size: 2rem;
    line-height: 1;
    transition: transform 0.1s;
}

.sticker-item:hover .sticker-emoji {
    transform: scale(1.1);
}

/* Image stickers in picker */
.sticker-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
    transition: transform 0.1s;
}

.sticker-item:hover img {
    transform: scale(1.05);
}

/* GIF items in grid */
.sticker-item-gif {
    border-radius: 8px;
}

.sticker-item-gif img {
    object-fit: cover;
    padding: 0;
    border-radius: 7px;
}

/* ---- HOVER PREVIEW ---- */
.sticker-hover-preview {
    display: none;
    position: absolute;
    width: 110px;
    height: 110px;
    background: var(--bg-primary);
    border: 2px solid var(--border-glow);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 245, 255, 0.15);
    align-items: center;
    justify-content: center;
    z-index: 900;
    pointer-events: none;
    font-size: 4rem;
    line-height: 1;
    animation: previewPop 0.15s ease-out;
}

.sticker-hover-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    padding: 4px;
}

@keyframes previewPop {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* ---- TENOR SEARCH RESULTS ---- */
.sticker-tenor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.sticker-tenor-item {
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s;
    background: rgba(255,255,255,0.02);
    aspect-ratio: 1;
}

.sticker-tenor-item:hover {
    border-color: var(--border-glow);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.1);
}

.sticker-tenor-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

.sticker-tenor-loading,
.sticker-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 2rem 1rem;
}

.sticker-tenor-attr {
    text-align: center;
    padding: 0.3rem;
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.sticker-load-more {
    display: block;
    width: 100%;
    padding: 0.6rem;
    margin: 0.4rem 0;
    background: rgba(0, 245, 255, 0.08);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 8px;
    color: #00f5ff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}

.sticker-load-more:hover {
    background: rgba(0, 245, 255, 0.15);
    border-color: rgba(0, 245, 255, 0.4);
}

/* ---- FAVORITES ---- */
.sticker-fav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.55rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.sticker-item:hover .sticker-fav-badge {
    opacity: 0.6;
}

/* ---- CUSTOM UPLOAD AREA ---- */
.sticker-upload-area {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.8rem;
}

.sticker-upload-area:hover {
    border-color: var(--border-glow);
    background: rgba(0, 245, 255, 0.03);
}

.sticker-upload-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.sticker-upload-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ---- USER SUBMISSION AREA ---- */
.sticker-submit-area {
    border: 2px dashed rgba(255, 200, 50, 0.3);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.8rem;
    background: rgba(255, 200, 50, 0.02);
}

.sticker-submit-area:hover {
    border-color: rgba(255, 200, 50, 0.5);
    background: rgba(255, 200, 50, 0.05);
}

.sticker-submit-icon {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
}

.sticker-submit-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ---- PENDING STICKERS (admin view) ---- */
.sticker-pending-label {
    color: rgba(255, 200, 50, 0.8);
}

.sticker-pending-count {
    background: rgba(255, 200, 50, 0.15);
    color: rgba(255, 200, 50, 0.9);
    border-color: rgba(255, 200, 50, 0.3);
}

.sticker-pending-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
}

.sticker-pending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: rgba(255, 200, 50, 0.03);
    border: 1px solid rgba(255, 200, 50, 0.1);
    border-radius: 8px;
    transition: background 0.15s;
}

.sticker-pending-item:hover {
    background: rgba(255, 200, 50, 0.06);
}

.sticker-pending-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.sticker-pending-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sticker-pending-name {
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticker-pending-by {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.sticker-pending-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.sticker-pending-approve,
.sticker-pending-reject {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    background: rgba(255,255,255,0.05);
}

.sticker-pending-approve:hover {
    background: rgba(76, 175, 80, 0.2);
    transform: scale(1.1);
}

.sticker-pending-reject:hover {
    background: rgba(244, 67, 54, 0.2);
    transform: scale(1.1);
}

/* ---- MESSAGE STICKER DISPLAY (BIGGER) ---- */
.msg-sticker {
    max-width: 200px;
    max-height: 200px;
    cursor: pointer;
    transition: transform 0.15s;
    border-radius: 8px;
}

.msg-sticker:hover {
    transform: scale(1.08);
}

.msg-sticker-emoji {
    font-size: 5rem;
    line-height: 1.1;
    cursor: default;
    user-select: none;
}

.msg-sticker-gif {
    max-width: 260px;
    max-height: 260px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s;
}

.msg-sticker-gif:hover {
    transform: scale(1.03);
}

/* ---- POP-IN ANIMATION for stickers in chat ---- */
.sticker-pop-in {
    animation: stickerPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes stickerPopIn {
    0% { opacity: 0; transform: scale(0.3); }
    60% { opacity: 1; transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sticker-picker {
        width: calc(100vw - 1rem);
        left: 50%;
        transform: translateX(-50%);
        max-height: 55vh;
        bottom: calc(100% + 4px);
    }

    .sticker-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .sticker-tenor-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sticker-item .sticker-emoji {
        font-size: 1.6rem;
    }

    .sticker-hover-preview {
        display: none !important;
    }

    .msg-sticker-emoji {
        font-size: 4rem;
    }

    .msg-sticker-gif {
        max-width: 200px;
        max-height: 200px;
    }

    .sticker-pack-search-wrap {
        padding: 0.3rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .sticker-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .sticker-item .sticker-emoji {
        font-size: 1.4rem;
    }

    .msg-sticker-emoji {
        font-size: 3.5rem;
    }
}
