/* ==========================================================================
   Emoji Keyboard — Premium Styles & Micro-Animations
   ========================================================================== */

/* Font fallbacks for consistent emoji rendering */
.font-emoji {
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}

/* Ensure smooth scrolling throughout */
html {
  scroll-behavior: smooth;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.6);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.9);
}

/* Hide scrollbar for category tabs while maintaining scrollability */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#category-bar {
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

#grid-section {
  scroll-margin-top: 180px;
}

.cursor-grab {
  cursor: grab;
}

.cursor-grabbing {
  cursor: grabbing !important;
  user-select: none !important;
}

#category-scroll-left,
#category-scroll-right {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* --------------------------------------------------------------------------
   Sticky Header Solid Background (Strictly opaque to prevent emoji bleed-through)
   -------------------------------------------------------------------------- */
.sticky-solid {
  background-color: #ffffff !important;
  opacity: 1 !important;
}

.dark .sticky-solid {
  background-color: #0f172a !important; /* Tailwind slate-900 */
  opacity: 1 !important;
}

/* --------------------------------------------------------------------------
   Emoji Grid Cards & Micro-Animations
   -------------------------------------------------------------------------- */
.emoji-btn {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), 
              background-color 0.15s ease, 
              box-shadow 0.15s ease, 
              border-color 0.15s ease;
  will-change: transform;
}

.emoji-btn:hover {
  transform: scale(1.22);
  z-index: 10;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.18), 0 4px 6px -4px rgba(99, 102, 241, 0.12);
}

.emoji-btn:active {
  transform: scale(0.92);
  transition-duration: 0.05s;
}

/* Category Pill Transitions & Active States */
.category-pill {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.category-pill:hover {
  transform: translateY(-1px);
}

/* Active Category Pill: Solid Brand Background with Crisp White Text */
.category-pill.active {
  background-color: #4f46e5 !important; /* brand-600 */
  color: #ffffff !important;
  border-color: #4338ca !important;
  box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.35);
}

/* Active Category Pill when Hovered: Richer Brand Indigo Background with Crisp White Text */
.category-pill.active:hover {
  background-color: #4338ca !important; /* brand-700 */
  color: #ffffff !important;
  border-color: #3730a3 !important;
  box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.45);
}

.dark .category-pill.active {
  background-color: #6366f1 !important; /* brand-500 */
  color: #ffffff !important;
  border-color: #4f46e5 !important;
}

.dark .category-pill.active:hover {
  background-color: #4f46e5 !important; /* brand-600 */
  color: #ffffff !important;
  border-color: #4338ca !important;
}

/* --------------------------------------------------------------------------
   Toast Notification (Bottom Center, High z-index, Spring Entrance)
   -------------------------------------------------------------------------- */
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 99999 !important;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Pulse animation on single copy click */
@keyframes copyPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.copy-pulse {
  animation: copyPulse 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   Skeleton Loader Shimmer
   -------------------------------------------------------------------------- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.dark .skeleton-shimmer {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* --------------------------------------------------------------------------
   Textarea Focus Glow & Styling
   -------------------------------------------------------------------------- */
#emoji-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.6;
}

#emoji-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.dark #emoji-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
}

/* --------------------------------------------------------------------------
   Accordion Animation
   -------------------------------------------------------------------------- */
details summary::-webkit-details-marker {
  display: none;
}

details[open] summary svg {
  transform: rotate(180deg);
}

summary svg {
  transition: transform 0.25s ease;
}
