/* Container principale con dimensioni RIGIDAMENTE fisse */
#diagram-container {
  position: relative;
  width: 100%;
  height: 600px !important; /* Altezza fissa FORZATA */
  max-height: 600px !important; /* Massima altezza */
  min-height: 600px !important; /* Minima altezza */
  overflow: auto !important;
  background: #f0f0f0;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

/* Il diagram interno */
#diagram {
  position: relative;
  transform-origin: 0 0;
  background: transparent;
  box-sizing: border-box;
  /* Le dimensioni vengono gestite dinamicamente dal JS */
}

/* Assicurati che il diagram non causi overflow del body */
body {
  overflow-x: hidden;
}

/* Se il container è dentro un parent flex/grid, forza le dimensioni */
#diagram-container-wrapper {
  display: block;
  width: 100%;
  height: 600px;
  overflow: hidden;
}

.state-box {
  width: fit-content;
  max-width: 250px;
  min-width: 120px;
  padding: 5px 10px;
  background-color: #cce5ff;
  border: 2px solid #3399ff;
  position: absolute;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

.state-box.selected {
  border: 2px dashed #ff9900;
  background-color: #fff3cd;
}

.state-box.info {
  border: 2px dashed #e800ff;
  background-color: #f5cdff;
}

.state-box > .top-text,
.state-box > .bottom-text {
  padding: 5px 0;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  text-align: center;
}

.state-box > .top-text {
  border-bottom: 1px solid #3399ff;
  font-size: 14px;
  font-weight: bold;
  color: #003366;
  margin-top: 10px;
}

.state-box > .bottom-text {
  font-size: 12px;
  font-weight: normal;
  color: #336699;
}

.connection-label {
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid #ccc;
  pointer-events: none;
}

#modePanel button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.active {
  transition: color .2s ease;
  background-color: #cce5ff;
  color: #0092ffe0;
  border-radius: 0.3rem;
}

.active .text-muted {
    color: #0092ffe0 !important;
    transition: color 0.2s ease;
}

#containerAllWorkflowProfile .fw-semibold {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.state-box.remove {
  border: 2px dashed #ff0093;
  background-color: #f20b3d3b;
}

.gear-button:hover i {
  color: #3399ff;
}

.impagination {
  background-color: white;
  transition: background-color 0.2s ease;
}

.impagination:hover {
  cursor: pointer;
}

.page-item:hover {
  cursor: pointer;
}

.deleted-cell {
  text-decoration: line-through;
  opacity: 0.6;
}

.deleted-striped {
    background-image: repeating-linear-gradient(
        45deg,
        #e0e0e0,
        #e0e0e0 37px,
        #cccccc 20px,
        #cccccc 46px
    );
    color: #6c757d !important;
}

.tr-row-overlay-cell {
    position: relative;
    padding: 0;
    height: 0;
}

.tr-row-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(25, 135, 84, 0.9);
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    animation: fadeOutOverlay 1.5s forwards;
    border-radius: 0.3rem;
}

@keyframes fadeOutOverlay {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.floating-save .mini-check { 
    transition: transform .15s ease, opacity .15s ease; 
}

.floating-save .mini-check:hover { 
    transform: scale(1.04); 
}

#tableExecution thead .select2-container {
  width: 100% !important;
  min-width: 0;
}

#tableExecution thead .select2-selection--single {
  padding: .25rem 2.5rem;
}

.swal2-overflow .swal2-html-container {
    overflow: visible !important;
    max-height: none;
}

.color-option:hover .color-box {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2) !important;
}

.color-option {
    transition: transform 0.2s;
}

#noteText:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

#diagram.note-mode {
    cursor: crosshair;
}

/* Stili per fullscreen */
#diagram-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    background: #f0f0f0;
    padding: 20px;
}

#diagram-container:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    background: #f0f0f0;
    padding: 20px;
}

#diagram-container:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    background: #f0f0f0;
    padding: 20px;
}

#diagram-container:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    background: #f0f0f0;
    padding: 20px;
}

.add-condition-btn:hover * {
    color: #ffffff !important;
}