/* ================================================================================
   MENU CONTEXTUEL DES CONVERSATIONS
   ================================================================================ */

/* Menu contextuel pour les conversations */
.conversation-context-menu {
  position: fixed;
  background: var(--glass-bg, rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--glass-shadow, 0 8px 32px rgba(0, 0, 0, 0.08));
  padding: 8px;
  min-width: 220px;
  z-index: var(--z-dropdown, 1001);
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.conversation-context-menu.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

/* Items du menu */
.conversation-context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: var(--font-size-base, 14px);
  font-weight: var(--font-weight-medium, 500);
  color: var(--text-primary, #2f2f2e);
  background: transparent;
  border: none;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
  font-family: var(--font-family, 'Inter', sans-serif);
}

.conversation-context-menu-item:hover {
  background: rgba(249, 228, 121, 0.15);
  transform: translateX(2px);
}

.conversation-context-menu-item:active {
  transform: translateX(2px) scale(0.98);
}

/* Icônes dans le menu */
.conversation-context-menu-item i {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0.7;
}

.conversation-context-menu-item:hover i {
  opacity: 1;
}

/* Option de suppression en rouge - Style magnifique unifié */
.conversation-context-menu-item.delete {
  /* Conserve la séparation visuelle */
  margin-top: 4px;
  border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
  padding-top: 14px;

  /* Application du magnifique style rouge */
  background-color: var(--red-btn-bg);
  border-left: 1px solid var(--red-btn-border);
  border-right: 1px solid var(--red-btn-border);
  border-bottom: 1px solid var(--red-btn-border);
  color: var(--red-btn-color);
}

.conversation-context-menu-item.delete:hover {
  background: var(--red-btn-bg-hover);
  border-color: var(--red-btn-border-hover);
  border-top-color: var(--red-btn-border-hover);
  transform: translateX(0) translateY(-1px);
}

.conversation-context-menu-item.delete i {
  color: var(--red-btn-color);
}

/* Séparateur */
.conversation-context-menu-separator {
  height: 1px;
  background: var(--border-color, rgba(0, 0, 0, 0.1));
  margin: 8px 0;
}

/* Favoris - étoile dorée quand actif */
.conversation-context-menu-item.favorite-active {
  color: var(--accent-secondary, #C78A1E);
}

.conversation-context-menu-item.favorite-active i {
  color: var(--accent-secondary, #C78A1E);
}

/* Dark mode */
[data-theme="dark"] .conversation-context-menu {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
}

[data-theme="dark"] .conversation-context-menu-item {
  color: var(--text-primary, #f5f5f0);
}

[data-theme="dark"] .conversation-context-menu-item:hover {
  background: rgba(249, 228, 121, 0.15);
}

[data-theme="dark"] .conversation-context-menu-separator {
  background: rgba(255, 255, 255, 0.1);
}

/* Dark mode géré automatiquement par les variables CSS --red-btn-* */

/* Modal de confirmation */
.conversation-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal, 9999);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.conversation-modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.conversation-modal {
  background: var(--glass-bg, rgba(255, 255, 255, 0.98));
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--glass-shadow-hover, 0 16px 48px rgba(0, 0, 0, 0.12));
  padding: 28px;
  max-width: 450px;
  width: 90%;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.conversation-modal-overlay.show .conversation-modal {
  transform: scale(1) translateY(0);
}

.conversation-modal-title {
  font-size: var(--font-size-xl, 18px);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-primary, #2f2f2e);
  margin: 0 0 16px 0;
}

.conversation-modal-content {
  font-size: var(--font-size-base, 14px);
  color: var(--text-secondary, rgba(47, 47, 46, 0.7));
  margin-bottom: 24px;
  line-height: 1.6;
}

.conversation-modal-input {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--font-size-base, 14px);
  font-family: var(--font-family, 'Inter', sans-serif);
  color: var(--text-primary, #2f2f2e);
  background: var(--bg-input, #ffffff);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
  border-radius: var(--radius-md, 8px);
  outline: none;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.conversation-modal-input:focus {
  border-color: var(--accent-primary, #f9e479);
  box-shadow: 0 0 0 3px rgba(249, 228, 121, 0.15);
}

.conversation-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.conversation-modal-button {
  padding: 10px 20px;
  font-size: var(--font-size-base, 14px);
  font-weight: var(--font-weight-medium, 500);
  font-family: var(--font-family, 'Inter', sans-serif);
  border: none;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.conversation-modal-button.cancel {
  background: transparent;
  color: var(--text-secondary, rgba(47, 47, 46, 0.7));
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}

.conversation-modal-button.cancel:hover {
  background: var(--gray-100, #f1f1f1);
  color: var(--text-primary, #2f2f2e);
}

.conversation-modal-button.confirm {
  background: var(--accent-primary, #f9e479);
  color: var(--text-primary, #2f2f2e);
  font-weight: var(--font-weight-semibold, 600);
}

.conversation-modal-button.confirm:hover {
  background: var(--accent-secondary, #C78A1E);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 228, 121, 0.3);
}

.conversation-modal-button.confirm.delete {
  /* Style magnifique rouge unifié pour les modals */
  background-color: var(--red-btn-bg);
  border: 1px solid var(--red-btn-border);
  color: var(--red-btn-color);
  font-weight: 500;
}

.conversation-modal-button.confirm.delete:hover {
  background-color: var(--red-btn-bg-hover);
  border-color: var(--red-btn-border-hover);
  box-shadow: var(--red-btn-shadow);
}

/* Dark mode pour les modals */
[data-theme="dark"] .conversation-modal {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border);
}

[data-theme="dark"] .conversation-modal-title {
  color: var(--text-primary, #f5f5f0);
}

[data-theme="dark"] .conversation-modal-content {
  color: var(--text-secondary, rgba(245, 245, 240, 0.7));
}

[data-theme="dark"] .conversation-modal-input {
  background: var(--bg-input, #262624);
  color: var(--text-primary, #f5f5f0);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .conversation-modal-input:focus {
  border-color: var(--accent-primary, #f9e479);
  box-shadow: 0 0 0 3px rgba(249, 228, 121, 0.15);
}

[data-theme="dark"] .conversation-modal-button.cancel {
  color: var(--text-secondary, rgba(245, 245, 240, 0.7));
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .conversation-modal-button.cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #f5f5f0);
}

/* Dark mode géré automatiquement par les variables CSS --red-btn-* */

/* Toast notifications */
.conversation-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.98));
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--glass-shadow-hover, 0 16px 48px rgba(0, 0, 0, 0.12));
  padding: 16px 20px;
  max-width: 350px;
  z-index: var(--z-toast, 10000);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(400px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.conversation-toast.show {
  transform: translateX(0);
}

.conversation-toast.success {
  border-left: 4px solid var(--accent-success, #22c55e);
}

.conversation-toast.error {
  border-left: 4px solid var(--accent-error, #dc2626);
}

.conversation-toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.conversation-toast.success .conversation-toast-icon {
  color: var(--accent-success, #22c55e);
}

.conversation-toast.error .conversation-toast-icon {
  color: var(--accent-error, #dc2626);
}

.conversation-toast-message {
  font-size: var(--font-size-base, 14px);
  color: var(--text-primary, #2f2f2e);
  font-weight: var(--font-weight-medium, 500);
  line-height: 1.4;
}

/* Dark mode pour les toasts */
[data-theme="dark"] .conversation-toast {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border);
}

[data-theme="dark"] .conversation-toast.success {
  border-left-color: #4ade80;
}

[data-theme="dark"] .conversation-toast.error {
  border-left-color: #ff6b6b;
}

[data-theme="dark"] .conversation-toast-message {
  color: var(--text-primary, #f5f5f0);
}

/* Animation d'entrée pour le menu */
@keyframes slideInMenu {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.conversation-context-menu.show {
  animation: slideInMenu 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
