/* ----- Layout global ----- */
#WorkflowDesigner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-height: 70vh;
  padding: 12px;
  box-sizing: border-box;
  background: #f5f7fb;
  overflow: hidden;
}

/* ----- Paper ----- */
#WorkflowDesignerPaper {
  position: relative;
  width: 100%;
  min-height: 70vh;
  background-color: #ffffff;
  border: 1px solid #e6e9f2;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  overflow: hidden;
  background-image: radial-gradient(circle, #d1d5db 0.8px, transparent 1px);
  background-size: 16px 16px;
  background-position: 0 0;
}
#WorkflowDesignerPaper svg { border-radius: 14px; }

/* État vide (optionnel) */
#WorkflowDesignerPaper.is-empty::after {
  content: "Déposez vos éléments ici";
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #94a3b8; font-size: 14px; pointer-events: none;
}

/* Scrollbar interne (optionnel) */
#WorkflowDesignerPaper ::-webkit-scrollbar { height: 10px; width: 10px; }
#WorkflowDesignerPaper ::-webkit-scrollbar-thumb { background: #d4d8e1; border-radius: 10px; }
#WorkflowDesignerPaper ::-webkit-scrollbar-track { background: transparent; }

/* ----- Sidebar droite ----- */
#WorkflowDesigner-Sidebar {
  position: absolute;
  top: 0px;                   
  right: 0px;                 
  width: 360px;               
  height: calc(100% - -12px - 12px);
  background: #fff;
  border: 1px solid #e6e9f2;
  box-shadow: 0 12px 32px rgba(16,24,40,0.14);
  z-index: 10;                
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* état replié / animé */
  transform: translateX(120%);  
  transition: transform 220ms ease;
}

/* en mode ouvert : le conteneur porte la classe */
#WorkflowDesigner.is-sidebar-open #WorkflowDesigner-Sidebar {
  transform: translateX(0);
}

/* en-tête de la side bar */
#WorkflowDesigner-Sidebar > header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f6;
  background: #f9fafb;
}
#WorkflowDesigner-Sidebar > header button {
  border: none; 
  background: transparent; 
  cursor: pointer; 
  font-size: 16px;
}

#WorkflowDesigner-Sidebar .content {
  overflow: auto;
  margin: 0px;
  margin-bottom: 50px;
}

#WorkflowDesigner.is-sidebar-open #WorkflowDesignerPaper {
  filter: saturate(0.96);
}

/* top toolbar actions */
#WorkflowDesignerToolbar .top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* paper controls (flottant, en haut à droite du paper) */
#WorkflowDesignerPaper { position: relative; }
.WorkflowDesigner-paper-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 12;
}

.WorkflowDesigner-pc-btn {
  background: rgba(17,24,39,0.9);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2,6,23,0.2);
}
.WorkflowDesigner-pc-btn:hover { transform: translateY(-1px); }
/* Styles pour les icônes d'action */
.WorkflowDesigner-action-icon-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
}

.WorkflowDesigner-action-icon-container i {
  font-size: 48px;
  color: #6366f1;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.2));
  transition: all 0.2s ease;
}

/* Styles alternatifs pour différents types d'icônes */
.WorkflowDesigner-action-icon-container i.fa-cog,
.WorkflowDesigner-action-icon-container i.fa-cogs {
  color: #3b82f6;
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.2));
}

.WorkflowDesigner-action-icon-container i.fa-bolt {
  color: #f59e0b;
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.2));
}

.WorkflowDesigner-action-icon-container i.fa-check {
  color: #10b981;
  filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.2));
}

.WorkflowDesigner-action-icon-container i.fa-map-signs {
  color: #6366f1;
  filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.2));
}

.WorkflowDesigner-action-icon-container i.fa-times {
  color: #ef4444;
  filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.2));
}

/* ===================================
   STYLE DES ÉTAPES
   =================================== */
.WorkflowDesigner-etape-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.WorkflowDesigner-etape-icon {
    font-size: 24px;
    color: #0ea5e9;
    filter: drop-shadow(0 2px 4px rgba(14, 165, 233, 0.3));
    flex-shrink: 0;
}

.WorkflowDesigner-etape-label {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


#WorkflowDesigner-btn-auto-create.is-processing {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.WorkflowDesigner-selection-delete-btn {
  display: none;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.WorkflowDesigner-selection-delete-btn.is-visible {
  display: inline-flex;
}

.WorkflowDesigner-selection-delete-btn:hover {
  background: #b91c1c;
}