/* ═══════════════════════════════════════════════════════════════════════
   EMOJI PICKER FAB - Bouton Flottant Global
   Composant réutilisable pour insertion d'emojis dans tous les champs texte
   Responsive : Desktop / Tablet / Mobile
   ═══════════════════════════════════════════════════════════════════════ */

/* Container */
.emoji-picker-fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow: visible;
}

/* ═══════════════════════════════════════════════════════════════════════
   FAB BUTTON
   ═══════════════════════════════════════════════════════════════════════ */

.emoji-fab-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #5865F2 0%, #EB459E 100%);
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow:
    0 4px 20px rgba(88, 101, 242, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.emoji-fab-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #4752C4 0%, #C73E8C 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.emoji-fab-button:hover {
  transform: scale(1.1);
  box-shadow:
    0 6px 28px rgba(88, 101, 242, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.emoji-fab-button:hover::before {
  opacity: 1;
}

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

.emoji-fab-button.is-open {
  background: #ED4245;
  transform: rotate(90deg);
}

.emoji-fab-button.is-open:hover {
  background: #C73E3E;
}

.emoji-fab-button .fab-icon {
  position: relative;
  z-index: 1;
  line-height: 1;
}

/* Indicateur champ actif (point vert) */
.emoji-fab-button.has-field::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background: #57F287;
  border-radius: 50%;
  border: 2px solid #313338;
  z-index: 2;
}

/* ═══════════════════════════════════════════════════════════════════════
   PICKER POPUP
   ═══════════════════════════════════════════════════════════════════════ */

.emoji-picker-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  right: auto;
  left: auto;
  /* Aligner le bord droit du popup avec le bord droit du bouton FAB (56px) */
  /* Popup 340px - FAB 56px = 284px à gauche du container */
  transform: translateX(calc(-100% + 56px));
  width: 340px;
  max-width: calc(100vw - 48px);
  max-height: 420px;
  background: #2b2d31;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Popup Animation */
.emoji-popup-enter-active,
.emoji-popup-leave-active {
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.emoji-popup-enter-from,
.emoji-popup-leave-to {
  opacity: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   PICKER HEADER - Recherche
   ═══════════════════════════════════════════════════════════════════════ */

.emoji-picker-header {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.emoji-search-input {
  width: 100%;
  padding: 10px 14px;
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #dbdee1;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.emoji-search-input::placeholder {
  color: #72767d;
}

.emoji-search-input:focus {
  border-color: #5865F2;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════
   CATEGORIES TABS
   ═══════════════════════════════════════════════════════════════════════ */

.emoji-categories-tabs {
  display: flex;
  padding: 8px 12px;
  gap: 4px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.emoji-categories-tabs::-webkit-scrollbar {
  display: none;
}

.emoji-category-tab {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0.6;
}

.emoji-category-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.9;
}

.emoji-category-tab.active {
  background: rgba(88, 101, 242, 0.3);
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   EMOJI GRID
   ═══════════════════════════════════════════════════════════════════════ */

.emoji-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  min-height: 200px;
}

.emoji-grid-container::-webkit-scrollbar {
  width: 6px;
}

.emoji-grid-container::-webkit-scrollbar-track {
  background: transparent;
}

.emoji-grid-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.emoji-grid-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

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

.emoji-button {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.emoji-button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.15);
}

.emoji-button:active {
  transform: scale(0.9);
}

/* ═══════════════════════════════════════════════════════════════════════
   NO FIELD HINT
   ═══════════════════════════════════════════════════════════════════════ */

.emoji-no-field-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 16px;
  text-align: center;
}

.emoji-no-field-hint .hint-icon {
  font-size: 32px;
  animation: pulse-hint 2s infinite ease-in-out;
}

.emoji-no-field-hint .hint-text {
  color: #72767d;
  font-size: 14px;
  font-weight: 500;
}

@keyframes pulse-hint {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* ═══════════════════════════════════════════════════════════════════════
   PICKER FOOTER
   ═══════════════════════════════════════════════════════════════════════ */

.emoji-picker-footer {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.emoji-picker-footer .field-indicator {
  font-size: 12px;
  color: #57F287;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE - TABLET
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .emoji-picker-fab-container {
    bottom: 20px;
    right: 20px;
  }

  .emoji-fab-button {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .emoji-picker-popup {
    bottom: calc(100% + 8px);
    transform: translateX(calc(-100% + 52px));
    width: 300px;
    max-height: 380px;
  }

  .emoji-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .emoji-button {
    font-size: 20px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE - MOBILE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .emoji-picker-fab-container {
    bottom: 16px;
    right: 16px;
  }

  .emoji-fab-button {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .emoji-picker-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    right: auto;
    left: auto;
    transform: translateX(calc(-100% + 48px));
    width: 300px;
    max-width: calc(100vw - 32px);
    max-height: 50vh;
  }

  .emoji-picker-header {
    padding: 10px;
  }

  .emoji-search-input {
    padding: 8px 12px;
    font-size: 16px; /* Prevent iOS zoom */
  }

  .emoji-categories-tabs {
    padding: 6px 10px;
  }

  .emoji-category-tab {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .emoji-grid-container {
    padding: 10px;
    min-height: 150px;
  }

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

  .emoji-button {
    font-size: 24px; /* Plus gros pour le touch */
  }

  .emoji-no-field-hint {
    padding: 24px 12px;
  }

  .emoji-no-field-hint .hint-icon {
    font-size: 28px;
  }

  .emoji-no-field-hint .hint-text {
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE - VERY SMALL SCREENS
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 360px) {
  .emoji-picker-fab-container {
    bottom: 12px;
    right: 12px;
  }

  .emoji-picker-popup {
    bottom: calc(100% + 6px);
    right: auto;
    left: auto;
    transform: translateX(calc(-100% + 44px));
    width: 280px;
    max-width: calc(100vw - 24px);
    max-height: 45vh;
  }

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