/* Custom CSS for Emoji Keyboard */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-emoji {
  font-family: var(--font-emoji);
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
  transition: background 0.2s ease;
}

.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Horizontal pills scrollbar hiding */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Emoji Grid Cell Optimization & Micro-Animations */
.emoji-cell {
  content-visibility: auto;
  contain-intrinsic-size: 52px;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.16s ease,
              box-shadow 0.16s ease,
              border-color 0.16s ease;
}

.emoji-cell:hover {
  transform: translateY(-3px) scale(1.22);
  z-index: 10;
}

.emoji-cell:active {
  transform: scale(0.92);
}

/* Toast Animations */
@keyframes toastSlideUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 24px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes toastSlideDown {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 16px) scale(0.94);
  }
}

.toast-enter {
  animation: toastSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-exit {
  animation: toastSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Ripple effect on click */
.ripple-fx {
  position: relative;
  overflow: hidden;
}

.ripple-fx::after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(99, 102, 241, 0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 1s;
}

.ripple-fx:active::after {
  transform: scale(0, 0);
  opacity: 0.35;
  transition: 0s;
}

/* Subtle glow effect */
.glow-on-hover:hover {
  box-shadow: 0 0 20px -3px rgba(99, 102, 241, 0.35);
}

/* Smooth Category Sticky Transition */
.category-header {
  scroll-margin-top: 240px;
}

@media (max-width: 640px) {
  .category-header {
    scroll-margin-top: 280px;
  }
}
