.interactive-demo {
  margin: 20px 0;
}

.demo-controls {
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.control-button {
  padding: 8px 16px;
  border: 2px solid #007bff;
  background: white;
  color: #007bff;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.control-button:hover,
.control-button.active {
  background: #007bff;
  color: white;
}

.interactive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 80px);
  gap: 10px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  transition: all 0.3s;
}

.interactive-item {
  background: #007bff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: bold;
  transition: all 0.3s;
}

.interactive-subgrid {
  display: grid;
  grid-column: 2 / -1;
  grid-row: 2 / -1;
  background: rgba(220, 53, 69, 0.1);
  border: 2px dashed #dc3545;
  border-radius: 4px;
  transition: all 0.3s;
}

.interactive-subgrid.subgrid-cols {
  grid-template-columns: subgrid;
  grid-template-rows: repeat(2, 60px);
}

.interactive-subgrid.subgrid-rows {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: subgrid;
}

.interactive-subgrid.subgrid-both {
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
}

.interactive-subgrid.no-subgrid {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 60px);
}

.sub-item {
  background: #dc3545;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: bold;
}