/* ═══════════════════════════════════════════════════════════════════════
   CONFIG BOT ACTION BAR - Barre d'action flottante
   Pour les sections editables (Branding, Notifications, Settings)
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   MAIN CONTAINER
   ═══════════════════════════════════════════════════════════════════════ */

.config-bot-action-bar {
  position: fixed;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  cursor: grab;
  user-select: none;
  transition: all 0.2s ease;
}

.config-bot-action-bar:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  border-color: var(--border-hover, var(--border));
}

.config-bot-action-bar.is-dragging {
  cursor: grabbing;
  opacity: 0.9;
  transform: scale(1.02);
}

.config-bot-action-bar.has-changes {
  border-color: var(--warning);
  box-shadow: 0 8px 32px rgba(255, 193, 7, 0.15);
}

.config-bot-action-bar.is-collapsed {
  padding: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════════════════
   DRAG HANDLE
   ═══════════════════════════════════════════════════════════════════════ */

.action-bar-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 32px;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.2s;
}

.action-bar-handle:hover {
  opacity: 1;
}

.handle-dots {
  font-size: 0.8rem;
  letter-spacing: -2px;
}

/* ═══════════════════════════════════════════════════════════════════════
   STATUS BADGE
   ═══════════════════════════════════════════════════════════════════════ */

.action-bar-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* Status: Saving */
.action-bar-status.status-saving {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.action-bar-status.status-saving .status-dot {
  background: var(--info);
  animation: pulse 1s infinite;
}

/* Status: Modified */
.action-bar-status.status-modified {
  background: rgba(255, 193, 7, 0.15);
  color: var(--warning);
}

.action-bar-status.status-modified .status-dot {
  background: var(--warning);
}

/* Status: Saved */
.action-bar-status.status-saved {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.action-bar-status.status-saved .status-dot {
  background: var(--success);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* ═══════════════════════════════════════════════════════════════════════
   DIRTY SECTIONS LIST
   ═══════════════════════════════════════════════════════════════════════ */

.action-bar-sections {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  max-width: 200px;
}

.dirty-section-chip {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  color: var(--warning);
  cursor: pointer;
  transition: all 0.2s;
}

.dirty-section-chip:hover {
  background: rgba(255, 193, 7, 0.2);
  border-color: var(--warning);
}

.chip-icon {
  font-size: 0.75rem;
}

.chip-reset {
  opacity: 0;
  font-size: 0.65rem;
  transition: opacity 0.2s;
}

.dirty-section-chip:hover .chip-reset {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   ACTION BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */

.action-bar-actions {
  display: flex;
  gap: var(--space-2);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 1rem;
}

/* Reset Button */
.btn-reset {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.btn-reset:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Apply Button */
.btn-apply {
  background: var(--primary);
  color: white;
}

.btn-apply:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-apply:active:not(:disabled) {
  transform: translateY(0);
}

/* Spinner Animation */
.btn-icon.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════
   COLLAPSE TOGGLE
   ═══════════════════════════════════════════════════════════════════════ */

.collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.collapse-toggle:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   COLLAPSED STATE
   ═══════════════════════════════════════════════════════════════════════ */

.config-bot-action-bar.is-collapsed .action-bar-sections,
.config-bot-action-bar.is-collapsed .btn-label {
  display: none;
}

.config-bot-action-bar.is-collapsed .action-btn {
  padding: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════════════════
   FADE TRANSITION
   ═══════════════════════════════════════════════════════════════════════ */

.action-bar-fade-enter-active,
.action-bar-fade-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.action-bar-fade-enter-from,
.action-bar-fade-leave-to {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .config-bot-action-bar {
    left: 50% !important;
    right: auto !important;
    bottom: 16px !important;
    top: auto !important;
    transform: translateX(-50%);
    max-width: calc(100vw - 32px);
  }

  .config-bot-action-bar.is-dragging {
    transform: translateX(-50%) scale(1.02);
  }

  .action-bar-sections {
    display: none;
  }

  .btn-label {
    display: none;
  }
}
