/**
 * Emoji Picker Styles
 */

.textarea-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.textarea-container textarea {
  width: 100%;
  padding-right: 45px; /* Место для кнопки */
}

.emoji-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: all 0.2s;
  z-index: 10;
}

.emoji-btn:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
  transform: scale(1.05);
}

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

.emoji-picker {
  position: absolute;
  width: 350px;
  max-height: 400px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  display: flex;
  flex-direction: column;
}

.emoji-picker-header {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
}

.emoji-search {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.emoji-search:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.emoji-close {
  padding: 8px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #64748b;
  border-radius: 6px;
  transition: all 0.2s;
}

.emoji-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.emoji-categories {
  overflow-y: auto;
  max-height: 330px;
  padding: 12px;
}

.emoji-categories::-webkit-scrollbar {
  width: 8px;
}

.emoji-categories::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.emoji-categories::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

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

.emoji-category {
  margin-bottom: 16px;
}

.emoji-category:last-child {
  margin-bottom: 0;
}

.emoji-category-name {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 4px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.emoji-item {
  padding: 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e0;
  transform: scale(1.15);
}

.emoji-item:active {
  transform: scale(0.95);
  background: #e2e8f0;
}

/* Адаптивность */
@media (max-width: 480px) {
  .emoji-picker {
    width: 95vw;
    max-width: 350px;
    left: 50% !important;
    transform: translateX(-50%);
  }
  
  .emoji-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .emoji-item {
    font-size: 22px;
    padding: 6px;
  }
}

/* Анимация появления */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.emoji-picker {
  animation: fadeIn 0.2s ease-out;
}
