/* Blocs ultra-compacts (une ligne par bloc) */
.blocks-ultra-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.block-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.block-line:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  transform: translateX(4px);
}

.block-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.85em;
  font-weight: 700;
  flex-shrink: 0;
}

.block-title-inline {
  flex: 1;
  font-size: 0.9em;
  color: var(--text-primary);
  font-weight: 500;
}

.block-arrow {
  color: var(--primary);
  font-size: 1.2em;
  font-weight: bold;
  flex-shrink: 0;
}

/* Modale des compétences */
.competences-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.competences-modal.active {
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 2px solid var(--border);
  background: linear-gradient(135deg, var(--primary) 0%, #0F4B41 100%);
  color: white;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 600;
  flex: 1;
  padding-right: 16px;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5em;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.modal-code {
  padding: 12px 24px;
  background: var(--bg-secondary);
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-body h4 {
  color: var(--primary);
  margin: 0 0 16px 0;
  font-size: 1.1em;
}

.modal-competences-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: modal-comp-counter;
}

.modal-competence-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  transition: all 0.2s ease;
  counter-increment: modal-comp-counter;
}

.modal-competence-item:hover {
  background: #E3F1EE;
  transform: translateX(4px);
}

.modal-competence-item:last-child {
  margin-bottom: 0;
}

.modal-comp-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.9em;
  font-weight: 700;
  flex-shrink: 0;
}

.modal-comp-number::before {
  content: counter(modal-comp-counter);
}

.modal-comp-text {
  flex: 1;
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-header {
    padding: 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-competence-item {
    padding: 12px;
  }
  
  .block-line {
    padding: 8px 12px;
  }
  
  .block-title-inline {
    font-size: 0.85em;
  }
}
