/* ===================================
   Emoji Keyboard — Custom Styles
   =================================== */

/* Scrollbar hiding */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Custom scrollbar for textarea */
#emoji-output::-webkit-scrollbar { width: 6px; }
#emoji-output::-webkit-scrollbar-track { background: transparent; }
#emoji-output::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.dark #emoji-output::-webkit-scrollbar-thumb { background: #4b5563; }

/* Category pill active state */
.cat-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  background: #f3f4f6;
  color: #6b7280;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.dark .cat-pill {
  background: #374151;
  color: #9ca3af;
}

.cat-pill:hover {
  background: #e5e7eb;
  color: #374151;
}

.dark .cat-pill:hover {
  background: #4b5563;
  color: #e5e7eb;
}

.cat-pill.active {
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: white;
  border-color: rgba(249,115,22,0.3);
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}

.cat-pill .cat-emoji {
  margin-right: 4px;
}

/* Emoji button */
.emoji-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  font-size: 1.75rem;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  background: #f9fafb;
  transition: all 0.15s ease;
  position: relative;
}

.dark .emoji-btn {
  background: #1e1f32;
}

.emoji-btn:hover {
  background: #ffedd5;
  border-color: #fb923c;
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(249,115,22,0.2);
  z-index: 10;
}

.dark .emoji-btn:hover {
  background: #292524;
  border-color: #f97316;
}

.emoji-btn:active {
  transform: scale(0.95);
}

.emoji-btn.copied {
  animation: pop 0.3s ease;
  background: #dcfce7;
  border-color: #22c55e;
}

.dark .emoji-btn.copied {
  background: #14532d;
  border-color: #22c55e;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Toast animation */
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* Selection indicator */
.emoji-btn.selected {
  border-color: #f97316;
  background: #fff7ed;
}

.dark .emoji-btn.selected {
  background: #431407;
}

/* Loading skeleton */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

.dark .skeleton {
  background: linear-gradient(90deg, #1e1f32 25%, #292524 50%, #1e1f32 75%);
  background-size: 200% 100%;
}

/* Responsive grid sizing */
@media (max-width: 400px) {
  .emoji-btn { font-size: 1.5rem; }
}

/* Focus visible for accessibility */
.emoji-btn:focus-visible,
.cat-pill:focus-visible,
button:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

/* Search input clear button */
#search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239ca3af'%3E%3Cpath d='M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z'/%3E%3C/svg%3E") center/contain no-repeat;
  cursor: pointer;
}

/* Category tabs container scrollbar */
#category-tabs {
  scrollbar-width: none;
}
#category-tabs::-webkit-scrollbar {
  display: none;
}

/* Brand gradient for header */
.brand-gradient {
  background: linear-gradient(135deg, #f97316, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
